Shutdown dialog labels in LXDE

I just started using Raspbian Jessie on the Pi 3 and was wondering if there's a way to customize the labels on the Shutdown dialog so that clicking the labels ("Shutdown", "Reboot" or "Exit to command line") themselves cause the bullet point to become selected? Currently, it's necessary to click the small dot itself to select the bullet point, but it would be nicer if clicking that or the label itself would have the same effect.

Thanks,

John

Reply to
John Smith
Loading thread data ...

Somebody wrote his/her own dialog and documentet it here:

formatting link

THere are open questions like: * Where is the source code * is this run as root * is it stable * What happens on updates * does it work on your machine

Maybe you could just take a look on your system at this location: /usr/bin/lxde-pi-shutdown-helper

Reply to
Stefan Enzinger

Thanks, Stefan. Not being familiar with the language used to implement this dialog, I tried surrounding the text with HTML Label tags, but the tags themselves appeared in the resultant label text, so it looks like it is not HTML-based... but it occurred to me that I could make the third option ("Exit to command line" - the one I use most often) the selected button by default by setting its value to TRUE, so it's not so much of any issue any more.

I also glanced at the article you linked, and at some point in future I might take a stab at doing something similar.

Meanwhile, if the developer of this dialog is reading, here are a few suggestions for improvements:

  1. Allow the bullet or the label alongside it to be clicked to select the option.
  2. Save the previously-selected option and make it the default the next time the dialog is invoked, since users will typically perform the same action every time (shutting-down, rebooting or exiting to the command line).
  3. As someone else pointed out, there's no need to have a minimize or maximize button on the End Session dialog, so disable or remove them.
Reply to
John Smith

It looks like the window manager is displaying the Minimize and Maximize buttons in all dialogs, regardless of any hints that are sent to it. I installed Gtk3 and wrote a simple replacement dialog that only requires a single click, and while the Maximize button is still present, it doesn't actually do anything if clicked.

Here's the source code if anyone cares to use it in place of the existing "/usr/bin/lxde-pi-shutdown-helper" file...

--- code starts here ---

#!/usr/bin/env python import gi, os gi.require_version('Gtk', '3.0') from gi.repository import Gtk

class GridWindow(Gtk.Window):

def __init__(self): Gtk.Window.__init__(self, title="End Session") self.set_position(Gtk.WindowPosition.CENTER) self.set_resizable(False) self.set_icon_from_file("/usr/share/icons/gnome/256x256/actions/ exit.png") self.connect("key-release-event", self.on_key_release) grid = Gtk.Grid() self.add(grid)

button1 = Gtk.Button(label="Shut Down") button2 = Gtk.Button(label="Restart") button3 = Gtk.Button(label="Exit to Console") button4 = Gtk.Button(label="Cancel")

grid.add(button1) grid.add(button2) grid.add(button3) grid.attach(button4, 0, 1, 3, 1)

button1.connect("clicked", self.on_shutdown_clicked) button2.connect("clicked", self.on_restart_clicked) button3.connect("clicked", self.on_console_clicked) button4.connect("clicked", self.on_cancel_clicked)

def on_key_release(self, widget, event, data=None): Gtk.main_quit()

def on_shutdown_clicked(self, button): os.system("sudo shutdown -h now") Gtk.main_quit()

def on_restart_clicked(self, button): os.system("sudo reboot") Gtk.main_quit()

def on_console_clicked(self, button): os.system("kill $_LXSESSION_PID") Gtk.main_quit()

def on_cancel_clicked(self, button): Gtk.main_quit()

win = GridWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()

Reply to
John Smith

After doing a distro update this morning, I see that the Shutdown dialog has been much improved - thanks to the Pi team for that! The raspberry icon in the corner is a nice touch, as well.

At the risk of being a persistent nag, the only other "nice-to-have's" I can think of would be maybe to add a Cancel button, and allow the dialog to be dismissed by pressing Escape on the keyboard.

Thanks again.

Reply to
John Smith

You might have better luck with getting enhancements implemented by posting to the Raspbian forum at

formatting link
rather than here.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

Oh, I'd say I've had pretty good luck here. ;-)

Reply to
John Smith

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.