#sway #command #mode #daemon #timeout #toml #screen

app swaymode-exec

run commands when sway changes keybind mode

2 releases

0.1.1 Aug 30, 2024
0.1.0 Aug 30, 2024

#10 in #timeout

Download history 212/week @ 2024-08-30 5/week @ 2024-09-06 21/week @ 2024-09-13 15/week @ 2024-09-20 22/week @ 2024-09-27

63 downloads per month

BSD-4-Clause

6KB
128 lines

swaymode-exec

Hi, this is a daemon for sway that runs commands on kekybind mode changes.
I like to use it to set screen timeouts or for custom keybinds for eww.

Installing

Installing is quite simple, just run:

git clone _this_repo_
cargo install --path .

Configuring

# This should go into $HOME/${XDG_CONFIG_HOME:-.config}/swaymode-exec.toml

# Mode name to trigger on
[audio]
# This is run when the mode is set
start = "while true; do notify-send start; sleep 0.5; done"
# This is run when the mode changed
end = "notify-send end"
# Kill start command after mode is changed (default: false)
kill_start = true

ToDo:

  • specify custom config file
  • run commands via swayipc

Dependencies

~1–1.8MB
~39K SLoC