Skip to main content

If you like to write your own extensions or get more features, you may want to check out https://github.com/fdev31/pyprland

Installation

pip install hpr-scratcher

OR

  • copy and rename the __init__.py file to some accessible path, do not forget to add +x to it

Features

  • Allow showing & hiding sliding scratchpads
  • Allow auto-hide when the focus is lost
  • Supports optional animation from top, bottom, left or right
  • Reload config without restart

Usage

As an example, defining two scratchpads:

  • term which would be a kitty terminal on upper part of the screen
  • volume which would be a pavucontrol window on the right part of the screen

In your hyprland.conf add something like this:

exec-once = hpr-scratcher

# Repeat this for each scratchpad you need
bind = $mainMod,V,exec,hpr-scratcher toggle volume
windowrule = float,^(pavucontrol)$
windowrule = workspace special silent,^(pavucontrol)$

bind = $mainMod,A,exec,hpr-scratcher toggle term
$dropterm  = ^(kitty-dropterm)$
windowrule = float,$dropterm
windowrule = workspace special silent,$dropterm
windowrule = size 75% 60%,$dropterm

Then in $HOME/.config/hypr/scratchpads.json add:

{
  "term": {
    "command": "kitty --class kitty-dropterm",
    "animation": "fromTop",
    "margin": 50,
    "unfocus": "hide"
  },
  "volume": {
    "command": "pavucontrol",
    "animation": "fromRight"
  }
}

And you'll be able to toggle pavucontrol with MOD + V.

Command-line options

  • reload : reloads the configuration file
  • toggle <scratchpad name> : toggle the given scratchpad
  • show <scratchpad name> : show the given scratchpad
  • hide <scratchpad name> : hide the given scratchpad

Note: with no argument it runs the daemon (doesn't fork in the background)

Scratchpad Options

command

This is the command you wish to run in the scratchpad. For a nice startup you need to be able to identify this window in hyprland.conf, using --class is often a good idea.

animation

Type of animation to use

  • null / "" / not defined
  • "fromTop"
  • "fromBottom"
  • "fromLeft"
  • "fromRight"

offset (optional)

number of pixels for the animation.

unfocus (optional)

allow to hide the window when the focus is lost when set to "hide"

margin (optional)

number of pixels for the margin

Changelog

0.6.0

  • animation names are case-insensitive now
  • drop hyprctl dependency
  • auto-restarts applications when needed

0.5.0

  • windows can slide from any direction now (values for "animation" property):
    • fromTop
    • fromBottom
    • fromLeft
    • fromRight
  • make "class" option obsolete
  • FIX: code reloading
  • FIX: misc improvements

0.4.0

  • the offset is now optional
  • the margin can be configured now
  • FIX: fast repetition of show/hide sequences
  • FIX: automatic hide on focus lost doesn't trigger before the window takes the focus

0.3.0

  • add animation (only "fromTop" now, but can be switched off)
  • pid used in most commands (more reliable)
  • FIX: stop pinning the windows
  • FIX: debug traces
  • FIX: close processes on exit (should be configurable ?)

0.2.0

  • add a "reload" command re-reading the configuration
  • allow automatic hiding on focus

0.1.0

  • first version, close to no options

Metadata

Release files for hpr-scratcher 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hpr-scratcher 0.6.1
File Size Uploaded
hpr_scratcher-0.6.1.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hpr-scratcher 0.6.1
File Interpreter ABI Platform
hpr_scratcher-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / hpr_scratcher-0.6.1.tar.gz

Download URL hpr_scratcher-0.6.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8cb234007a9eac5ad624a062554325ef6863d9489220f8754e18b5b507cf6637
BLAKE2b-256 checksum
How to use checksums
8b49f228a657c8a9c212e799d531d6702268ddc6341602bd8a35b8505d470c53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.10 Linux/6.2.12-zen1-1-zen

Release files / hpr_scratcher-0.6.1-py3-none-any.whl

Download URL hpr_scratcher-0.6.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69a0db4e78bceeea8a6d6ad70cc42d207b0445a067d61c433f2a24d01131810c
BLAKE2b-256 checksum
How to use checksums
7f59a7dbec14f6e38b6e19d10014766f1994876b5dd66e5155625b5b30bf927c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.10 Linux/6.2.12-zen1-1-zen

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page