I3wm modes are menus (unicode & FontAwesome support)

Well hello there guys, these days we have time so I decide to rewrite my i3 config and take a deeper look at modes, by using them we can for example enter in “resize mode” … we do our stuff and then press Escape to return in default mode.
Ok now let’s create a new one by setting a variable (unicode & FontAwesome support):

set $URxvt URxvt: (c)mus (h)top (j)nettop (m)ixer (n)cmpcpp (r)ss (y)outube

So with [c} I launch cmus etc… so now I define a keybinding to enter “URxvt” mode:

bindsym $mod+u mode "$URxvt"

… the mode itself:

##launch urxvt applications
mode "$URxvt" {
    bindsym c exec --no-startup-id urxvtc -name cmus_instance -e cmus, mode "default"
    bindsym h exec --no-startup-id urxvtc -name htop_instance -e htop -u archangel, mode "default"
    bindsym j exec --no-startup-id urxvtc -name jnettop_instance -e sudo jnettop -i any, mode "default"
    bindsym m exec --no-startup-id urxvtc -name pulsemixer_instance -e pulsemixer, mode "default"
    bindsym n exec --no-startup-id urxvtc -name ncmpcpp_instance -e ncmpcpp -S clock --quiet, mode "default"
    bindsym r exec --no-startup-id urxvtc -name newsboat_instance -e newsboat, mode "default"
    bindsym y exec --no-startup-id urxvtc -name youtube-viewer_instance -e youtube-viewer, mode "default"

    # back to normal: Escape

    bindsym Escape mode "default"
}

And as if we want to exit the menu as soon as we press the desired key don’t forget to add after your commands:

, mode "default"

That’s it, we have a menu! :smiley:
ps: for newbies, here I use urxvt as a daemon.

4 Likes

Wow! Amazing work as usual. Thank you for sharing.

Top job again @archus . Keep it on m8

1 Like

thx, little things here and there, that’s my way.

1 Like

I like it :smiley: