Welcome!

Please read this important information about Spectre and Meltdown vulnerabilities.
Please read this important information about MX sources lists.

News
  • MX Linux on social media: here
  • Mepis support still here
Current releases
  • MX-17.1 Final release info here
  • antiX-17 release info here
New users
  • Please read this first, and don't forget to add system and hardware information to posts!
  • Read Forum Rules

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
Forum Novice
Forum  Novice
Posts: 59
Joined: Sat Nov 05, 2016 8:14 am

easy tray menu - consider adding it to MX-16

#1 Postby user755 » Sun Nov 06, 2016 8:08 pm

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


You do not have the required permissions to view the files attached to this post.
Last edited by user755 on Tue Nov 15, 2016 7:25 am, edited 23 times in total.

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

Re: super easy tray menu with yad

#2 Postby richb » Sun Nov 06, 2016 8:11 pm

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

Rich
SSD Production: MX-15- 64 - migrated to MX-16 RC1
HD Test: MX-16 RC1
AMD A8 7600 FM2+ CPU R7 Graphics, fglrx driver, 16 GIG Mem. Samsung EVO SSD 250 GB, 350 GB HD

user755
Forum Novice
Forum  Novice
Posts: 59
Joined: Sat Nov 05, 2016 8:14 am

Re: super easy tray menu with yad

#3 Postby user755 » Mon Nov 07, 2016 9:50 am

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
Forum Veteran
Forum Veteran
Posts: 5537
Joined: Sat Jul 15, 2006 10:40 am

Re: super easy tray menu with yad

#4 Postby anticapitalista » Mon Nov 07, 2016 9:53 am

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-17 "Heather Heyer" - lean and mean.
https://antixlinux.com

user755
Forum Novice
Forum  Novice
Posts: 59
Joined: Sat Nov 05, 2016 8:14 am

convenient tray menu

#5 Postby user755 » Mon Nov 07, 2016 3:40 pm

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
Forum Novice
Forum  Novice
Posts: 59
Joined: Sat Nov 05, 2016 8:14 am

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

#6 Postby user755 » Mon Nov 07, 2016 3:50 pm

:cat:

User avatar
Jerry3904
Forum Veteran
Forum Veteran
Posts: 21413
Joined: Wed Jul 19, 2006 6:13 am

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

#7 Postby Jerry3904 » Mon Nov 07, 2016 4:00 pm

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: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, Kingston SSD 120 GB and WesternDigital 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB

user755
Forum Novice
Forum  Novice
Posts: 59
Joined: Sat Nov 05, 2016 8:14 am

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

#8 Postby user755 » Mon Nov 07, 2016 4:58 pm

OK

User avatar
Jerry3904
Forum Veteran
Forum Veteran
Posts: 21413
Joined: Wed Jul 19, 2006 6:13 am

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

#9 Postby Jerry3904 » Mon Nov 07, 2016 5:01 pm

Okey Dokey
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, Kingston SSD 120 GB and WesternDigital 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB

user755
Forum Novice
Forum  Novice
Posts: 59
Joined: Sat Nov 05, 2016 8:14 am

easy tray menu - tests fine in pristine MX-16

#10 Postby user755 » Mon Nov 07, 2016 5:56 pm

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:


Return to “Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest