You are not logged in.
We're dropping bl-exit as the default exit program as it is no longer maintained. I'm sure we'll still keep it in our repo, and if anyone knows Python and wants to play with it, please let us know!
Anyway, what are you using for your exit command?
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
I'm using a yad script I found online and edited slightly, save it as yad-exit.sh, make it executable, place it in your $PATH (~/bin works just fine) and replace bl-exit in your Openbox configs with yad-exit.sh
#! /bin/bash
action=$(yad --width 300 --entry --title "System Logout" --window-icon=gnome-logout \
--image=gnome-logout \
--button="Switch User:2" \
--button="gtk-ok:0" --button="gtk-close:1" \
--text "Choose action:" \
--entry-text \
"Logout" "Suspend" "Reboot" "Power Off")
ret=$?
[[ $ret -eq 1 ]] && exit 0
if [[ $ret -eq 2 ]]; then
gdmflexiserver --startnew &
exit 0
fi
case $action in
Logout*)
case $(wmctrl -m | grep Name) in
*Openbox) cmd="openbox --exit" ;;
*FVWM) cmd="FvwmCommand Quit" ;;
*Metacity) cmd="gnome-save-session --kill" ;;
*) exit 1 ;;
esac
;;
Suspend*) cmd="systemctl suspend" ;;
Reboot*) cmd="systemctl reboot" ;;
Power*) cmd="systemctl poweroff" ;;
*) exit 1 ;;
esac
eval exec $cmd
Keyboard shortcuts are down-arrow to scroll the logout options, then Enter.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
We're dropping bl-exit as the default exit program as it is no longer maintained.
HMMM and what maintaining does it need? Is it not feature complete already?
I've seen no bugs reported apart from myself picking on what depends are set.
I'm not about to try picking it up.. utterly clueless with python.
When I substitute anything for it, I either dig up cb-exit (which looks simple enough to maintain should Bunsen devs wish to) & use that, or hack up something using
sudo /usr/sbin/poweroff
sudo /usr/sbin/reboot
sudo /usr/sbin/shutdown --arguments
echo mem | sudo tee /sys/power/state # suspend
echo disk | sudo tee /sys/power/state # hibernate
along with configuring sudo for nopassword with those.. all old-school like, & something rather similar to how you handle logout.
Or simply fire those off in a terminal.
Since my installs are split between systemd & "other pid1" I avoid systemctl calls like the black plague, yeah I know I could write wrappers for some other command, even so.
Unlike systemctl the dbus org.freedesktop.login1.stuff currently used doesn't depend on commands not present with a sysvinit+openrc install.
FWIW lxsession-logout works for openbox too, though that one I have to unpack & hack the depends for non-systemd systems, it too is perfectly happy with elogind.
Last edited by Bearded_Blunder (2019-02-22 20:33:01)
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
A lil submenu in .config/openbox/menu.xml and there is nothing to mantain from there on
<menu id="root-menu-315416" label="exit">
<item label="lock">
<action name="Execute">
<execute>i3lock -c 191C1E</execute>
</action>
</item>
<item label="obExit">
<action name="Exit"/>
</item>
<separator/>
<item label="powerOff">
<action name="Execute">
<execute>systemctl poweroff</execute>
</action>
</item>
<item label="reBoot">
<action name="Execute">
<execute>systemctl reboot</execute>
</action>
</item>
</menu>
Which also makes it a simple/readable template for non-systemd users.
Last edited by brontosaurusrex (2019-02-22 17:25:22)
Online
^ i go with the submenu myself.
openbox also offers a <confirm> option for the menu.
why not go back to the old cb-exit? i know it needs changing ~3 lines, but maintaining it should be is trivial.
Offline
There is still ongoing discussion about the exit dialog though.
And the cb-exit gtk buttonbox layout has always been available, by choosing the "classic" theme in bl-exitrc
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
W0W! Dropping something that works.
May I be so bold as to ask: Why?
I am currently using the python script: ~/bin/s11-exit - probably has a whole bunch of stuff not needed but ....
#!/usr/bin/python2
# Script modified from cb_exit
# An early BunsenLabs script (bl_exit) edited for use by Sector11
# -*- coding: utf-8 -*-
import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass
dbus_send = "dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.{} boolean:true"
class s11_exit:
def disable_buttons(self):
self.cancel.set_sensitive(False)
# self.suspend.set_sensitive(False)
self.logout.set_sensitive(False)
self.reboot.set_sensitive(False)
self.shutdown.set_sensitive(False)
def cancel_action(self,btn):
self.disable_buttons()
gtk.main_quit()
# def suspend_action(self,btn):
# self.disable_buttons()
# self.status.set_label("Suspending, please standby...")
# os.system("bl-lock")
# os.system(dbus_send.format("Suspend"))
# gtk.main_quit()
def logout_action(self,btn):
self.disable_buttons()
self.status.set_label("Exiting Openbox, please standby...")
os.system("openbox --exit")
def reboot_action(self,btn):
self.disable_buttons()
self.status.set_label("Rebooting, please standby...")
os.system(dbus_send.format("Reboot"))
def shutdown_action(self,btn):
self.disable_buttons()
self.status.set_label("Shutting down, please standby...")
os.system(dbus_send.format("PowerOff"))
def create_window(self):
self.window = gtk.Window()
title = "Mission over " + getpass.getuser() + ", your debrief options are:"
self.window.set_title(title)
self.window.set_border_width(5)
self.window.set_size_request(500, 80)
self.window.set_resizable(False)
self.window.set_keep_above(True)
self.window.stick
self.window.set_position(1)
self.window.connect("delete_event", gtk.main_quit)
windowicon = self.window.render_icon(gtk.STOCK_QUIT, gtk.ICON_SIZE_MENU)
self.window.set_icon(windowicon)
#Create HBox for buttons
self.button_box = gtk.HBox()
self.button_box.show()
#Cancel button
self.cancel = gtk.Button(stock = gtk.STOCK_CANCEL)
self.cancel.set_border_width(4)
self.cancel.connect("clicked", self.cancel_action)
self.button_box.pack_start(self.cancel)
self.cancel.show()
#Cancel key (Escape)
accelgroup = gtk.AccelGroup()
self.key, self.mod = gtk.accelerator_parse('Escape')
accelgroup.connect_group(self.key, self.mod, gtk.ACCEL_VISIBLE, gtk.main_quit)
self.window.add_accel_group(accelgroup)
#Suspend button
# self.suspend = gtk.Button("_Suspend")
# self.suspend.set_border_width(4)
# self.suspend.connect("clicked", self.suspend_action)
# self.button_box.pack_start(self.suspend)
# self.suspend.show()
#Logout button
self.logout = gtk.Button("_Punch Out")
self.logout.set_border_width(4)
self.logout.connect("clicked", self.logout_action)
self.button_box.pack_start(self.logout)
self.logout.show()
#Reboot button
self.reboot = gtk.Button("_Restart Engines")
self.reboot.set_border_width(4)
self.reboot.connect("clicked", self.reboot_action)
self.button_box.pack_start(self.reboot)
self.reboot.show()
#Shutdown button
self.shutdown = gtk.Button("_Cut Engines")
self.shutdown.set_border_width(4)
self.shutdown.connect("clicked", self.shutdown_action)
self.button_box.pack_start(self.shutdown)
self.shutdown.show()
#Create HBox for status label
self.label_box = gtk.HBox()
self.label_box.show()
self.status = gtk.Label()
self.status.show()
self.label_box.pack_start(self.status)
#Create VBox and pack the above HBox's
self.vbox = gtk.VBox()
self.vbox.pack_start(self.button_box)
self.vbox.pack_start(self.label_box)
self.vbox.show()
self.window.add(self.vbox)
self.window.show()
def __init__(self):
self.create_window()
def main():
gtk.main()
if __name__ == "__main__":
go = s11_exit()
main()
I also have ~/bin/bl-exityad by damo:
#!/bin/bash
##
## Logout/Exit dialog, using 'yad`
## Written for BunsenLabs Linux by damo <damo@bunsenlabs.org> October 2015
##
## TODO? Confirm action
##
## Bug?: Accelerator keys may not display, depending on the gtk theme
##
########################################################################
USAGE="\n\tbl-exityad [OPTION]\n\n\
\tWith no arg then run gui logout dialog\n\n\
\t-h|--help\tThis USAGE help\n\
\t--logout\tOpenbox logout\n\
\t--suspend\tSystem suspend\n\
\t--reboot\tSystem restart\n\
\t--poweroff\tShutdown system\n"
function db-send(){
ACTION="$1"
dbus_send="dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.$ACTION boolean:true"
eval exec $dbus_send
}
if [[ -z $@ ]];then
DIALOG=$(yad --undecorated --center --on-top\
--window-icon="gtk-quit"\
--text="Logout $USER?\tChoose an option..."\
--text-align=center\
--button="gtk-cancel:1" \
--button="_Logout":2 \
--button="_Suspend":3 \
--button="_Reboot":4\
--button="_Power Off":5 \
)
RETURN=$?
else
case $1 in
-h|--help) echo -e "$USAGE"
exit 0;;
--logout) openbox --exit;;
--suspend) db-send "Suspend";;
--reboot) db-send "Reboot" ;;
--poweroff) db-send "PowerOff";;
*) echo -e "\nUse a valid command arg..."
echo -e "$USAGE"
exit 1;;
esac
fi
case $RETURN in
1) exit 0;;
2) openbox --exit;;
3) db-send "Suspend";;
4) db-send "Reboot" ;;
5) db-send "PowerOff";;
*) exit 1;;
esac
And I have done exactly what Bronto currently does as well.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
It's not really a poll or anything, but what @Sector11 has offered (either one) has the advantage of not breaking for us sysvinit holdouts for whom `which systemctl` returns nothing instead of "/bin/systemctl"
bl-exityad by damo looks trivial to maintain too.
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
I worded the OP incorrectly, this is ongoing discussion and not an official announcement. bl-exit as it is may well stay as the default exit script, I just wanted to open the issue here with you testers.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
Heck, personally I'm not that fussed long as whatever it is works ideally in an init-agnostic fashion, shove comes to push I point the exit menu item at x-terminal-emulator & type some universally working command that doesn't depend on any of systemd dbus policykit xorg openbox.. & works equally well in runlevel 3 at a tty long list of what typing a command doesn't need :monkey:
Just the same, I actually like the existing exit script, it's really distinctive compared to anything else I've seen & is rather pretty when coloured up to suit the theme, just saying. One thing if it was broken & needed fixing, then "maintained" or "someone to adopt maintaining" matters, far as I can see the most that's needed is working up a new theme or two though, am I wrong? Does it need more?
If I have any gripe at all its that without bunsen-exit installed there's this menu item pointing at nothing, you don't even get the default openbox behavior. That's less of an issue with Lithium, since bunsen-exit installs with elogind present, used to bug me with Helium since I often had installs where it never was owing to unmet deps. Dead menu items are something you expect if you actively uninstall something, they're less desirable if you just end up with them.
Last edited by Bearded_Blunder (2019-02-23 01:25:59)
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
cb-exit with minor changes should work and I like the idea of Bronto's as well.
Real Men Use Linux
Offline
How about a pipemenu which detects then uses bl-exit or cb-exit if it's there or lists some items pointed at primitive or not so primitive commands if not? Heck could even have the bug-ugly thing from LXDE as an option done that way ]:D Best of both, can have bl-exit as default & nothing breaks if someone removes it or switches. Just floating an idea. Guess that mighn't work with the tint2 icon..
Whatever, it's not like the whole Bunsen "pseudo DE" depends on an exit script the way LXDE hard depends on the lxsession-logout dialogue. There are at least options.
Bronto's menu s/systemctl/pkexec/g + polkit rule returning result.active YES
or <execute>dbus-send --great--long line</execute>
The dbus calls also give greater flexibility of control, much as I detest configuring polkit, if you use dbus you can set it so reboot returns yes, & reboot multiple sessions (someone else logged in) returns auth admin & thus prevent casually costing user 2 unsaved work, or your kids costing you unsaved work. Incidentally not the current default behavior, but maybe should be.
I *think* all the official Debian DEs are using dbus calls, because in my testing none of them break for shutdown, reboot, logout, etc. with no /bin/systemctl present (OK I've not tested GNOME, though I suspect they do too, GNOME won't start though).
I will miss that pretty row of icons if it goes though.
Last edited by Bearded_Blunder (2019-02-23 05:31:42)
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
I will miss that pretty row of icons if it goes though.
Like I said, it won't "go". We'll still offer it somehow, but we're looking into replacing it with something faster/better.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
but we're looking into replacing it with something faster/better.
My wife has you all beat! Pull the plug!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Well, I'll grant it's slow and processor intensive for what's after all just a row of buttons you see for a few seconds & pick one of.
How much would that be mitigated by simply defaulting it to "classic"? Making the eye-candy a config option rather than a package swap, could even default that to per-user bl-exitrc files so any individual on a given machine could activate or deactivate the eye-candy according to personal taste without having to dig up and copy the file first.
Compared to say reworking cb-exit (which was fast & light) to use the dbus-send type commands?
I'm kinda loath to encourage menus that use "typically typed in a tty" commands as I'm pretty sure in that case you'll lose that fine level of control I referred to in my last post, the ability to distinguish if you're attempting to power off or reboot multiple sessions or just one. Neither `sudo /sbin/reboot` nor` systemctl reboot` care, they'll reboot two users without an obvious way to make them warn you or require auth if that's what you're doing.
Not that tweaking policykit for that is obvious either, but a script that uses dbus could be shipped with policykit rules set that way by default. That actually would constitute "better" than the existing script.
It really isn't difficult to imagine user2 logging in from the lock screen when user1 has been called away, a shutdown or reboot in that situation can lose user1 some data.
LOL if I recall I was opposed to using dbus when the switch was first made, mind you I hadn't twigged that material advantage then, only recently realized the potential when I was fighting making bl-exit work without systemd, nor did anyone advance that potential control as an argument when it was first adopted, or not to me anyway.
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
Hello GentleChaps. IN ArchLabs we use a Rofi script to exit, reboot etc.
This is the script I use:
#!/bin/bash
OPTIONS="\tLogout\n⏻\tShutdown\n\tReboot"
option=`echo -e $OPTIONS | awk '{print $1}' | tr -d '\r\n\t'`
if [ "$@" ]
then
case $@ in
*Logout)
i3-msg exit
;;
*Shutdown)
shutdown now
;;
*Reboot)
reboot
;;
esac
else
echo -e $OPTIONS
fi
I place it in /usr/bin/
Call it with a keybind or a menu entry in obmenu. I'm now 100% i3wm so I don't have Openbox on my system anymore but I call it in i3 with:
bindsym $Mod+x exec rofi -show Power -modi Power:/usr/bin/powermenu
P.S. I think it goes without saying, this won't work without Rofi. Though you could use dmenu:
#!/usr/bin/env bash
# Script to logout, shutdown, reboot, and lock screen if set
LOGOUT="Logout"
REBOOT="Reboot"
SHUTDOWN="Shutdown"
LOCK=""
LOCK_COMMAND=""
if [[ $LOCK && $LOCK_COMMAND ]] && hash $(awk 'print $1' <<< "$LOCK_COMMAND") >/dev/null 2>&1; then
CHOICE="$(printf "%s\n%s\n%s\n%s" "$LOCK" "$LOGOUT" "$REBOOT" "$SHUTDOWN" | dmenu "$@")"
else
CHOICE="$(printf "%s\n%s\n%s" "$LOGOUT" "$REBOOT" "$SHUTDOWN" | dmenu "$@")"
fi
case "$CHOICE" in
"$LOGOUT") pkill -15 -t tty"$XDG_VTNR" Xorg ;;
"$REBOOT") reboot ;;
"$SHUTDOWN") poweroff ;;
"$LOCK") $LOCK_COMMAND ;;
*) exit 0
esac
Last edited by Döbbie03 (2019-02-24 03:29:05)
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Offline
^ You need a certain font installed to make that display correctly, n'est-ce pas?
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
I just use San Francisco Display for my Rofi.
"All we are is dust in the wind, dude"
- Theodore "Ted" Logan
"Led Zeppelin didn't write tunes that everybody liked, they left that to the Bee Gees."
- Wayne Campbell
Offline
I just use San Francisco Display for my Rofi.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
Or to rework @brontosaurusrex suggestion
<menu id="root-menu-315416" label="exit">
<item label="Logout">
<action name="Execute">
<execute>bl-exit --logout</execute>
</action>
</item>
<item label="Sleep">
<action name="Execute"/>
<execute>bl-exit --suspend</execute>
</item>
....etc.
The tint2 button still triggers the UI, the script operates in the fastest possible mode, no drawing windows, and there's pre-labelled placeholders to put your own choice of replacement command should you remove it, rather than that stuff being hidden up a pipemenu.
Easy to provide multiple packages that provide bunsen-exit & replace the other one.. they just have to accept the same arguments and install a script with the same name. Just so long as they conflict so you only have one installed ;-)
e.g. packages:
bunsen-exit-python
bunsen-exit-yad
bunsen-exit-bash
bunsen-exit itself becomes a virtual package that depends on any one of the others. Which you'd like could even be a bl-welcome question.
Heck, get all fancy if you want, play at bunsen-alternatives and make bl-exit a symlink pointing to whichever script you'd like active.
Other than clearly at least one of the devs seriously dislikes the current script, I honestly can't see much real need to change it...
Last edited by Bearded_Blunder (2019-02-24 04:55:49)
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline