Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-12-08 01:36:48

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 506

changes i just made

i put some bash code in file ~/.xsessionrc to start logging the bash script that sources this file and then execute ~/.xsessionex (a name i made up) if it exists as a file, is readable, and is executable.  here is my ~/.xsessionrc file:

ymdhms=$(exec /bin/date +%Y%m%d-%H%M%S)
mask=$(umask)
umask 0022
exec &>$ymdhms-$USER-xsessionrc.log
umask $mask

if [[ -f $HOME/.xsessionex && -r $HOME/.xsessionex && -x $HOME/.xsessionex ]]; then
    $HOME/.xsessionex &>$ymdhms-$USER-xsessionex.log
fi

this runs my custom executable code as a separate process so i can do more things such as use python.  but, for now, i'm still using bash.  next is my ~/.xsessionex file:

#!/bin/bash

ymdhms=$(exec date +%Y%m%d-%H%M%S)

if [[ -d .newstuff && -r .newstuff && -x .newstuff ]]; then
    /usr/bin/rsync --backup-dir=.oldstuff-$ymdhms -aHSWv .newstuff/. .
    /bin/rm -frv .finstuff-$ymdhms
    /bin/mv -v .newstuff .finstuff-$ymdhms
fi

exit 0

this is a procedure to check for the existence of a subdirectory named ~/.newstuff.  if it exists, it is copied to the home directory with any replaced files backed up in ~/.oldstuff-$ymdhms that has a timestamp at the end.  then the new stuff is moved so this noes not repeat.

the purpose of this is to give me a means to replace xfce configuration files directly.  note that logging out is insufficient for this since xfce leaves certain processes running in the background, such as the daemon that reads, writes, and caches the configuration files.  it will work when rebooting.

i'm thinking about ideas to deal with this.  one possibility is for this code to hard kill those processes assuming that when xfce is started, it will find those processes missing and restart them.  i need to do more tests.

Offline

Board footer

Powered by FluxBB