pop-launcher/scripts/session/session-reboot.sh

21 lines
512 B
Bash
Raw Normal View History

#!/usr/bin/sh
2021-08-10 01:04:20 +02:00
#
# name: Restart
# icon: system-restart
# description: Reboot the system
# keywords: power reboot restart
set -eu
is_gnome() {
command -v dbus-send >/dev/null && \
command -v gnome-session-quit >/dev/null && \
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
}
if is_gnome; then
gnome-session-quit --reboot
elif command -v systemctl >/dev/null; then
systemctl reboot
fi