Refreshing Wbar mod for pwidgets

Window managers, icon programs, widgets, etc.
Post Reply
Message
Author
User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

Refreshing Wbar mod for pwidgets

#1 Post by Geoffrey »

I just recently tried a copy of Lucid 5.2.5 and installed wbar and pwidgets from the package manager.

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
-stop) replace the line that reads "mv /usr/sbin/fixwidgets /usr/sbin/fixwidgets.bak"

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
	;;
newcode for fixwidgets.bak, edit this with pwidgets stopped or it won't exist.

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
Create a fixwidgets-wbar.bak file in /usr/sbin/ and make it executable

Code: Select all

#!/bin/sh
#FixWidgets
killall wbar
exec /root/Startup/wstart
Create a file called "fixwidgets" in /usr/sbin/ and make it executable, make sure pwidget is stopped or it will over write the existing one.
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
Create a file called "pwidgets-running.bak" in /usr/sbin/ , this is a blank file.

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
Well this works for me, so if your game have a go, I hope the tutorial is understandable, if anyone tries it let me know how it went.

might be safer to try it on a new save first, I don't want to be responsible if things break.

Geoffrey

User avatar
dalebednell
Posts: 120
Joined: Fri 12 Feb 2010, 09:44
Location: portugal
Contact:

Refreshing Wbar mod for pwidgets

#2 Post by dalebednell »

Hi dude
I'm following your link not shore where do i find this file
newcode for fixwidgets.bak, edit this with pwidgets stopped or it won't exist.

Add these lines:
#refresh wbar
killall wbar
exec /root/Startup/wstart &
can you help talk me through it thanks

Post Reply