Ptray 0.5

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

Ptray 0.5

#1 Post 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
Last edited by zigbert on Sun 21 Mar 2010, 19:25, edited 10 times in total.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#2 Post 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.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#3 Post by zigbert »

Apprun shall be

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#4 Post 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.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#5 Post by zigbert »

HairyWills improvements are added to version 0.3
See main post.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#6 Post by zigbert »

Version 0.3-1
See main post

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

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#7 Post by zigbert »

Version 0.4
See main post

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#8 Post 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.
Puppy Linux Blog - contact me for access

User avatar
WhoDo
Posts: 4428
Joined: Wed 12 Jul 2006, 01:58
Location: Lake Macquarie NSW Australia

#9 Post 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:
[i]Actions speak louder than words ... and they usually work when words don't![/i]
SIP:whodo@proxy01.sipphone.com; whodo@realsip.com

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#10 Post by puppyluvr »

:D zigbert,
Love the Ptray..
One ?....How do I remove the spacers?
:D

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#11 Post 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

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#12 Post 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...

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#13 Post 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.
Spup Frugal HD and USB
Root forever!

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#14 Post 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

User avatar
Schism
Posts: 78
Joined: Fri 12 Dec 2008, 15:50

Ptray 0.5 in Upup476

#15 Post 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?

User avatar
stiginge
Posts: 420
Joined: Thu 22 Mar 2007, 10:10
Location: Kerry, Ireland

#16 Post 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).
Buy silver, crash JPMorgan

Post Reply