Simple Launcher for Sway

SergeantBiggs

archlinuxlinuxtechnologysway

134 Words

2022-10-02 13:36 +0000


I wanted to share something that has been in my i3/sway config for quite a while. I don’t know where I got it from exactly, but I’ve found it quite useful over the years. It uses binding modes to create a simple program launcher.

Binding modes deactivate all normal bindings when switching to them. Only the bindings defined in the binding mode are active.

set $mode_launcher "Start: [f]irefox [c]hat [k]eepassxc [q]uit"

mode $mode_launcher {
    bindsym f exec firefox
    bindsym c exec ~/.config/sway/scripts/social.sh
    bindsym k exec keepassxc

    bindsym Return mode "default"
    bindsym Escape mode "default"
    bindsym $mod+o mode "default"
    bindsym q mode "default"
}

bindsym $mod+o mode $mode_launcher

After going into the mode with $mod+0, we can start the applications with the relevant keys. The mode can be exited using Return, Esc, $mod+o or q.

Articles from blogs I read

Final Fantasy 14 on macOS with a 36 key keyboard

Saving Eorzea with as few keys as possible

via Xe Iaso's blog August 24, 2025

Embedding Wren in Hare

I’ve been on the lookout for a scripting language which can be neatly embedded into Hare programs. Perhaps the obvious candidate is Lua – but I’m not particularly enthusiastic about it. When I was evaluating the landscape of tools which are “like Lua, but no…

via Drew DeVault's blog August 20, 2025

What is HDR, really?

HDR is about having more details in shadows and highlights. A higher dynamic range is one piece of the puzzle, but not all of it.

via Ξ July 18, 2025

ASG! 2025 CfP Closes Tomorrow!

The All Systems Go! 2025 Call for Participation Closes Tomorrow! The Call for Participation (CFP) for All Systems Go! 2025 will close tomorrow, on 13th of June! We’d like to invite you to submit your proposals for consideration to the CFP submission site quick…

via Pid Eins June 12, 2025

Generated by openring