New "elive-exit" GUI menu setup on OpenRC

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. :unamused_face:

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:

Suspecting this is on a Trixie on on openRc upgraded system, this bug has been noted.
Actually 'reboot' shouldn't require authorization and is an issue with how the various commands are handled in the base Trixie system.
The 'reboot/shutdown' does seem to work when using'elive-pm' directly from the commandline.

Yes, through 'usr/share/e16/scripts/e_gen_menu'

Hi @triantares -- this is not (yet?) on Trixie --

~ >>> inxi -F
System:
Host: elive1 Kernel: 6.1.0-47-amd64 arch: x86_64 bits: 64
Desktop: Enlightenment v: "1.0.31" Distro: Elive GNU/Linux 12 (bookworm)

...but yes, using OpenRC. That's one of the reasons I wanted to try out Elive -- I don't care for systemd, and seek out distros without it. I run two MX Linux distros, Peppermint OS (a Devuan distro), Salix, and a few others. I do have one or two distros that run with systemd, most notably an older Q4OS system that is actually quite nice. I typically use Openbox (or JWM or even IceWM) on these, as I'm usually not a fan of DEs. I did try Bodhi, and I believe its DE is an early fork of Enlightenment, but I never did get into the groove of its ecosystem. I tried AntiX, love its lightness (even though MX can be just as light), but the developers don't really want you to have a WM-only based environment (gotta have either zzz-FM or PCmanFM running in "desktop" mode). Not a huge fan of either file manager, so ditched that one.

So far, Elive with E16 and OpenRC is a very nice, somewhat stable (I do see glitches), very cool, very usable, eye-candy, relatively easy to get into, distro. That's why I've been spending so much time in the forum, trying to glean info and get answers, and modding. Kinda sad that there don't seem to be more active and responsive users other than you and the "other Mr. T". (Maybe the flagging bots have something to do with that? Who wants to say anything, only to get flagged as "offensive" or "inappropriate"?)

Thanks for taking the time to read and reply. Much appreciated!

Yeah, I saw the same behavior using OpenRC.
The bug was marked as 'solved' but I still get pushed into lightdm if I opt for 'reboot'. :sad_but_relieved_face:

Okay, as @triantares notes, the Elive desktop menu gets regenerated at startup. Wouldn't want to override the nice menu generating script that @Thanatermesis nicely put together, but since the output is in user space, I can override it with a one-liner in $HOME/.e16/startup-applications.list . Here's my current one line:

sed -i '$ c"Log Out" "/usr/share/icons/gnome/48x48/actions/gnome-logout.png" exec "$HOME/elive-exit"' $HOME/.e16/menus/file.menu

Problem solved. Now the desktop menu file has a menu entry for the elive-exit script above and a nice gnome logout icon to boot (so to speak!).

I say "problem solved" but do wonder if the menu generator script also is run at times other than startup! Even so, just having the new stuff edited in at startup will fix it next time, for a while.

Onward to find out where to override the "Settings" menu logout stuff. :winking_face_with_tongue:

Okay, the "settings" menu that shows up when you right click on the desktop is a bit more problematic. It doesn't exist in user space, it's only in /usr/share/e16/menus as "settings.menu".

The last two action items in this menu (logout and shutdown) are problems in that they both open up the possibility of doing the whole logout-before-authorization thing as mentioned in the opening of this topic.

