From eecb112ad32dffafcb140511be9afb73e69469d5 Mon Sep 17 00:00:00 2001 From: cho Date: Thu, 4 May 2023 22:14:03 +0700 Subject: [PATCH] add emacs daemon shortcut, use swaymsg instead of wlopm --- home/default/.local/bin/sysact | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/home/default/.local/bin/sysact b/home/default/.local/bin/sysact index a950c4d..cb30da9 100755 --- a/home/default/.local/bin/sysact +++ b/home/default/.local/bin/sysact @@ -7,10 +7,10 @@ case "$(readlink -f /sbin/init)" in *) ctl='loginctl' ;; esac -case "$(printf "🔒 lock\n🚪 leave $WM\n♻️ renew\n🐻 hibernate\n🔃 reboot\n🖥️ shutdown\n💤 sleep\n📺 display off\n set background\n start idle\n kill swayidle\n fcitx5\n kill fcitx5" | dmenu -i -l 12 -p 'Action: ')" in +case "$(printf "🔒 lock\n🚪 leave $WM\n♻️ renew\n🐻 hibernate\n🔃 reboot\n🖥️ shutdown\n💤 sleep\n📺 display off\n set background\n start idle\n kill swayidle\n fcitx5\n kill fcitx5\n start emacs daemon\n kill emacs daemon" | dmenu -i -l 15 -p 'Action: ')" in '🔒 lock') setsid -f swaylock - setsid -f sleep 2 && swayidle -w timeout 1 'wlopm --off "*"' resume 'wlopm --on "*" && kill $#' + setsid -f sleep 2 && swayidle -w timeout 1 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on" && kill $#' ;; "🚪 leave $WM") swaymsg exit ;; "♻️ renew") swaymsg reload ;; @@ -24,5 +24,7 @@ case "$(printf "🔒 lock\n🚪 leave $WM\n♻️ renew\n🐻 hibernate\n🔃 re ' kill swayidle') killall swayidle ;; ' fcitx5') fcitx5 ;; ' kill fcitx5') killall fcitx5 ;; + ' start emacs daemon') emacs --daemon && notify-send 'emacs daemon started' ;; + ' kill emacs daemon') killall emacs && notify-send 'emacs daemon killed' ;; *) exit 1 ;; esac