I like option 2, mate. With a head like mine, 'simple' is good, in my book..!fredx181 wrote:Hi Mike, something like this ?
Using a named pipe and added --listen and --no-middle to the notification command.
(without --no-middle the icon quits by mouse middle click)To make more menu entries it would be something like:Code: Select all
#!/bin/sh # function quit_tray quit_tray () { # quit tray echo "quit" > $PIPE # cleanup, remove $PIPE rm -f $PIPE }; export -f quit_tray # create PIPE export PIPE="/tmp/Y_NOTI_BRIGHT.$RANDOM" mkfifo $PIPE # attach a file descriptor to the file exec 3<> $PIPE # send menu to $PIPE echo menu:"Quit!bash -c quit_tray!gtk-quit" >$PIPE & yad --notification --listen --no-middle --text="Brightness control" --command='./usr/local/bin/Bright' --image='/usr/local/lib/X11/pixmaps/Bright.png' <&3
FredCode: Select all
echo menu:"Quit!bash -c quit_tray!gtk-quit| \ NAME!COMMAND!ICON| \ NAME!COMMAND!ICON" >$PIPE &
No, the modified 'one-liner' is exactly what I was looking for. It means that for some of my commonly-used tray 'utilities', if I don't want 'em there permanent, like, I can just dismiss 'em when I want to.
I want to re-build a few of my small 'tray-based' utilities as ROX-Apps - using your build-scripts - so I can dismiss 'em when required, in the same way that I can clear bigger self-extracters/portables by clicking the window 'X' (or click 'Cancel', or 'Quit' if it exists in the app itself).
Until now, the only way to get rid of the tray icon has been to re-start 'X'.....which isn't always convenient (especially if you're in the middle of summat important, y'know)? I remember I rebuilt a couple of 'em with a pinstall.sh for greengeek, but the way he runs his custom Slacko 560 is as a permanent 'Live' session, never saving except to external media.....so for him it all resets at every boot anyway.
Looking at stu91's script, I didn't think the one-liner could be quite that simple. That is very much appreciated.
Thanks, Fred!
Mike.