hdrop(1)

πŸ“¦
version 0.7.9 Β· 2 versions
, in nixos 26.05

πŸ’… hdrop(1) β€” the Hyprland show/hide bestie

ok so picture this: it's hdrop(1), from the General Commands Manual, and it's literally here to run, show and hide your programs on Hyprland. iconic behavior only. πŸ¦‹


✨ NAME ✨

hdrop β€” run, show and hide programs on Hyprland. that's it, that's the whole vibe. πŸ‘‘


🌸 SYNOPSIS 🌸

hdrop [OPTIONS] [COMMAND]

πŸŽ€ COMMAND πŸŽ€

  • COMMAND β€” the usual command you would run to start the desired program. like, the plain normal one you'd type anyway. no extra steps, bestie 🫢

✨ OPTIONS ✨

  • -b, --background β€” flips the default behaviour: if the specified program is not running, launch it in the background instead of foreground. after that, hdrop -b works the same as without this flag. so it's a one-time nudge, not a permanent lifestyle πŸ’…
  • -c, --class β€” set the classname of the program to be run. use this if the classname is different from the name of the [COMMAND] and hdrop has not yet a hardcoded replacement. the "i know her by a different name" flag 🎭
  • -f, --floating β€” spawn as a floating window. standard is top half, full width, no gap. can be adjusted with -g, -h, -p and -w. cute little floater 🌸
  • -F, --focus β€” flips the default behaviour: focus the specified program's window and switch to its present workspace if necessary. do not hide it, if it's already on the current workspace. main character energy, no hiding πŸ”₯
  • -g, --gap β€” if using --floating: specify gap to the screen edge in pixels.
  • -h, --height β€” if using --floating: set the height of the window. enter percentage value without % sign, e.g. '30'.
  • -H, --help β€” print help message. the classic 🫢
  • -i, --insensitive β€” case insensitive partial matching of class names. can work as a stopgap if a running program is not recognized and a new instance is launched instead. note: incorrect matches may occur, adding a special handling of the program to hdrop (hardcoded or via -c, --class) is preferable. it's giving "good enough for now" πŸ’€
  • -o, --online β€” delay initial launch for up to 20 seconds until internet connectivity is established. patiently waiting for the wifi to wake up 😭
  • -p, --position β€” if using --floating: set the position of the window. one of: '[t]op' '[b]ottom' '[l]eft' '[r]ight'.
  • -v, --verbose β€” show notifications regarding the matching process. try this to figure out why running programs are not matched. detective mode πŸ”
  • -V, --version β€” print version.
  • -w, --width β€” if using --floating: set the width of the window. enter percentage value without % sign, e.g. '30'.

🌈 Description 🌈

this script emulates the main features of [tdrop](https://github.com/noctuid/tdrop) in Hyprland. here's the whole plot:

  • if the specified program is not running: launch it and bring it to the foreground.
  • if the specified program is already running on another workspace: bring it to the current workspace and focus it.
  • if the specified program is already on the current workspace: move it to workspace special:hdrop, thereby hiding it until called up again by hdrop.

so it's like a little drawer for your apps. open, close, open, close. obsessed. 🧚


πŸ¦‹ Multiple instances:

multiple instances of the same program can be run concurrently, if different class names are assigned to each instance. presently there is support for the following flags in the [COMMAND] string:

  • -a ('foot' terminal emulator)
  • --class (all other programs).

(also the original really did end that list with a period, no notes πŸ’€)

πŸ’– Example bindings in Hyprland config:

bind = $mainMod, b, exec, hdrop librewolf
bind = $mainMod, x, exec, hdrop kitty --class kitty_1
bind = $mainMod CTRL, x, exec, hdrop kitty --class kitty_2
bind = $mainMod, c, exec, hdrop foot -a foot_1
bind = $mainMod CTRL, c, exec, hdrop foot -a foot_2

note: defining a class name is only necessary when running several instances of the same program. no cap ✨

if you want to run a program on boot and have it wait in the background until called up by hdrop you can use this:

exec-once = hdrop -b librewolf

🌸 Troubleshooting 🌸

πŸŽ€ Cursor jumps to newly focused windows

set no_cursor_warps = true in hyprland.conf section general. that's the fix, you're welcome πŸ’…

πŸŽ€ Further instances of programs are started instead of hiding/unhiding a running instance

if hdrop can't match an already running program and starts a new instance instead, then its class name is most likely different from its command name. for example, the class name of telegram-desktop is org.telegram.desktop and the class name of logseq is Logseq. like, they're lying about their names smh 😭

run hdrop -v [COMMAND] in the terminal to see maximum output for troubleshooting and find out the actual class name. then use hdrop -c CLASSNAME to make it work. hdrop -i [COMMAND] might be sufficient, as long as a case insensitive (partial) match is sufficient. fr fr 🫢

please report instances of programs with differing class names, so that they can be added to hdrop. community service king behavior πŸ‘‘

πŸŽ€ Floating windows don't react to changed arguments

close the program (don't just hide it with hdrop). the changed arguments are only applied when the program is restarted. like, it's not ignoring you on purpose, it just needs a fresh start πŸ™ˆ


⭐ License ⭐


k that's the whole page bestie πŸ’– it's hdrop(1), dated 1980-01-01 (yes literally, the source/version line said so, i don't make the rules), and that's the sign-off β€” go hide a window, go slay 🌈✨

πŸ“¦ where this page comes from