Change all icons in the Tray, apps and utility too ?

Moderator: Forum moderators

Post Reply
Jamayka24
Posts: 60
Joined: Sat Jul 20, 2024 1:20 am
Location: 7 Countries, now Jamaica
Has thanked: 6 times
Been thanked: 1 time

Change all icons in the Tray, apps and utility too ?

Post by Jamayka24 »

I'm a Bookworm student- I cant 'read' the icons in the tray - they have not reduced
well from from what were designed as large icons. They need to be simpler
and visually give some idea of what they are referring to. Also they lack coolness,
very important nowadays so they say. I don't see any other ones available.
I want to try to change them. I could draw new ones if I had to, but how to get
them in the tray?

dpupbw64_10.0.7 , i5, 8Gb ram, Save on sda2 (USB partition), no HDD

User avatar
nilsonmorales
Posts: 169
Joined: Thu Dec 26, 2019 1:47 am
Location: El Salvador
Has thanked: 63 times
Been thanked: 96 times
Contact:

Re: Change all icons in the Tray, apps and utility too ?

Post by nilsonmorales »

Hello and welcome, I made some notes, is in spanish but could be helpful for you
viewtopic.php?t=11314

Jamayka24
Posts: 60
Joined: Sat Jul 20, 2024 1:20 am
Location: 7 Countries, now Jamaica
Has thanked: 6 times
Been thanked: 1 time

Re: Change all icons in the Tray, apps and utility too ?

Post by Jamayka24 »

I speak Spanish well enough but your linked posts are much too
complicated for an old man. I will just have to put up with the ugly icons.
Thanks !

dpupbw64_10.0.7 , i5, 8Gb ram, Save on sda2 (USB partition), no HDD

User avatar
mikewalsh
Moderator
Posts: 6022
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 731 times
Been thanked: 1895 times

Re: Change all icons in the Tray, apps and utility too ?

Post by mikewalsh »

@Jamayka24 :-

I've used various iterations of radky's JWMDesk Manager for years. It's up to around v3.7/3.8.....somewhere like that, but my favourite version has always been v2.4.3.

Roger's stuff has always been very well thought-out & exquisitely executed, yet I found that from around v3.0 onwards, with all the new stuff that was being added, that it was beginning to get over-complicated.....and although this is in no way a criticism of Roger's work, it's been getting so that much of the newer stuff - for building/customizing themes, customizing the top window bar, adding different button themes AND a ton of other things - is no longer exactly intuitive. Not for me, at any rate.

There MAY well be a GUI method now for changing the tray icons to one's personal taste.....but I kinda got lost with a lot of the new stuff, and I just didn't bother digging that deep.

Myself, I've always modified the 'tray' manually, by directly editing /root/.jwmrc-tray (this is one of the 'hidden' files in /root), which you access by clicking on ROX's 'eye' icon in the Menu bar at the top of the window. You can change icons for any of the 'launcher' buttons immediately to the right of the Menu/Start button in the bottom left corner. Anything in the 'notification' area - over to the right, near the clock - those are all covered by ROX's 'swallow' function, which I've never really understood.....and I don't think you CAN change THOSE particular icons. There may be a way, but it would involve modifying the 'short' .desktop files in /root/.config/autostart; TBH, I've never bothered to modify these, and just leave them as they come.

=========================

For modifying the 'quick launch' buttons on the left hand side, only three things are needed. A 'title' - which shows as a 'popup' when you hover over the button. An icon.....and the $PATH to your executable.

There's been a lot of discussion about suitable icons over the years; many maintain that to do things the correct way, you MUST use 16x16 icons down here.....and they HAVE to be in .xpm format. I've never bothered with all that. I always use PNG icons, because of the transparency layer these come with, and ranging in size anywhere from 128x128 up to 512x512.....and ROX-Filer will automatically resize icons to 16x16 for the tray OR 48x48 for the desktop 'pinboard', irrespective of the size you use.

I have a directory with an eclectic selection of nearly 900 assorted PNG icons that I've amassed over the years from hundreds of Google/DuckDuckGo searches, OR which I've actually created myself. I'm not a fan of 'themed' icon sets, despite that many here seem to love 'em; I would far sooner an icon showed me what it actually does, rather than some vague, generic 'stylistic' indication of what it MIGHT be for.

I also loathe the modern 'flat' icon fad. Eurrrgh! My favourite period of design was around late WinXP/early Vista, when icons had a '3D' effect, with sharp, clean lines, highlights/shadows, etc., and an icon immediately made it crystal clear what the button was supposed to do. And they LOOKED good!

But I digress.

===========================

You can usually find something like what you want by doing a search for, say, "PNG icons for (whatever)" That's all I use. When you've found something you like & have downloaded it, you want to stick it in one of the image directories that are "in the $PATH"; these are standard locations where your Puppy will always look for icons by default. In theory, you then only need to use the name of the icon; you don't even need to add the ".jpg/.png/whatever" after it. I always use the full $PATH, so that there can be NO mistake.......despite that this is NOT the "Linux way"! :D

The most common ones are:-

  • /usr/share/pixmaps

  • /usr/local/lib/X11/pixmaps

  • /usr/share/midi-icons is a sym-link to the above

There's also one at /usr/local/share/pixmaps, but very few apps or people tend to use this one. I'd bung 'em in /usr/share/pixmaps, if that was me; it's the most common location for 'one-off' icons by a mile.

And then all you do is to change the icon location in /root/.jwmrc-tray. Then, run

Code: Select all

jwm -restart

.....in the terminal, and Bob's yr uncle! you should now have changed your icon.

===========================

That's how I approach this. But many will have different preferred approaches to mine.....

Mike. ;)

Jamayka24
Posts: 60
Joined: Sat Jul 20, 2024 1:20 am
Location: 7 Countries, now Jamaica
Has thanked: 6 times
Been thanked: 1 time

Re: Change all icons in the Tray, apps and utility too ?

Post by Jamayka24 »

@mikewalsh
" Anything in the 'notification' area - over to the right, near the clock - those are all covered by ROX's 'swallow' function, which I've never really understood.....and I don't think you CAN change THOSE particular icons "

Those are the ugly ones Mike! I'm going to forget them and move on :-))

dpupbw64_10.0.7 , i5, 8Gb ram, Save on sda2 (USB partition), no HDD

HerrBert
Posts: 350
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 119 times

Re: Change all icons in the Tray, apps and utility too ?

Post by HerrBert »

Jamayka24 wrote: Sat Sep 07, 2024 6:02 pm

@mikewalsh
" Anything in the 'notification' area - over to the right, near the clock - those are all covered by ROX's 'swallow' function, which I've never really understood.....and I don't think you CAN change THOSE particular icons "

Those are the ugly ones Mike! I'm going to forget them and move on :-))

These icons are not covered by JWM's 'swallow' function:

dock-icons.jpg
dock-icons.jpg (5.68 KiB) Viewed 314 times

IDK exactly where they are located in bw, but the ones i modified are located in different places in s15pup64.

User avatar
mikewalsh
Moderator
Posts: 6022
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 731 times
Been thanked: 1895 times

Re: Change all icons in the Tray, apps and utility too ?

Post by mikewalsh »

@HerrBert :-

Hah. Well, that's good to know......although I'm not sure as you'd be able to change pmcputemp's icons. Didn't Micko build everything into a binary?

Mike. ;)

HerrBert
Posts: 350
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 119 times

Re: Change all icons in the Tray, apps and utility too ?

Post by HerrBert »

mikewalsh wrote: Sat Sep 07, 2024 7:46 pm

@HerrBert :-

Hah. Well, that's good to know......although I'm not sure as you'd be able to change pmcputemp's icons. Didn't Micko build everything into a binary?

Mike. ;)

Yes. you are right. pcputemp has its icon(s) hardcoded. Option is to use dark or light 'theme'
[edit] changed pmcputemp to pcputemp. Actually using pcputemp 0.3

Jamayka24
Posts: 60
Joined: Sat Jul 20, 2024 1:20 am
Location: 7 Countries, now Jamaica
Has thanked: 6 times
Been thanked: 1 time

Re: Change all icons in the Tray, apps and utility too ?

Post by Jamayka24 »

@mikewalsh
I copied that icon tutorial and will print it off and get to it
when I have a chance. Appreciated !

dpupbw64_10.0.7 , i5, 8Gb ram, Save on sda2 (USB partition), no HDD

User avatar
rockedge
Site Admin
Posts: 6353
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2538 times
Been thanked: 2514 times
Contact:

Re: Change all icons in the Tray, apps and utility too ?

Post by rockedge »

those are all covered by ROX's 'swallow' function, which I've never really understood

