Add program to JWM notification area (Solved)

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
wizard
Posts: 1986
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2652 times
Been thanked: 692 times

Add program to JWM notification area (Solved)

Post by wizard »

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

Last edited by wizard on Fri Jul 07, 2023 1:01 pm, edited 1 time in total.

Big pile of OLD computers

Feek
Posts: 398
Joined: Sun Oct 18, 2020 8:48 am
Location: cze
Has thanked: 54 times
Been thanked: 90 times

Re: Add program to JWM notification area

Post by Feek »

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

User avatar
wizard
Posts: 1986
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2652 times
Been thanked: 692 times

Re: Add program to JWM notification area

Post by wizard »

@Feek

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

Attachments
amix-tray.sh.gz
remvoe fake .gz
(401 Bytes) Downloaded 29 times
alsamixer.sh.gz
remvoe fake .gz
(286 Bytes) Downloaded 40 times

Big pile of OLD computers

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

Re: Add program to JWM notification area (Solved)

Post by mikewalsh »

@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:-

https://smokey01.com/yad/

....which will display the full list of your installed GTK icons. Just remove the 'fake' .gz.

Mike. ;)

Attachments
GTK-icons.sh.gz
Displays your installed gtk-icon set...
(4.59 KiB) Downloaded 33 times
yad-0.40.0-amd64.pet
64-bit YAD binary...
(346.68 KiB) Downloaded 33 times
yad-0.40.0-i686.pet
32-bit YAD binary...
(356.91 KiB) Downloaded 33 times
User avatar
wizard
Posts: 1986
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2652 times
Been thanked: 692 times

Re: Add program to JWM notification area (Solved)

Post by wizard »

@mikewalsh

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

Big pile of OLD computers

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

Re: Add program to JWM notification area (Solved)

Post by mikewalsh »

@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. ;)

Post Reply

Return to “Users”