From 6303b471e486a4f6cffee8a4fb235bf7dedf5e5d Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 27 May 2021 17:27:11 +0200 Subject: [PATCH] Add doom sync action to popup-window script --- scripts/.local/share/scripts/popup-window | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/.local/share/scripts/popup-window b/scripts/.local/share/scripts/popup-window index d17d1a5..75ffb4e 100755 --- a/scripts/.local/share/scripts/popup-window +++ b/scripts/.local/share/scripts/popup-window @@ -5,6 +5,7 @@ select_action() { "System resources usage" "Connectivity test" "Kill emacs" + "Sync doom emacs" ) action=$(printf '%s\n' "${action_content[@]}" | rofi -no-auto-select -i "$@" -dmenu -p "Choose an action") execute_action "$action" @@ -14,11 +15,16 @@ launch_kitty() { bash -c "kitty --class popup -- $1" } +execute_command() { + bash -c "$1" +} + execute_action() { case "$1" in "System resources usage") launch_kitty "htop" ;; "Connectivity test") launch_kitty "ping -c 2 freebsd.org" ;; - "Kill emacs") launch_kitty "pkill emacs" ;; + "Kill emacs") execute_command "pkill emacs" ;; + "Sync doom emacs") execute_command "$HOME/.emacs.d/bin/doom sync > /tmp/script-test" ;; esac }