very simply put the <swallow></swallow> tag in JWM will start and execute a program and display an icon from that executed program in the tray on the right hand side.

JWM configuration also has a similar tag that I use in the .jwmrc to add the CPU temp to the tray
<StartupCommand>start_cputemp &</StartupCommand>

User avatar
mikewalsh
Moderator
Posts: 6022
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 731 times
Been thanked: 1895 times

Re: Change all icons in the Tray, apps and utility too ?

Post by mikewalsh »

rockedge wrote: Mon Sep 09, 2024 10:58 am

those are all covered by ROX's 'swallow' function, which I've never really understood

very simply put the <swallow></swallow> tag in JWM will start and execute a program and display an icon from that executed program in the tray on the right hand side.

JWM configuration also has a similar tag that I use in the .jwmrc to add the CPU temp to the tray
<StartupCommand>start_cputemp &</StartupCommand>

@rockedge :-

Hmm. Erik, d'you reckon I could get the GPU temps showing in the tray by using the above command?

I built the NvidiaTrayTemp utility a while back, for on-demand checking from an executable icon over on the right-hand side of the tray. It'll work for both 'official' AND 'nouveau' - it auto-checks when starting - and displays a GTK-dialog banner at the top of the screen (with an animated GIF, and text that changes colour as temps rise).

I don't care about the eye-candy ( :D ) , but if I could just get the temps themselves to show in the tray I would be MORE than happy. The utility lets you choose between occasional, on-demand checking, or you can opt for a continuous display if you really need to keep an eye on it......so if I could figure out how to send THAT latter figure to the tray (and KEEP updating itself!), that would do me a treat.

Mike. ;)

User avatar
rockedge
Site Admin
Posts: 6353
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2538 times
Been thanked: 2514 times
Contact:

Re: Change all icons in the Tray, apps and utility too ?

Post by rockedge »

@mikewalsh basically what poorercputemp does is check the temperature sensors in a loop and generates a .svg image of those values that is displayed on the tray and gets continuously updated by the check the sensor loop.

The image is generated in /tmp/poorercputemp/temp.svg

Screenshot(17).jpg
Screenshot(17).jpg (16.38 KiB) Viewed 171 times
Screenshot(18).jpg
Screenshot(18).jpg (17.58 KiB) Viewed 171 times

So in your case something similar could be used. poorercputemp is written in C (I think) but this could be done and a daemon capable program could be written in PERL, Python or BASH shell script.

Do you have anything started?

HerrBert
Posts: 350
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 119 times

Re: Change all icons in the Tray, apps and utility too ?

Post by HerrBert »

Just to sort things out:
Neither pcputemp nor pmcputemp or poorercputemp are 'swallowed' in JWM tray. They are running in the dock area.
I did a search on swallowed apps with only few results. xload is swallowed on most puppies by default. Tried some other x-apps, that will also be swallowed:
xclock, xeyes.
Curious about what else JWM tray can swallow.

Copied from /usr/local/jwm_config/tray:

Code: Select all

'In addition to docked apps, you can define specific apps to appear (swallowed) in the tray. Choose from the list or edit to swallow app (few apps allow swallowing).'
User avatar
mikewalsh
Moderator
Posts: 6022
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 731 times
Been thanked: 1895 times

Re: Change all icons in the Tray, apps and utility too ?

Post by mikewalsh »

@rockedge :-

Mm.....no. Not as yet. Well, nowt like you're suggesting; I have a utility - NvidiaTrayTemp - which I built to tackle this. This is just scripted in Bash; there's not much to it, really. When I originally started kicking the idea around this rather empty skull of mine ( :lol: ) - several months ago - somebody was asking about a way to quickly query GPU temps for an Nvidia card. My ears perked up at this - my GPU is also Nvidia - and it kicked my grey matter into high gear!

I half-thought about "hacking" Micko's pmcputemp (which I've used for several years) to see if I could turn it into pmgputemp. But that's a no-go, since Micko compiled everything into a hard-coded binary. If he ever DID make the source code available, it will have gone into the cybertrash when he shut his sites down.

That was why I came up with the idea of simply displaying the temp along with an animated GIF in a gtk-dialog banner at the top of the screen, executed from an on-demand 'click' on an executable icon you could put in the tray, as & when needed. Fred and musher0 between them helped me figure that one out several years ago, and I've used the concept for no end of stuff since).

