Quick Quality-of-Life Improvements

What I stumbled upon when reading the i3 User’s Guide is binding_modes

So when I’ve booted my machine, there are a bunch of AppVMs I want to start or not. Stuff like the split-ssh-vault get started automatically, but sometimes I’m interested in quickly launching a few AppVMs.

What I ended up with was this:

where $mod is the i3 modifier key. This is depending on your configuration either Alt (aka Meta) or Super (aka Windows-Key). It gets configured very early at the top of ~/.config/i3/config and is then refered to as $mod throughout the configuration.

set $mode_launcher Launch: [e]macs [m]ail [t]elegram [s]ignal e[l]ement [d]iscord [k]iwix [z]eal
bindsym $mod+o mode "$mode_launcher"

# My own little menu launcher to access single-purpose app qubes faster =)
mode "$mode_launcher" {
    # EDITOR
    bindsym e exec qvm-run dev "emacsclient -c -a 'emacs'"

    # CHAT
    bindsym s exec qvm-run signal signal-desktop
    bindsym t exec qvm-run telegram telegram-desktop
    bindsym d exec qvm-run discord discord
    bindsym l exec qvm-run element element-desktop
    #bindsym e exec qvm-run element element-desktop # FIXME: clashes with emacs
    bindsym m exec qvm-run mail thunderbird

    # DOC
    bindsym k exec qvm-run kiwix kiwix-desktop
    bindsym z exec qvm-run zeal zeal

    bindsym Escape mode "default"
    bindsym Return mode "default"
}

This works very similar to the resize-binding mode.

This allows me to do
$mod+o + e + ESC to spawn an editor

the neat thing with this mode really is that I can launch everything I want with a single keystroke before leaving with ESC

so $mod+o + stdlm + ESC will launch every chat-app.
This was 5 $mod+d or $mod+shift+Enter invocations + finding the right AppVM before!

or $mod+o + eee + ESC will launch 3 editor instances.

the top level line set $mode_launcher... is really just a visual help inside i3bar… I tend to forget stuff.

This really shines with @fiftyfourthparallel’s halt-vm-by-window script, which I personally bound to this:

bindsym $mod+Shift+p exec --no-startup-id halt-vm-by-window

“need to look up some docs” … $mod+o + z + ESC
"oh, I dont need this anymore … $mod+Shift+p

saved me lots of qvm-run and the latter qvm-shutdown invocations per day/hour.

At this point: thx @fiftyfourthparallel!

1 Like