Currently, this is just a one liner but I'll edit this post shortly to put it in script format. The one liner is for testing.
Code: Select all
cat ./.jwmrc-tray | sed -rn '/^.*<\/Swallow>.*$/ {H;x;s#(.*)(<Swallow[^<]*.*xload.*$)#\1#p;x;d};{H;};$ {x;p}'
My motivation here, is that in the highly restricted containers used by @rufwoof and also possibly EasyOS users by default, I noticed that the xload tag is problematic and any errors in an init script cause the container to fail to start. Also in general I would like to minimize the amount of try based applications running when starting a desktop in a chroot or container to save system resources.
However, it should be easy enough for the end user to do this so in any chroot/container based system I distributed I would just like to remove the most problematic tray items and leave it up to the user if they want to remove more. Also I want some consistency between more highly restricted environment and lower restricted environments (e.g. just using unshare to get a unique process namespace).
I was able to do this with a simpler script in previous container based systems I've released but in the next example, I'm trying, "4.31 Phoenix - An update of 4.31 with glibc 2.19", the relevant xml tags span multipole lines. Here is an example:
Code: Select all
<Swallow name="xload" width="32">
xload -nolabel -bg "#888888" -fg red -hl white
</Swallow>
also note, that I'm planning to implement an option to have specific .jwmrc and .jwmrc-tray files for the container. If these files exist they will be renamed from .jwmrc_container and .jwmrc-tray_container to .jwmrc and .jwmrc-tray respectively and otherwise, I will strip problematic components from these using sed, ssed, perl, python or awk.