diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-04-18 15:54:23 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-04-18 15:54:23 -0700 |
commit | e1e9d152de883a2ceecb67f28e442f39ba425e63 (patch) | |
tree | 38e62c6a14320ce60abecd5b26a812dfd945ee3b /SystemdGraphicalSession/compmgrtoggle | |
parent | c9ac37893fd55b1b079f0d70420ac30673ead775 (diff) | |
download | gists-e1e9d152de883a2ceecb67f28e442f39ba425e63.tar gists-e1e9d152de883a2ceecb67f28e442f39ba425e63.tar.gz gists-e1e9d152de883a2ceecb67f28e442f39ba425e63.tar.bz2 gists-e1e9d152de883a2ceecb67f28e442f39ba425e63.zip |
Add Win + F12 to toggle compositor
Diffstat (limited to 'SystemdGraphicalSession/compmgrtoggle')
-rwxr-xr-x | SystemdGraphicalSession/compmgrtoggle | 21 |
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 |