My solution is to make a copy in $HOME/.e16/menus and replace the last two lines (the "Restart" item won't cause any problems) with one:

"Exit Elive" NULL exec "$HOME/elive-exit"

Hopefully, this will shut off (ha ha) the chances of you getting the yad menu dialog that misbehaves and just puts you back in the Elive login screen when you wanted to reboot or shut down the machine. The exit-elive script is modal and waits for sudo authorization before the elive-pm xxx command gets to run.

Frankly, I've always rebooted my OpenRC machine from the commandline (I use 'guake' for that) and ..... I'm on E27 which doesn't allow scripting actions as easily as in E16.
Anyway, Elive uses 'elive-pm' for most of it's system actions and it's just a matter of that command calling the right action, in the right manner.

IMO the best way is to make sure those scripts are compatible with OpenRC, adding another wheel to the car is a sure recipe for inevitable chaos in the long run.

Another way to do that is to alter the theme itself. That was what we were actually discussing in the thread I mentioned.
There's a Howto on theming E16 explicitly:

Hey, thanks for giving me the link to the tutorial. I am very certain that I found that once (it ain't easy!) and when I clicked on it, neither version was available (can't remember the error right now). This time, it worked. Yay (not to be confused with the Arch package mgmt. helper)!!!

I wish there was a simple document that was available to help new forum users get into the editing controls. It should be intuitive, but it's not. There are nuances about selecting text to do various things, and other differences. They're different from most any other forum post editor I've used. Pretty sure I botched my very first post as a result. Yeah, I'm needy. :smiley:

Thanks! Danke! Gracias! (And so forth!)

I agree, even me myself have to be very specific on what I search for, to get a result.
'customization' is the magic word there, apparently. :grimacing:

It never is easy, considering we're talking about changing/altering stuff to one's own specific liking and ..... Enlightenment documentation (especially ol' E16) isn't easy to find.
The best I found, is here:

BTW,
Do look at the end of the tutorial about using 'eesh', it can be quite helpful at times.

That was an issue with my home-server (on which the images run) that has a dying disk, sorry ... I fixed that a short while ago. Just download the PDFs and keep them handy. :innocent:

Feel free to rummage around Index of /Elive and see what you find useful there.

And of course there's github:

and (my preference) gitlab:

Which is more Enlightenment (E27) oriented.

I'm looking into it but it does look like that the forum-bot has a dislike for you. :rofl2:

I do have a (not so updated) list of Elive-forum HowTos here:

THANKS!!! Bookmarked 'em all.

I was indeed planning to check out eesh. Saw it used various places but didn't grok it at that point.

Okay, maybe a "final" note here (bwa-ha-ha!). Anyone who's explored Cairo-dock might know about its built-in "Logout" applet. It's COOOL !!!! ... but...but... it has some usability issues. When it's enabled, here's what the exit menu looks like:

Nice ! -- no? Very nice, in fact. The Shut down, Restart, and Suspend actions work like a champ. Did not try the hibernation items but have no reason to believe they don't work. HOWEVER, the "Lock screen" menu item is a NOP. Does nothing. Nada. You'll also notice that there's no bona fide "Logout" menu option. Say WHAT???? Sure, you can open a terminal and enter "kill -9 -u $USER" and you're outta here, but then why would we need all these nice menus? For what it's worth, you can configure the logout applet to LOG OUT via a middle-mouse click, which (1) won't be obvious and (2) is awkward.

I have no idea if the reboot/shutdown/suspend/hibernate actions are integrated with Elive such that they invoke the proper, anointed, actions via elive-pm. I do know that the config file for it has a fallback invocation of the (ahem) dreaded problematic yad menu:

...this is the menu, where if you select the reboot or shut down menu items, it results in a chaotic logout process with an authorization (sudo) prompt that quickly goes away and you're thrown back into the Elive login screen. Not the kind of shutdown you wanted!

That being said, the Cairo-dock "Logout" applet is a really nice, really cool addition to your panel -- IF you don't mind that the lock screen doesn't work and the bona fide logout menu item and capability (the easy one!) is hidden or worse, unavailable.

Note:
I altered the thread header to make abundantly clear that this is Only an issue with non-systemd Elive systems.
New readers might get the wrong impression.

Also check this thread in which this issue has been addressed, among others.

To include your own apps into the "desktop menus autogenerated", simply make a .desktop file for it into your .local/share/applications/ directory with the wanted settings for it, it should show up always in your menus after that

Thanks, @Thanatermesis !! Yes, of course I knew that. But it only shows up in a submenu associated with one or more of its open desktop categories, which in this case was not where I wanted it to show up (i. e., at the very bottom as a stand-alone menu item.

I do wish there was more control of the Cairo dock "Logout" applet to be able to properly configure its menu. Then again, that wouldn't help if I switched over to using the leaner "Plank Reloaded" dock. I probably won't at this point, 'cause I like the ability of the Cairo dock's built-in Music Player's feature for controlling the volume with yer mouse (and so ya don't need the separate Volume applet on the dock).

I'm trying to rewrite and adjust my Tint2 panel that I use on all my other distros, but right now, it's a more static vertical panel rather than bottom dock-like. I think that can be a lot lighter.

Hey -- is there a window control setting somewhere that would allow the Cairo or Plank dock animations or mouse-over actions to show in front of open windows? Or is that a function of the dock/panel versus the window manager?

Thanks again for a lovely and engaging distro!

I think OpenRC is a waste of time. It seems to be a derivative to systemd.
go SysVinit-3.14

So it's good to have a proper choice, at the least ...... something bigger distros like RedHat, Suze or Ubuntu do not wish cater for. :dance:

Indeed! Been using SysVinit for a long time, thanks to the excellent MX Linux distro. One of the main reasons for me trying out Elive was the option to run without SystemD. That being said, I don't find OpenRC to be objectionable.

Good comparison guide: systemd-vs-sysvinit-vs-openrc