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

How to Sandbox a Terminal

I often pull code from remote repositories and execute it for testing. This is an area where sandboxing would be extremely beneficial.

via Ξ October 11, 2025

Hastily made coffee video

I made a video about making coffee

via Xe Iaso's blog September 30, 2025

Cloudflare bankrolls fascists

US politics has been pretty fascist lately. The state is filling up concentration camps, engaging in mass state violence against people on the basis of racialized traits, deporting them to random countries without any respect for habeas corpus, exerting stat…

via Drew DeVault's blog September 24, 2025

Generated by openring