Elive-exit
1. Reason -- Elive's interactive (yad-based?) exit menu seems to have timing glitches, namely where when you select say "reboot", the scripts will continue to run without waiting for your sudo authorization input. At least for me, this has led to stalled activity, AND if I click the physical power button on the laptop, it will go ahead and LOG OUT and return you to the lightdm greeter, which has a shutdown icon that does nothing. ![]()
2. Not able to find and fix the yad (?) or script code, I cobbled together a somewhat simple (?) solution. It requires installing jgmenu and editing a few files to configure it, and a shell script to drive it, PLUS a desktop file to be able to drag onto a deskbar such as Cairo-desktop or Plank Reloaded.
3. So first, install jgmenu:
sudo apt install jgmenu
4. Then, you'll need to create a jgmenu folder in your ~/.config folder. In this new folder, create two files:
jgmenurc (always required)
exit-menu.csv
5. Here is a suggested set of parameters to enter into the jgmenurc file:
csv_cmd = apps
tint2_look = 1
menu_width = 120
menu_height_min = 150
menu_height_max = 610
menu_padding_top = 4
menu_padding_right = 2
menu_padding_bottom = 1
menu_padding_left = 1
menu_halign = center
menu_valign = center
menu_border = 1
item_height = 27
item_radius = 2
item_border = 1
color_menu_bg = #000000 90
color_menu_border = #eeeeee 20
color_scroll_ind = #ee0000 50
csv_name_format = %n\n<span size="x-small">%g</span>
csv_no_dirs = 1
positon_mode = pointer
stay_alive = 0
icon_theme=Adwaita
# These also work -- Waterleaf HighContrast gnome Waterleaf oxygen
csv_no_duplicates =1
6. And here are the suggested contents for the exit-menu.csv file:
<b>Exit Elive?</b>
^sep()
Hibernate, elive-pm hibernate, /usr/share/icons/BeautyLine/apps/scalable/system-hibernate.svg
Suspend, elive-pm suspend, /usr/share/icons/BeautyLine/apps/scalable/system-suspend.svg
Lock screen, elive-pm lock, /usr/share/icons/BeautyLine/apps/scalable/system-lock-screen.svg
Logout, elive-pm logout, /usr/share/icons/BeautyLine/apps/scalable/system-log-out.svg
Reboot, elive-pm reboot, /usr/share/icons/BeautyLine/apps/scalable/system-reboot.svg
Shutdown, elive-pm shutdown, /usr/share/icons/BeautyLine/apps/scalable/system-shutdown.svg
7. In your $HOME directory, create a new file, elive-exit. It will be your shell script to launch the menu, and its contents should look like this:
#!/bin/sh
#
# elive-exit
#
#
jgmenu --simple --at-pointer --csv-file=$HOME/.config/jgmenu/exit-menu.csv
8. Save the file, then in the file's properties window, click the Permissions tab and check the Allow this file to run as a program option and close the properties window.
9. Easy change to desktop Elive menu is to edit it in your $HOME/.e16/menus.file.menu file. All you need to do is to change the last line to look like:
"Log Out" NULL exec "$HOME/elive-exit"
(You can also do as I did, as you will see, and replace the NULL placeholder above with a full path to a good "logout" icon from the same [gnome] family used elsewhere in the menu file.)
UNFORTUNATELY, apparently this will be short-lived (until I figure out how to defeat [?] it), as it seems the menu is generated automatically at your next login. Boo!
9. IF you want to create a desktop entry to add to cairo-dock or plank (Plank Reloaded is a much lighter alternative to cairo-dock, but without many extras and frills that cairo-dock offers), you might want to create a desktop icon file in your $HOME/.local/share/applications directory. At least for cairo-dock, you can just drag the file and drop it on cairo-dock. Plank requires a bit of config file work, still quite doable. Here's what an elive-exit.desktop file's contents should look like:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Exit Elive
GenericName=Exit Elive
Comment=Displays menu for exiting Elive
Exec=$HOME/elive-exit
Terminal=false
Icon=system-log-out
Categories=System;Administration
StartupNotify=false
Path=$HOME
Again, you can either just drag this onto cairo-dock, or use cairo-dock's configuration windows to add the relevant parts from above. I THINK you also can drag the above elive-exit.desktop file onto plank.
10. When all is said and done, you will have a nice pop-up menu that will wait for you to enter your password before continuing (as opposed to the normal GUI exit setup), and whatever option you choose will be properly handled by Elive to gracefully shut down, logout, etc.
Here's what the menu looks like in action:



