#sway #command #mode #keybind #daemon #timeout #toml

app swaymode-exec

run commands when sway changes keybind mode

2 releases

0.1.1 Aug 30, 2024
0.1.0 Aug 30, 2024

#207 in GUI

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