Direct shutdown, reboot suspend launchers for guest

Post tutorials, HOWTO's and other useful resources here.
tome
Contributor
Contributor
Posts: 675
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Russia is causing the immense damage to humanity
Contact:

Direct shutdown, reboot suspend launchers for guest

Post#1 by tome » 18 Nov 2013, 10:23

Create new choose -name.desktop file on your desktop or in /home/guest/.local/share/applications and paste:

For shutdown:

Code: Select all

Name=Shutdown
Name[pl]=Wyłącz komputer
Exec=/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
Icon=system-shutdown
Terminal=false
Type=Application
For reboot:

Code: Select all

Name=Reboot
Name[pl]=Uruchom ponownie
Exec=/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Icon=system-restart
Terminal=false
Type=Application
For suspend:

Code: Select all

Name=Suspend
Name[pl]=Uśpij system
Exec=/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
Icon=system-suspend
Terminal=false
Type=Application
For hibernate:

Code: Select all

Name=Hibernate
Name[pl]=Hibernacja
Exec=/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
Icon=system-hibernate
Terminal=false
Type=Application
Found it in Auto Shutdown NG extension for Firefox.

If you use changes=EXIT: cheatcode and want shutdown without saving changes do:
add

Code: Select all

chown guest:guest /mnt/live/tmp
line to '/etc/rc.d/rc.local',
create exit-no-changes.sh file in /home/guest/.local/share and paste

Code: Select all

#!/bin/bash
mv /mnt/live/tmp/changes-exit /mnt/live/tmp/changes-exit-no && /usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
than create shutdown-no-changes.desktop file and paste

Code: Select all

Name=Shutdown without saving changes
Name[pl]=Wyłącz komputer bez zapisywania zmian
Exec=/home/guest/.local/share/exit-no-changes.sh
Terminal=false
Type=Application
Tested for LXDE but should work also for XFCE and GNOME.
You can change Name, Icon and add Categories to these .dektop files.
You have mind and feelings. Be wise and clever.