Skip to content

Instantly share code, notes, and snippets.

@spinualexandru
Created April 30, 2025 07:39
Show Gist options
  • Save spinualexandru/ab36ea8aa07430e8114399cec9ad0c49 to your computer and use it in GitHub Desktop.
Save spinualexandru/ab36ea8aa07430e8114399cec9ad0c49 to your computer and use it in GitHub Desktop.
#!/bin/bash
TERM_CLASS="dropdownkitty"
# Check if dropdown terminal exists
if ! pgrep -f "kitty --class $TERM_CLASS" > /dev/null; then
# Launch kitty with animation layer enabled (appears from top)
kitty --class $TERM_CLASS --title "Dropdown Terminal" &
# Wait for it to start
sleep 0.1
# Apply animation layer and ensure it's above waybar
hyprctl layerrule "blur,^($TERM_CLASS)$"
hyprctl layerrule "animation slide,^($TERM_CLASS)$"
hyprctl layerrule "order 5,^($TERM_CLASS)$"
exit 0
fi
# Get window ID
WIN_ID=$(hyprctl clients -j | jq -r ".[] | select(.class==\"$TERM_CLASS\") | .address")
# Check if already visible
IS_HIDDEN=$(hyprctl clients -j | jq -r ".[] | select(.class==\"$TERM_CLASS\" and .workspace.name == \"special:dropdown\") | .address")
if [ -n "$IS_HIDDEN" ]; then
# It's hidden, bring it back
CUR_WS=$(hyprctl activeworkspace -j | jq -r '.id')
hyprctl dispatch movetoworkspace "$CUR_WS,address:$WIN_ID"
hyprctl dispatch focuswindow "address:$WIN_ID"
# Ensure it's in a high layer order when shown
hyprctl layerrule "order 5,^($TERM_CLASS)$"
else
# It's visible, hide it
hyprctl dispatch movetoworkspacesilent "special:dropdown,address:$WIN_ID"
fi
bind = $mainMod, grave, exec, ~/.config/hypr/scripts/dropdownTerminal.sh
windowrulev2 = float, class:^(dropdownkitty)$
windowrulev2 = size 100% 25%, class:^(dropdownkitty)$
windowrulev2 = move 0% 0%, class:^(dropdownkitty)$
windowrulev2 = animation slide, class:^(dropdownkitty)$
windowrulev2 = noanim, class:^(dropdownkitty)$,floating:1,move
windowrulev2 = noblur, class:^(dropdownkitty)$
windowrulev2 = noborder, class:^(dropdownkitty)$
windowrulev2 = nodim, class:^(dropdownkitty)$
windowrulev2 = nomaxsize, class:^(dropdownkitty)$
windowrulev2 = rounding 0, class:^(dropdownkitty)$ # Disable rounding
windowrulev2 = stayfocused, class:^(dropdownkitty)$ # Keep focus when toggling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment