25 lines
887 B
Bash
Executable file
25 lines
887 B
Bash
Executable file
#!/bin/env bash
|
|
|
|
WORKSPACE=$(hyprctl clients -j | jq -rec '.[] | select(.class == "quake") | .workspace .name')
|
|
TERM_CMD="kitty -1 --class quake -o background_opacity=0.90 -o hide_window_decorations=yes -o remember_window_size=no"
|
|
|
|
if [ "$WORKSPACE" = "" ]; then
|
|
echo "start"
|
|
hyprctl dispatch -- exec "[float;size 1600 500;center] $TERM_CMD"
|
|
elif [ "$WORKSPACE" == "special:quake" ]; then
|
|
echo "show"
|
|
|
|
hyprctl activewindow | head -n1 | cut -f2 -d ' ' >/tmp/hypr-quake-address
|
|
|
|
hyprctl activewindow | rg "fullscreen: 1" && hyprctl dispatch fullscreen
|
|
|
|
hyprctl dispatch movetoworkspacesilent "+0,^(quake)\$"
|
|
hyprctl dispatch focuswindow "^(quake)\$"
|
|
hyprctl dispatch bringactivetotop
|
|
else
|
|
echo "hide"
|
|
|
|
hyprctl dispatch movetoworkspacesilent "special:quake,^(quake)\$"
|
|
hyprctl dispatch focuswindow "address:0x$(cat /tmp/hypr-quake-address)"
|
|
hyprctl dispatch bringactivetotop
|
|
fi
|