easy tray menu - consider adding it to MX-16

Here you can exchange scripts that you created or have permission to share with other users.
Message
Author
user755
Posts: 35
Joined: Sat Nov 05, 2016 8:14 am

easy tray menu - consider adding it to MX-16

#1 Post by user755 »

to have stuff in the system tray - both in KDE as well as XFCE - can be done real quick: just run this one-liner:

:turtle: :turtle: yad --notification --menu="xfce4-appfinder so-called!xfce4-appfinder|Firefox webbrowser!firefox" & :snail: :snail:

for a menu to start Firefox or Appfinder, mid-button to quit. This is very convenient, because some of the best apps must be added manually to a menu. Here is a super convenient menu: no endless password entry required for thunar (dolphin) etc.
tmss.png
save it as /home/demo/traymenu file and goto services / autostart to activate. Just so convenient ! :puppy:
tooltip.jpg
(note: the attachment (unfortunately invisible to unregistered users) is just some tm.png icon, use any other icon that you like in its place , i.e. /home/demo/tm.png ! (I used a cookie or an ace of hearts playing card icon in the screen shots)

Code: Select all

#!/bin/bash

# This is the Traymenu script, which can be conveniently auto-started at every log-in.

#     it must reside as an executable (set the EXE bit attribute) text file   named  :      /home/demo/traymenu

# You can add menu items in a very simple manner, by adding a line in this script file.
# This makes sense for programs which are not found by "App-finder"
# and hence must be added manually: possible examples are "packagesearch", "apper" or "xara".
# make sure you have a nice icon file in place at: /home/demo/tm.png

#  click middle mouse button to quit this Traymenu

PIPE="$HOME/.pipe.tmp"
rm          $PIPE
mkfifo      $PIPE
exec 3<>    $PIPE
yad --notification --listen                                               <&3 &


# do not use ~ , use  $HOME  instead                    
echo "menu:\
appfinder                     !xfce4-appfinder &        |\
edit 'extlinux.conf' bootmenu !gksudo -u root leafpad   /live/boot-dev/boot/extlinux/extlinux.conf & |\
su thunar                     !gksudo -u root thunar    |\
                                                        |\
edit this tray menu  2.4      !leafpad $HOME/traymenu   |\
new tray menu after edit      !     $HOME/traymenu      |  "              >&3


echo "icon:$HOME/tm.png"                                                  >&3
echo "tooltip:Tray menu - right click on icon for a user-modifiable menu" >&3


# release thread 2016 :  this version = 2.4     https://forum.mxlinux.org/viewtopic.php?p=396865#p396865


Last edited by user755 on Tue Nov 15, 2016 7:25 am, edited 23 times in total.

User avatar
richb
Administrator
Posts: 10322
Joined: Wed Jul 12, 2006 2:17 pm

Re: super easy tray menu with yad

#2 Post by richb »

Nice tip.
Forum Rules
Guide - How to Ask for Help

richb Administrator
System: MX 23 KDE
AMD A8 7600 FM2+ CPU R7 Graphics, 16 GIG Mem. Three Samsung EVO SSD's 250 GB

user755
Posts: 35
Joined: Sat Nov 05, 2016 8:14 am

Re: super easy tray menu with yad

#3 Post by user755 »

some stuff in yad does not work, however. like I dont think you can have a custom icon if you use CLI line without PIPE like in the second example.

--paned seems broken too, asf. that's why yad is in the "unstable" repo.

User avatar
anticapitalista
Developer
Posts: 4160
Joined: Sat Jul 15, 2006 10:40 am

Re: super easy tray menu with yad

#4 Post by anticapitalista »

It is also in stretch
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

user755
Posts: 35
Joined: Sat Nov 05, 2016 8:14 am

convenient tray menu

#5 Post by user755 »

long form

Code: Select all



#!/bin/bash

# To show a menu with an icon in the system tray. Tested OK on MX-15 and MX-16 (XFCE and KDE desktop).
# Don't forget to put a proper nice icon file in place ! Autostart works nicely using system settings. use ksysguard to end "yad".

PIPE="$HOME/.pipe.tmp"
rm $PIPE                   # never mind the error message
mkfifo $PIPE
exec 3<> $PIPE

yad --notification --listen <&3 &

# define the menu entries
echo "menu:\
run Kate!kate|\
run VLC media Player!vlc|\
test button-press 5 !echo "Button 5 was clicked" " >&3 # visible only if you run this script in xterm / Konsole

# broken - not working:
# Notify user in X!notify-send "notify you on X screen"|\

#Name of menu
echo "tooltip: user defined tray menu with YAD" >&3

# Icon of tray menu - make sure it exists , some icon-files will not work, just try several of them.
echo "icon:/home/demo/yad.png" >&3





user755
Posts: 35
Joined: Sat Nov 05, 2016 8:14 am

Re: easy tray menu - consider adding it to MX-16

#6 Post by user755 »

:cat:

User avatar
Jerry3904
Administrator
Posts: 21881
Joined: Wed Jul 19, 2006 6:13 am

Re: easy tray menu - consider adding it to MX-16

#7 Post by Jerry3904 »

Thanks for posting that. If you really want that considered, though, you need to replace the KDE elements, because to include them hauls in piles of other stuff.
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

user755
Posts: 35
Joined: Sat Nov 05, 2016 8:14 am

Re: easy tray menu - consider adding it to MX-16

#8 Post by user755 »

OK

User avatar
Jerry3904
Administrator
Posts: 21881
Joined: Wed Jul 19, 2006 6:13 am

Re: easy tray menu - consider adding it to MX-16

#9 Post by Jerry3904 »

Okey Dokey
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

user755
Posts: 35
Joined: Sat Nov 05, 2016 8:14 am

easy tray menu - tests fine in pristine MX-16

#10 Post by user755 »

test report: :fox:

I booted MX-16 with no persist. The tray menu (current OP version at the time of writing !) worked flawlessly. :fox:

No KDE refined software was required to download, in order to obtain 100% functionality right out of the box of "MX-16 beta". :fox:

Tray-menu will be a very convenient aid so people can launch some of their best apps where app-finder is out of his element! :fox:

Post Reply

Return to “Scripts”