The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
3

Launcher or menu in i3

asked Jun 9 '14

marilion gravatar image

Is there a way to create a launcher or menu within i3 without using an external program like dmenu?

6 answers

Sort by » oldest newest most voted
4

answered Jun 10 '14

phairland gravatar image

I made a menu using the mode feature of i3. This is the code in my configuration file:

set $MENU "Audacious Chromium Dolphin dOublecmd Foxit giMp Gvim Irfanview Nixnote Palemoon Qbittorrent Ranger Skype Vlc Xnview Wps Et Libreoffice"
bindsym Menu mode $MENU
mode $MENU {
bindsym d exec dolphin, mode, "default"
bindsym a exec audacious, mode "default"
bindsym l exec libreoffice, mode "default"
bindsym m exec gimp, mode "default"
bindsym c exec chromium, mode "default"
bindsym i exec irfanview,mode "default"
bindsym p exec palemoon, mode "default"
bindsym f exec foxitreader, mode "default"
bindsym g exec gvim, mode "default"
bindsym w exec wps, mode "default"
bindsym e exec et, mode "default"
bindsym q exec qbittorrent, mode "default"
bindsym v exec vlc, mode "default"
bindsym o exec doublecmd, mode "default"
bindsym x exec xnviewmp, mode "default"
bindsym r exec terminator --profile ranger, mode "default"
bindsym s exec skype, mode "default"
bindsym n exec nixnote, mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}

Just press the Menu key and on the i3bar will appear the menu and you will select the application by pressing the capital letter of each application.

1

answered Jun 10 '14

Man from Mars gravatar image

updated Jun 10 '14

I like both answers (though I slightly prefer phairland's one since Adaephon's suggestion resembles dmenu). I also use xfce application launcher which works well (it is also recognized as floating window and placed in the center of screen) because I have added i3 to original Debian + XFCE install. GMRun is also a nice option you might want to try. For the menu I always thought about adding lxpanel (a little out of i3 "spirit" but useful anyway) since I have no info about a "menu only" application.

1

answered Jun 13 '14

ANOKNUSA gravatar image

updated Jun 13 '14

I did something similar to this, though I got tired of it after a while and slimmed it down to just a few things. (I'm a big fan of dmenu, myself). A keybinding is paired with a number to enter a mode for a category of applications, after which the number keys correspond to applications in that category.

Here's a snippet of what I had in my old config. The glyphs are from Font Awesome, so that needs to be locally installed if you actually want to use them:

# Enter Index mode
bindsym $mod+Mod1+2 mode   Index [Editor]
bindsym $mod+Mod1+3 mode   Index [Messages]

mode "  Index [Editor]" {
    bindsym 1 exec --no-startup-id termite -t "  Work" -r edr -e "vim '+cd ~/doc/work'"; mode default
    bindsym 2 exec --no-startup-id termite -t "  Blog" -r edr -e "vim '+cd ~/prj/web/crepcran'"; mode default
    bindsym 3 exec --no-startup-id termite -t "  Code" -r edr -e "vim '+cd ~/prj'"; mode default
    bindsym 4 exec --no-startup-id termite -t "  Conf" -r edr -e vim; mode default
    bindsym Escape mode "default"
}
mode "  Index [Messages]" {
    bindsym 1 exec --no-startup-id termite -t "  Mail" -r msg -e mutt; mode default
    bindsym 2 exec --no-startup-id termite -t '  Twitter' -r msg; mode default
    bindsym Escape mode "default"
}
0

answered Jun 10 '14

Adaephon gravatar image

updated Jun 10 '14

You could use i3-input for a primitive launcher:

bindsym $mod+p exec --no-startup-id i3-input -F 'exec "%s"' -P 'run> '

Although - strictly speaking - i3-input is an external program, it comes with i3 and should always be available.

Comments

How about the mode feature of i3. I managed to display a menu, much like when resizing the word "resize" appear on the i3bar, then capitalised each letter that binds the execution of the program as shown on my answer.

phairland gravatar imagephairland (Jun 10 '14)edit

You're right, that would work. I removed the paragraph about this no being possible ;)

Adaephon gravatar imageAdaephon (Jun 10 '14)edit
0

answered Jun 9 '14

You can launch applications that you like by binding them to particular keyboard shortcuts, eg:

bindsym $mod+Return exec xterm
bindsym XF86Search exec /usr/bin/firefox
bindsym XF86Mail exec /usr/bin/thunderbird
-1

answered Jun 29 '14

I use synapse with keybinding

bindsym $mod+x exec --no-startup-id synapse

Question Tools

Stats

Asked: Jun 9 '14

Seen: 2,238 times

Last updated: Jun 29 '14