I was wondering why wbar didn't refresh when the wallpaper was changed, yet pwidgets does, so I had a look to see what could be done about it, pwidgets uses fixwidgets
located in /usr/sbin to update the widgets, but when it's not active renames it to fixwidgets.bak, so I could create a new fixwidgets script so that wbar could use it.
Wbar uses the wstart script in /root/Startup to run, so to get it to run from fixwidgets it needs to be disabled, the easiest way is to do that is to create a script in Startup that kills wbar thus
allowing the fixwidgets script to run it instead, this way no changes to wbar are needed, just doing this allows the wallpaper changer to refresh wbar,
but if I have pwidgets and wish to run it I had to reconfiguer how it runs.
To change pwidget to allow it to run either by itself or with wbar, it needs to have a few minor changes made to the func script located in /usr/local/pwidgets and 4 scripts in /usr/sbin.
Pwidget looks to see if fixwidgets is in usr/sbin to see if it is running, so I created a blank file called pwidgets-running.bak that is placed in usr/sbin and edited the
/usr/local/pwidgets/func.
create the 3 other scripts: fixwidgets.bak which is the original with wbar added, "fixwidgets" which only has wbar startup, this isn't really needed, but is there
only if you already have wbar installed, as pwigets will create it when it's stopped from the "fixwidgets-wbar.bak".
new code for the func script
-stopstart) replace "fixwidgets" with "pwidgets-running"
Code: Select all
-stopstart)
if [ -f /usr/sbin/pwidgets-running ]; then
with these:
rm /usr/sbin/fixwidgets
rm /usr/sbin/pwidgets-running
cp /usr/sbin/fixwidgets-wbar.bak /usr/sbin/fixwidgets
-start) replace the line that reads "mv /usr/sbin/fixwidgets.bak /usr/sbin/fixwidgets"
with these:
rm /usr/sbin/fixwidgets
cp /usr/sbin/pwidgets-running.bak /usr/sbin/pwidgets-running
cp /usr/sbin/fixwidgets.bak /usr/sbin/fixwidgets
Code: Select all
-stop)
rm /usr/sbin/fixwidgets
rm /usr/sbin/pwidgets-running
cp /usr/sbin/fixwidgets-wbar.bak /usr/sbin/fixwidgets
for I in `ps -eo pid,command | grep -wE "conky|xonclock|xli|http://rss.accuweather.com" | awk '{print $1}'`; do kill -9 $I; done
for I in `ps -eo pid,command | grep "mplayer -wid " | awk '{print $1}'`; do kill -9 $I; done
rm $HOME/.pwidgets/Pwidgets_background
TMP="`cat $HOME/.config/wallpaper/bg_img`"
/usr/local/apps/Wallpaper/set_bg "$TMP"
;;
-start)
rm /usr/sbin/fixwidgets
cp /usr/sbin/pwidgets-running.bak /usr/sbin/pwidgets-running
cp /usr/sbin/fixwidgets.bak /usr/sbin/fixwidgets
fixwidgets -wallpaper_setter
;;
Add these lines:
#refresh wbar
killall wbar
exec /root/Startup/wstart &
Code: Select all
#!/bin/sh
#FixWidgets - Pwidgets starter script
#kill old widgets
for I in `ps -eo pid,command | grep -wE "conky|jwm-applet|xonclock|xli|http://rss.accuweather.com" | awk '{print $1}'`; do kill -9 $I; done
for I in `ps -eo pid,command | grep "mplayer -wid " | awk '{print $1}'`; do kill -9 $I; done
#refresh wbar
killall wbar
exec /root/Startup/wstart &
if [ "`cat $HOME/.config/wallpaper/bg_img`" = "" ]; then
Code: Select all
#!/bin/sh
#FixWidgets
killall wbar
exec /root/Startup/wstart
This isn't really needed, if this isn't made then pwidgets will have to start and then stop to create it from the fixwidgets-wbar.bak file
Code: Select all
#!/bin/sh
#FixWidgets
killall wbar
exec /root/Startup/wstart
In /root/Startup/, create a script called "wbar_start_fixwidgets" and put in this code and make it executable
Code: Select all
#!/bin/sh
killall wbar
might be safer to try it on a new save first, I don't want to be responsible if things break.
Geoffrey