File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ is_gnome() {
13
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
14
}
15
15
16
- if is_gnome; then
16
+ is_cosmic () {
17
+ command -v cosmic-osd > /dev/null && [ " $XDG_SESSION_DESKTOP " = " COSMIC" ]
18
+ }
19
+
20
+ if is_cosmic; then
21
+ cosmic-osd log-out
22
+ elif is_gnome; then
17
23
gnome-session-quit --logout
18
24
elif command -v loginctl > /dev/null; then
19
25
loginctl terminate-user " ${USER} "
Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ is_gnome() {
13
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
14
}
15
15
16
- if is_gnome; then
16
+ is_cosmic () {
17
+ command -v cosmic-osd > /dev/null && [ " $XDG_SESSION_DESKTOP " = " COSMIC" ]
18
+ }
19
+
20
+ if is_cosmic; then
21
+ cosmic-osd restart
22
+ elif is_gnome; then
17
23
gnome-session-quit --reboot
18
24
elif command -v systemctl > /dev/null; then
19
25
systemctl reboot
Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ is_gnome() {
13
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
14
}
15
15
16
- if is_gnome; then
16
+ is_cosmic () {
17
+ command -v cosmic-osd > /dev/null && [ " $XDG_SESSION_DESKTOP " = " COSMIC" ]
18
+ }
19
+
20
+ if is_cosmic; then
21
+ cosmic-osd shutdown
22
+ elif is_gnome; then
17
23
gnome-session-quit --power-off
18
24
elif command -v systemctl > /dev/null; then
19
25
systemctl poweroff
You can’t perform that action at this time.
0 commit comments