On clicking the icon, the main script first checks to see if the Nvidia kernel module exists. If it does, it queries the nvidia-smi CLI client in /usr/bin which comes with every driver package. If it doesn't exist, it knows the official driver is not present and instead checks for the reported GPU temp from the 'nouveau' driver. This is usually found at

Code: Select all

/sys/class/hwmon/hwmon0/temp1_input

......with the CPU generally occupying

Code: Select all

/sys/class/hwmon/hwmon0/temp0_input

After this, I came up with the idea of changing the colour of the displayed text in the banner as the displayed temperature rose, to give a simple visual clue, ranging from green, thru yellow, orange and finally red. That worked OK, so I then added a few other things via the tray icon's right-click menu.....including a way to customise the display banner by adding your own GPU's model/number, plus a help file. (I DO think this last is always useful, because although you (as the developer) know exactly how things work, you can't expect every user to automatically know how your thought processes worked when you built it)!

I researched a LOT of stuff for the first time which I'd never previously needed, finding much valuable material over at StackExchange (the stuff they discuss across the entire range of StackExchange sites is frankly mind-boggling. Anything you need an answer to, or an opinion on, will be found on one of their sites.....like

  • AskUbuntu

  • Linux & Unix

  • ServerFault

....to name just a few).

So; when I saw your info above about a way to display continuously-updating stuff in the tray, naturally I thought of my original idea again! :lol:

Do bear in mind that, as it stands, I specifically built this utility to work for Nvidia cards. But if we could figure out a reproducible mechanism, I see no reason why we couldn't make it work for AMD and Intel graphics as well. Either that, or we could produce different versions. Whatever.

=====================================

Here's the script that actually does the work:-

Code: Select all

#!/bin/sh
#
# Display Nvidia GPU core temp at a click...
#
# Determine kernel release...
uname -r > /tmp/kernel.txt
UNAME=$(cat /tmp/kernel.txt)
GPU=$(cat /etc/gpulabel.txt)
ICON="/usr/local/lib/X11/pixmaps/gpufans.gif"
# Get 'official' temperature...or 'nouveau' temperature
if [ -f "/lib/modules/$UNAME/kernel/drivers/video/nvidia.ko" ]
then
	nvidia-smi --query --display=temperature | grep "GPU Current Temp" >/tmp/gputemp.txt
	cat /tmp/gputemp.txt | tr -d -c 0-9 > /tmp/extract.txt
	GPUTEMP=$(cat /tmp/extract.txt)
	#
	if (( $GPUTEMP <= 50 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg "#0DF842" -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
	#
	if (( $GPUTEMP >= 51 && $GPUTEMP <= 65 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg yellow -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
	#
	if (( $GPUTEMP >= 66 && $GPUTEMP <= 80 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg "#F69B09" -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
	#
	if (( $GPUTEMP >= 81 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg red -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
elif [ ! -f "/lib/modules/$UNAME/kernel/drivers/video/nvidia.ko" ]
then
	cat /sys/class/hwmon/hwmon0/temp1_input > /tmp/nouveau.txt
	NOUVEAUTEMP=$(cat /tmp/nouveau.txt)
	GPUTEMP=$(( $NOUVEAUTEMP / 1000 ))
	#
	if (( $GPUTEMP <= 50 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg "#0DF842" -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
	#
	if (( $GPUTEMP >= 51 && $GPUTEMP <= 65 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg yellow -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
	#
	if (( $GPUTEMP >= 66 && $GPUTEMP <= 80 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg "#F69B09" -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
	#
	if (( $GPUTEMP >= 81 ))
	then
		/usr/lib/gtkdialog/gtkdialog-splash -icon $ICON -placement top -bg "#1C3818" -fg red -text "    GPU ~ $GPU : core temp  ~  $GPUTEMP C    " -close never -timeout 10
	fi
fi

The original thread is here:- https://forum.puppylinux.com/viewtopic.php?t=9943

.....and this is how it displays at the top of the screen:-

Image

That flicker is the script re-running on repeat in a for.....while.....done loop when in 'continuous display' mode.

All I'd like to do is to put that final bit - the GPU temp figure - into the tray in the same way as pmcputemp does.

Any suggestions/pointers/assistance with figuring this one out WOULD be much appreciated! In MY mind, I rank this alongside my long-running quest to build that elusive portable-Chrome browser.... :shock: :D :thumbup:

Mike. ;)

Post Reply

Return to “Graphics/Video”