Page 1 of 1

Ptray 0.5

Posted: Fri 06 Feb 2009, 13:23
by zigbert
Ptray
Utility trays with editor for JWM.


Ptray has moved into the Stardust desktop environment







--- OLD ----------------------------------------------------------------------------

to activate your tray:
1. edit /etc/xdg/templates/_root/.jwmrc
change:
<Include>/root/.jwmrc-tray</Include>
to:
<Include>/root/.jwmrc-tray</Include>
<Include>/root/.jwmrc-tray-top</Include>
<Include>/root/.jwmrc-tray-add_widget</Include>
<Include>/root/.jwmrc-tray-add_icon</Include>

2. restart JWM

Download
username: puppy
password: linux

Ptray-0.5 (9 kb).

Image

Changelog:
______________________
Version 0.5 - 23.Feb 2009
- fixmenus and globicons is NOT longer a part of the package
- Use 16x16 icon if defined 48x48 icon (in globicons) doesn't exist.
______________________
Version 0.4 - 13.Feb 2009
- include handling of add_icon tray and add_widget tray.
______________________
Version 0.3 - 6.feb 2009
- Use icon from .desktop file if not present in Globicons (thanks to HairyWill)
- Xlock points to /usr/local/apps/Xlock/AppRun (thanks to HairyWill)
______________________
Version 0.2 - 6.feb 2009
- Hide tray button

Posted: Fri 06 Feb 2009, 14:59
by HairyWill
Good. This needed its own thread.

There is a problem with the lock button.
If you call xlock before setting a password it will freeze your screen because it expects the password to be set on the console.
It is safer to call /usr/local/apps/Xlock/AppRun which includes code to check for this problem and ask the user to set a password.

Posted: Fri 06 Feb 2009, 16:04
by zigbert
Apprun shall be

Posted: Fri 06 Feb 2009, 16:53
by HairyWill
you might consider this in func

Code: Select all

function MakeIconList(){
	sleep 1
	: > $HOME/.ptray/icon-list
	DESKTOPFILES=(`find /usr/share -name '*.desktop'`)
	for FILE in ${DESKTOPFILES[@]}; do
		ICON=$(grep Icon $FILE| sed 's/Icon=//g')
		APP=$(grep Exec $FILE | sed 's/Exec=//g' | cut -d ' ' -f 1)
		echo $APP,$ICON >> $HOME/.ptray/icon-list
	done
}

GetIcon(){
if [ "$(which $1)" ]; then # only get icons for applications in the path
	LINE="$(cat $HOME/.ptray/icon-list | grep $1 | tail -1)" #get the last match so that we can pick up new additions
	ICONNAME=$(echo $LINE | cut -d ',' -f 2)
	if [ -e "$ICONNAME" ] ; then
		ICON=$ICONNAME
	elif [ -e "/usr/local/lib/X11/pixmaps/$ICONNAME" ]; then
		ICON="/usr/local/lib/X11/pixmaps/$ICONNAME"
	elif [ -e "$HOME/.icons/$ICONNAME" ]; then
		ICON="$HOME/.icons/$ICONNAME"
	elif [ -e "/usr/share/pixmaps/$ICONNAME" ]; then
		ICON="/usr/share/pixmaps/$ICONNAME"
	elif [ -e "/usr/local/lib/X11/mini-icons/$ICONNAME" ]; then
		ICON="/usr/local/lib/X11/mini-icons/$ICONNAME"
	fi
	if [ ! "$LINE" ]; then #checking LINE instead of PIC allows it to fail faster on subsequent runs
		ICON=$(find /usr -name "$1*" | grep -E '\.xpm$|\.png$'| head -1)
		echo "$1,$ICON" >> $HOME/.ptray/icon-list
	fi
fi
}

Code: Select all

