13 releases

0.2.2 Oct 17, 2024
0.2.1 Dec 17, 2023
0.2.0 Nov 5, 2023
0.1.8 Sep 6, 2022
0.1.4 Mar 21, 2022

#1404 in Filesystem

Download history 140/week @ 2024-08-26 38/week @ 2024-09-02 163/week @ 2024-09-09 218/week @ 2024-09-16 148/week @ 2024-09-23 57/week @ 2024-09-30 183/week @ 2024-10-07 572/week @ 2024-10-14 143/week @ 2024-10-21 74/week @ 2024-10-28 99/week @ 2024-11-04 60/week @ 2024-11-11 95/week @ 2024-11-18 87/week @ 2024-11-25 93/week @ 2024-12-02 136/week @ 2024-12-09

417 downloads per month
Used in 2 crates

BSD-3-Clause

98KB
2K SLoC

LeftHK

LeftHK - A hotkey daemon written in Rust

THIS IS BETA SOFTWARE

The configuration file should be created in ~/.config/lefthk/ and called config.ron. If the configuration file is not created the program will exit. Example config:

#![enable(implicit_some)]
Config(
    default_modifier: ["Mod4", "Shift"],
    keybinds: [
        Keybind(
            command: Execute("st -e htop"),
            key: Key("x"),
        ),
        Keybind(
            command: Executes(["st -e htop", "st -e bpytop"]),
            key: Keys(["x", "m"]),
        ),
        Keybind(
            command: Chord([
                Keybind(
                    command: Execute("st -e htop"),
                    modifier: ["Mod4"],
                    key: Key("c"),
                ),
            ]),
            modifier: ["Mod4"],
            key: Key("c"),
        ),
    ]
)

Reload, Kill, Chord, and ExitChord are the only internal commands. To run a normal command you need to call Execute or Executes, with the added value or values of the command. A chord can accept any amount and type of extra keybinds, which when started blocks previous keybinds and will exit once a sub-keybind is executed. A Chord will take the ExitChord set within it first, then if not set it will take the ExitChord from its parent (e.g. a Chord within a Chord will take the ExitChord from the previous Chord). There is a pipe which receives commands through $XDG_RUNTIME_DIR/lefthk/commands.pipe, currently only accepts Reload and Kill.

Dependencies

~6–14MB
~183K SLoC