File tree Expand file tree Collapse file tree 4 files changed +45
-7
lines changed Expand file tree Collapse file tree 4 files changed +45
-7
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/sh
2
2
#
3
3
# name: Log Out
4
4
# icon: system-log-out
5
5
# description: Log out to the login screen
6
6
# keywords: log out logout
7
7
8
- gnome-session-quit --logout
8
+ set -eu
9
+
10
+ is_gnome () {
11
+ command -v dbus-send > /dev/null && \
12
+ command -v gnome-session-quit > /dev/null && \
13
+ dbus-send --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Get string:org.gnome.Shell string:ShellVersion > /dev/null 2>&1
14
+ }
15
+
16
+ if is_gnome; then
17
+ gnome-session-quit --logout
18
+ elif command -v loginctl > /dev/null; then
19
+ loginctl terminate-user " ${USER} "
20
+ fi
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/sh
2
2
#
3
3
# name: Restart
4
4
# icon: system-restart
5
5
# description: Reboot the system
6
6
# keywords: power reboot restart
7
7
8
- gnome-session-quit --reboot
8
+ set -eu
9
+
10
+ is_gnome () {
11
+ command -v dbus-send > /dev/null && \
12
+ command -v gnome-session-quit > /dev/null && \
13
+ dbus-send --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Get string:org.gnome.Shell string:ShellVersion > /dev/null 2>&1
14
+ }
15
+
16
+ if is_gnome; then
17
+ gnome-session-quit --reboot
18
+ elif command -v systemctl > /dev/null; then
19
+ systemctl reboot
20
+ fi
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/sh
2
2
#
3
3
# name: Power off
4
4
# icon: system-shutdown
5
5
# description: Shut down the system
6
6
# keywords: power off shutdown poweroff
7
7
8
- gnome-session-quit --power-off
8
+ set -eu
9
+
10
+ is_gnome () {
11
+ command -v dbus-send > /dev/null && \
12
+ command -v gnome-session-quit > /dev/null && \
13
+ dbus-send --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Get string:org.gnome.Shell string:ShellVersion > /dev/null 2>&1
14
+ }
15
+
16
+ if is_gnome; then
17
+ gnome-session-quit --power-off
18
+ elif command -v systemctl > /dev/null; then
19
+ systemctl poweroff
20
+ fi
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/sh
2
2
#
3
3
# name: Suspend
4
4
# icon: system-suspend
5
5
# description: Suspend the system
6
6
# keywords: suspend sleep
7
7
8
+ set -eu
9
+
8
10
systemctl suspend
You can’t perform that action at this time.
0 commit comments