#hairywill
MakeIconList
	while read I; do
		#find description
		if [ "`find /usr/share/applications/ -iname "*$I*"`" ]; then
			TMP=`find /usr/share/applications/ -iname "*$I*"`
			POPUP="`cat $TMP | grep -m 1 Name | cut -d '=' -f 2`"
		else
			POPUP=""
		fi
		#find icon
		ICON="`cat $HOME/.config/rox.sourceforge.net/ROX-Filer/globicons | grep -m 1 -A 1 $I | cut -d '>' -f 2 | cut -d '<' -f 1 | grep -v "^$"`"
#hairywill
		[ ! "$ICON" ]  && GetIcon $I
		if [ ! "$ICON" ]; then ICON=star48.png; fi
If the icon isn't specified in globicons it will try and use something specified by the .desktop file before using the generic star. Often this will result in a 16x16 pixmap being enlarged. There is a trade off here between the aesthetics of an ugly icon and the usability of a generic icon which gives no hint as to the application it launches. This is less of a problem if one chooses to reduce the height of the tray.

Posted: Fri 06 Feb 2009, 18:07
by zigbert
HairyWills improvements are added to version 0.3
See main post.

Posted: Tue 10 Feb 2009, 20:22
by zigbert
Version 0.3-1
See main post

This one is packed with another fixmenus script after WhoDos request.

Posted: Fri 13 Feb 2009, 20:48
by zigbert
Version 0.4
See main post

Posted: Sat 14 Feb 2009, 08:40
by 01micko
Hi guys,

I installed Ptray-0.4 today on my 412 box today.

Unfortunately it still crashed the main tray when trying to switch themes. I don't know if it is related to Ptray but when I reinstalled Ptray I recovered (and so did JWM :lol: )

Is there a logfile for this? If so I'll post it.

Posted: Sat 14 Feb 2009, 08:49
by WhoDo
01micko wrote:Unfortunately it still crashed the main tray when trying to switch themes. I don't know if it is related to Ptray but when I reinstalled Ptray I recovered (and so did JWM :lol: )

Is there a logfile for this? If so I'll post it.
The problem isn't in ptray, it's in the Gtk theme switcher. Check the Alpha4 bugs thread for Hairywill's patch to fix. It definitely works. Either that or wait a couple of hours for Beta1 with the fix embedded. :wink:

Posted: Tue 24 Feb 2009, 07:47
by puppyluvr
:D zigbert,
Love the Ptray..
One ?....How do I remove the spacers?
:D

Posted: Tue 24 Feb 2009, 08:06
by zigbert
puppyluvr
The easiest would be:
1. build the tray the way you want it
2. config manually - remove empty buttons (spacers)
3. restart jwm


Sigmund

Posted: Tue 24 Feb 2009, 13:18
by puppyluvr
:D Hello,
Thanks, I had already done that, but they were still there..
Then I discovered that some buttons were pointing to non existing icons...Fixed them, and all is well... :D
Thx...Jay...

Posted: Thu 16 Apr 2009, 14:10
by DaveS
Could you please explain the process by which Ptray sets itself up? Specifically, how it gathers info for adding programs/icons to the top tray. I am having some problems with adding programs, specifically, TkSpider and also CUPS. I guess something is broken in the chain of info gathering, so, say, TkSpider displays the star icon instead of the correct one. If I could understand the chain, I could fix it I think.

Posted: Fri 17 Apr 2009, 11:16
by zigbert
DaveS
Ptray uses the information in /root/Choices/ROX-filer/globicons. If target is not found here it uses the specs in /usr/share/applications/name_of_program.desktop.

I have not looked into your specific case. Please report if you find any bugs.


Sigmund

Ptray 0.5 in Upup476

Posted: Fri 19 Jun 2009, 17:37
by Schism
I have ptray working in upup476. It didn't work at first and all of a sudden I installed technosaurus's gpe-0.117-i486.pet and it all of a sudden worked. Though the Poweroff, Show Desktop, and Lock Screen buttons don't work along with the icon not being available for Edit Tray. How can i fix this?

Posted: Tue 21 Jul 2009, 02:11
by stiginge
Seems like there a bug or problem with manually configuring ptray-top (from the gui button). Whenever I save my changes to the configuration file it just keeps reverting back to the previous code after I've made relevant changes (correcting link to icon).