21 releases

new 0.3.0 Apr 23, 2024
0.2.10 Mar 22, 2024
0.1.50 Dec 10, 2023
0.1.41 Nov 5, 2023
0.1.3 Jul 8, 2023

#89 in GUI

Download history 1/week @ 2024-01-05 13/week @ 2024-01-12 1/week @ 2024-01-19 2/week @ 2024-02-02 159/week @ 2024-02-09 209/week @ 2024-02-16 44/week @ 2024-02-23 22/week @ 2024-03-01 273/week @ 2024-03-08 184/week @ 2024-03-15 154/week @ 2024-03-22 58/week @ 2024-03-29 7/week @ 2024-04-05 251/week @ 2024-04-19

316 downloads per month

MIT and GPL-3.0-or-later

17KB
370 lines

Hyprscratch

A scratchpad utility for Hyprland

Installation

Using cargo (Make sure ~/.cargo/bin is in $PATH):

cargo install hyprscratch

Usage

In hyprland.conf:

exec-once = ~/.cargo/bin/hyprscratch [OPTIONS] #start the hyprscratch daemon

bind = $MOD, $KEY, exec, ~/.cargo/bin/hyprscratch $WINDOW_TITLE "$HYPRLAND_EXEC_COMMAND" [OPTIONS] #configure scratchpads

For example:

bind = $mainNod, b, exec, ~/.cargo/bin/hyprscratch btop "[float;size 70% 80%;center] kitty -e btop onstart"

Hyprscratch commands:

  • clean [spotless]: starts the daemon and hides all scratchpads no workspace change. The spotless option also hides them on losing focus to non-floating windows.

  • cycle: cycles between non-special scratchpads in the order they are defined in the config file.

  • hideall: hides all scratchpads, useful mostly for stacked ones.

  • reload: reparses changes to the config file without restarting the daemon.

  • get-config: prints out the parsed config, useful for debugging potential syntax issues.

Options than can be used for scratchpads are:

  • stack: makes it so that the scratchpad doesn't hide one that is already present. This can be used to group multiple scratchpads by binding them to the same key and using stack on all except the first one.

  • shiny: makes it so that the scratchpad is not hidden by clean spotless.

  • onstart: spawns the scratchpad at the start of the hyprland session.

  • special: uses the special workspace. Ignores stack, shiny and is ignored by clean and cycle.

Other Relevant information

To find the title needed for a scratchpad, run hyprctl clients and check the initialTitle field. An incorrect title results in the scratchpad not being hidden and a new one being spawned instead.

If there are multiple scratchpads with the same initial title, the program just grabs the first one it finds.

Scratchpads don't have to be floating. This can also be used to just spawn a specific window, where the binding also hides it or grabs it from another workspace. Non-floating scratchpads are ignored by clean.

The program doesn't use hyprlands special workspace by default, it uses workspace 42.

Dependencies

~6–14MB
~166K SLoC