What does the demo mean?

Toggling between the following:

  1. Super+e for nvim scratchpads
  2. Super+t for tmux misc session with countdown running
  3. Super+m for tmux music session with lue running
  4. Super+u for Obsidian obsidian-excalidraw-plugin

Introduction

I used to use scratchpads from pyprland, but it has grown to a swiss army knife of different plugins that I don’t use. There were some stability issues that made me look for alternatives, and I found hyprscratch. It does exactly what I want: scratchpad management and nothing more.

Getting Started

  1. Add hyprscratch to your flake input:
{
  inputs = {
    hyprscratch = {
      url = "github:sashetophizika/hyprscratch";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
}
  1. Use the input in home-manager:
{ inputs, ... }:

{
  imports = [ inputs.hyprscratch.homeModules.default ];

  programs.hyprscratch = {
    enable = true;
  };
}
  1. start hyprscratch in hyprland.conf using uwsm:
exec-once = sleep 10 ; uwsm app -- hyprscratch init
Info
I needed to add sleep 10 to prevent some race condition that results in weird waybar/workspaces. You likely don’t need it.

My setup:

bind = $mod, e, exec, hyprscratch terminal_super_e "[size (monitor_w*0.9) (monitor_h*0.9); center on] kitty --class terminal_super_e --execute tmux attach-session -t ai" persist pin
bind = $mod, t, exec, hyprscratch terminal_dropterm "[size (monitor_w*0.6) (monitor_h*0.45); move ((monitor_w-window_w)/2) (monitor_h*0.035)] kitty --class terminal_dropterm --execute tmux attach-session -t misc" persist pin
bind = $mod, m, exec, hyprscratch terminal_music "[size (monitor_w*0.43) (monitor_h*0.70); move (monitor_w*0.568) ((monitor_h-window_h)/2)] kitty --class terminal_music --execute tmux attach-session -t music" persist pin
bind = $mod, u, exec, hyprscratch obsidian "[size (monitor_w*0.9) (monitor_h*0.9); center on] obsidian" persist pin
Note
It’s using the new Window Rules syntax introduced in v0.53.0.

It’s not a plug-and-play solution. If you want to make the above work:

  • I used kitty as my terminal.
  • I have tmux sessions ai, misc and music already running. I used tmuxp as my session manager. tmux attach-session -t music etc needs to work already.

Conclusion

Give this project some love!