aboutsummaryrefslogtreecommitdiff
path: root/SystemdGraphicalSession/compmgrtoggle
diff options
context:
space:
mode:
Diffstat (limited to 'SystemdGraphicalSession/compmgrtoggle')
-rwxr-xr-xSystemdGraphicalSession/compmgrtoggle21
1 files changed, 21 insertions, 0 deletions
diff --git a/SystemdGraphicalSession/compmgrtoggle b/SystemdGraphicalSession/compmgrtoggle
new file mode 100755
index 0000000..1d68a29
--- /dev/null
+++ b/SystemdGraphicalSession/compmgrtoggle
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+case "$1" in
+ start)
+ systemctl --user start compositor
+ exec notify-send --icon=dialog-information 'Compositor' 'Compositor is started'
+ ;;
+ stop)
+ systemctl --user stop compositor
+ exec notify-send --icon=dialog-information 'Compositor' 'Compositor is stopped'
+ ;;
+ *)
+ if systemctl --user status compositor > /dev/null; then
+ systemctl --user stop compositor
+ exec notify-send --icon=dialog-information 'Compositor' 'Compositor is stopped'
+ else
+ systemctl --user start compositor
+ exec notify-send --icon=dialog-information 'Compositor' 'Compositor is started'
+ fi
+ ;;
+esac