Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 31 Jul 2014, 19:43
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Refreshing Wbar mod for pwidgets
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
Geoffrey


Joined: 30 May 2010
Posts: 1328
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Thu 28 Apr 2011, 06:29    Post subject:  Refreshing Wbar mod for pwidgets
Subject description: modifying pwidget so that wbar can refresh on wallpaper change
 

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:
-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:
-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:
#!/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:
#!/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:
#!/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:
#!/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
Back to top
View user's profile Send private message 
dalebednell


Joined: 12 Feb 2010
Posts: 119
Location: portugal

PostPosted: Sun 17 Jun 2012, 09:59    Post subject: Refreshing Wbar mod for pwidgets  

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0561s ][ Queries: 12 (0.0042s) ][ GZIP on ]