From e1e9d152de883a2ceecb67f28e442f39ba425e63 Mon Sep 17 00:00:00 2001 From: Trumeet Date: Mon, 18 Apr 2022 15:54:23 -0700 Subject: Add Win + F12 to toggle compositor --- SystemdGraphicalSession/compmgrtoggle | 21 +++++++++++++++++++++ SystemdGraphicalSession/xbindkeysrc | 4 ++++ 2 files changed, 25 insertions(+) create mode 100755 SystemdGraphicalSession/compmgrtoggle 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 diff --git a/SystemdGraphicalSession/xbindkeysrc b/SystemdGraphicalSession/xbindkeysrc index 2bed0fd..8acbcb3 100644 --- a/SystemdGraphicalSession/xbindkeysrc +++ b/SystemdGraphicalSession/xbindkeysrc @@ -82,5 +82,9 @@ "xterm -fullscreen ~/.local/pwrdialog" Control + Mod1 + Delete +# Compositor +"~/.local/compmgrtoggle" + Mod4 + F12 + # # End of xbindkeys configuration -- cgit v1.2.3