The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.
Ask Your Question
1

i3-input starting programs

asked 2015-01-29 20:32:00 +0000

Kretortex gravatar image

Hey, at the moment I have a mode which allows me to start my favourite Programs with just hitting one key.

It looks like this:

mode "startPrograms" {

bindsym t exec telegram

bindsym e exec thunderbird

}

bindsym $modeOne+g mode "startPrograms"

Now because I added more and more programs. I would like to see a prompt showing me the shortcuts for the programs, when entering the "startPrograms" mode.

How could I do this?

I tried something with this:

name=i3-input -P 'Programs:'

But I don't know how to do a prompt with more than one line. Or should I really read the input and work with it?

Can anyone help me? This would be great!

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2015-01-29 20:51:19 +0000

Pinyaka gravatar image

updated 2015-01-29 20:54:38 +0000

Basically, rename your mode from StartPrograms to the help text that you want to display. Here is what I have for my "system" mode.

bindsym $mod+y mode "$system_menu"
set $system_menu (l)oad i3 config (L)ock (r)estart i3 (R)eboot (s)uspend (S)hutdown
mode "$system_menu" {
     bindsym l reload, $return
     bindsym Shift+l exec i3exit lock, $return
     bindsym r restart, $return
     bindsym Shift+r exec i3exit reboot, $return
     bindsym s exec i3exit suspend, $return
     bindsym Shift+s exec i3exit shutdown, $return
     bindsym space $return
     bindsym Return $return
     bindsym Escape $return
}

I don't need to capture input at all as the "name" of the mode is the help text.

edit flag offensive delete link more

Comments

Sadly this would get too long in my case, thank you anyway.

Kretortex gravatar imageKretortex ( 2015-01-29 20:54:15 +0000 )edit

How were you planning to display the shortcuts if just displaying the shortcuts is too long?

Pinyaka gravatar imagePinyaka ( 2015-01-29 20:55:50 +0000 )edit

it is not too long for displaying them. It is just too long for displaying them where the mode Name is displayed.

Kretortex gravatar imageKretortex ( 2015-01-29 21:33:10 +0000 )edit
0

answered 2015-04-19 03:36:06 +0000

i3convert gravatar image

updated 2015-04-19 03:44:05 +0000

If you don't insist on i3-input, you can use dmenu. A sample script in bash that uses it would be:

#!/bin/bash
list="thunderbird\n"
list+="firefox\n"
list+="digikam\n"
list+="gimp\n"
command=`echo -e "$list" | dmenu`
$command

Now you can start typing a name of the command and it's going to narrow the set of options. If you want the options to be listed vertically (as opposed to horizontally), use dmenu -l 10 instead of dmenu, where the number after -l specifies the maximum number of options to be displayed at any particular time.

In this example, I use names of actual commands, but you can use dmenu to select from a set of arbitrary strings and then based on what is selected, you could run arbitrary commands (using for instance the case statement in bash).

edit flag offensive delete link more
0

answered 2015-04-18 23:08:30 +0000

I am solving this issue is the following way:

  • Favourite programs associated with workspace.
  • Mode connecting workspace and keys.
  • Help text file, cut-and-paste of bind-keys definition, in case I forget.

Result: For example, pressing Numeric-Pad-8+t+Return goes to the "network" workspace and opens Telegram. In case I forget, I can press Numeric-Pad-8+h+See-the-key-I-have-to-press+Return

using key 8 on the numeric pad

set  $8 KP_Up

And this is the "network" workspace: set $W8 "8: Network"

Shift+numericpad8 goes to workspace 8 and enters the network mode

bindsym Shift+$8  workspace  $W8; mode "Network"

When entering the mode "Network", I have these keybindings:

# Network {{{
mode "Network" {
    bindsym h exec xmessage -nearmouse -file ~/.config/i3/help_Network.txt
    bindsym i exec urxvtc -e irssi
    bindsym r exec urxvtc -e rtorrent
    bindsym t exec /usr/local/bin/Telegram/Telegram
    bindsym w exec wicd-gtk -n 

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
# }}}

And this is the text file, cut-and-paste of the key-bindings:

key
w wicd
t Telegram
i rssi
r rtorrent
h help

Also:
- connman
- wpa_gui
edit flag offensive delete link more

Question Tools

Stats

Asked: 2015-01-29 20:32:00 +0000

Seen: 284 times

Last updated: Apr 19