Add program to JWM notification area (Solved)
Fossapup64 9.5
I'd like to add alsamixer to the JWM notification area, but haven't found any howto info on the forum.
Thanks
wizard
Discussion, talk and tips
https://forum.puppylinux.com/
Fossapup64 9.5
I'd like to add alsamixer to the JWM notification area, but haven't found any howto info on the forum.
Thanks
wizard
If you mean putting the executable on the system tray (on the right), this script from musher0 works for me (I'm using debian puppies):
Code: Select all
yad --notification --command='/path/of/your/script' --image=/path/of/your/png_icon 2>/dev/null
I'll modify it as needed and place it in the /root/startup folder (and make it executable). The condition is to have yad installed.
https://oldforum.puppylinux.com/viewtopic.php?t=112892
It works, thanks. Here is the solution code:
This is amix-tray.sh which puts the icon in the tray.
Code: Select all
#! /bin/bash
#adds icon to JWM tray in the right side notification area
#--text = mouse over tooltip text
#runs alsamixer.sh script when icon is clicked
#place in /root/startup directory
#by wizard on the Puppy Linux forum
#thanks to Feek and musher0
yad --notification --text="volume" --command="/root/my-applications/bin/alsamixer.sh" --image=/usr/share/pixmaps/puppy/media-play.svg 2>/dev/null
This is alsamixer.sh which runs alsamixer when the icon is clicked.
Code: Select all
#! /bin/bash
#opens alsamixer audio control program
#by wizard on the Puppy Linux forum
#displays message to use arrow keys to change settings
#-t = display time in milliseconds
notify-send -t 4000 "User arrow keys to change"
#runs alsamixer
x-terminal-emulator -e /usr/bin/alsamixer
A copy of the scripts is attached.
wizard
@wizard :-
I've been using those for ages, mate. Fred & Musher0 came up with that for me - I was the one who originally asked about it on the old Forum - some 5 or 6 years ago. It also got modified to add right-click options, too; here's a copy of the tray entry that fires-up & runs my QuickAudioSwap utility, which lets me swap between the internal sound card and my USB wireless headphones without needing a re-boot:-
Code: Select all
#!/bin/sh
#
# Place QuickAudioSwap icon in tray - thanks to musher0/fredx181
#
yad --notification --item-separator=":" --no-middle --text="QuickAudioSwap" --command='/usr/local/bin/audioswap' --image='/usr/share/pixmaps/audioswap.png' --menu="TrayIcon - autostart ON:asyes.sh:gtk-apply|TrayIcon - autostart OFF:asno.sh:gtk-cancel|Webcam level reset...:CamChooser.sh:gtk-preferences|Sound cards...:arecord.sh:gtk-preferences|About...:audioswap-about.sh:gtk-preferences|Quit:quit:gtk-stop"
Format for the right-click items is:-
Item name->colon->executable->colon->icon
.....then a 'pipe' symbol between each entry. No spaces.....except between quotation marks for the item names.
Thought you might like the extra functionality. YAD is quite versatile! v0.40.0 is the best, I find. Attached below; 32- and 64-bit .pets . (I forget which Pups I compiled them in, but these are "generics"; should work anywhere).
I've also included a script from Smokey01's on-line YAD tutorial:-
....which will display the full list of your installed GTK icons. Just remove the 'fake' .gz.
Mike.
Thanks for weighing in on this, I'd seen some post you made referencing icons with popup menus, but couldn't find any code examples.
Still have more to learn about how to manipulate JWM.
wizard
@wizard :-
You're welcome!
TBH, it's not often I publish code snippets anyway. If I want to find out how part of a program/app works, I tend to download it, pull it to bits and examine it to find out how it does what it does! I guess I kind of assumed other people would do the same if they want to find out how something of mine works....
(*shrug*)
Mike.