diff --git a/scripts/.local/share/scripts/popup-window b/scripts/.local/share/scripts/popup-window new file mode 100755 index 0000000..d17d1a5 --- /dev/null +++ b/scripts/.local/share/scripts/popup-window @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +select_action() { + action_content=( + "System resources usage" + "Connectivity test" + "Kill emacs" + ) + action=$(printf '%s\n' "${action_content[@]}" | rofi -no-auto-select -i "$@" -dmenu -p "Choose an action") + execute_action "$action" +} + +launch_kitty() { + bash -c "kitty --class popup -- $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" ;; + esac +} + +select_action "$@" diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 11d969d..e28b446 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -247,7 +247,7 @@ exec_always { # Enable floating windows for_window [app_id="mpv"] floating enable for_window [app_id="imv"] floating enable -for_window [app_id="htop"] floating enable, resize set 1280 720 +for_window [app_id="popup"] floating enable, resize set 1280 720 # Resize zathura to 70% in tiling mode for_window [app_id="org.pwmt.zathura" workspace=$workspace4] resize set width 70 ppt # Split windows vertically @@ -281,8 +281,8 @@ bindsym Print exec grim bindsym Shift+Print exec slurp | grim -g - - | wl-copy # find PDFs with rofi bindsym $mod+f exec ~/.local/share/scripts/finder -# temporary floating htop -bindsym $mod+Shift+h exec kitty --class htop -- htop +# temporary popup window selection +bindsym $mod+p exec ~/.local/share/scripts/popup-window # power menu bindsym $mod+Shift+p mode "$Pause-break"