I3 Assistance

Can anyone help here please, I am trying out Kitty with ncmpcpp and I like my ncmpcpp to open on a particular monitor with a simple keybind.

For some reason I am getting an i3 error when running the following keybind:

bindsym $mod+m workspace $WS6; kitty --class "ncmpcpp" -e ncmpcpp

Can anyone assist and tell me why or what I may have wrong?

It runs fine from dmenu or the terminal. So not sure what is going on.

Here is the i3 error output for reference:

ERROR: PCRE regular expression compilation failed at 31: unmatched parentheses
ERROR: Match is empty, ignoring this for_window statement
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'sticky', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'swap', 'title_format', 'mode', 'bar', 'gaps'
ERROR: Your command: [id="18874375"] enable
ERROR:                               ^^^^^^
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'sticky', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'swap', 'title_format', 'mode', 'bar', 'gaps'
ERROR: Your command: [id="18883802"] enable
ERROR:                               ^^^^^^
ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'sticky', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'swap', 'title_format', 'mode', 'bar', 'gaps'
ERROR: Your command: [id="18927988"] enable
ERROR:                               ^^^^^^
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"
ERROR: Could not translate string to key symbol: "1+y"

Did you check the error?

You need the “exec” to execute the kitty command.

Try changing:

to

I tried it using ranger and moc instead of ncmpcpp and it worked.

3 Likes

And make sure $mod+m isn’t a duplicate binding entry.

2 Likes

Ah yes, it shows how useful another pair of eyes are. Especially as I re-read that a dozen times at least.

Thanks again Mr @PackRat.

Cheers

2 Likes

Another thing I could have done, which in fact I have is to use the following command with st:

st -c "ncmpcpp" -n "ncmpcpp" -e ncmpcpp

Lesson learned. Man Pages are full of information if I take the time to check them out.

1 Like

This line in your error message; i3 is “asking” what you expect to happen with that key binding.

Yep, I understood that once I noticed my mistake.

What I should have explained a little clearer in my last post was, I was looking for an easy way to get a terminal with ncmpcpp opening on the workspace I wanted it to. If I had taken the time to read the man page for st I wouldn’t have needed to bother with a different terminal.
:slight_smile:

FWIW. If you use sxhkd in concert with i3, you don’t need to use nearly as many of the exec ‘style’ commands. Just the exec command to call sxhkd if you put it in i3 conf… if you put the sxhkd call in .xprofile then you don’t even need that.

# shared common keybindings (applications)
sxhkd -c ~/.config/sxhkd/base.conf &

Ain’t it wonderful… :wink:

This what I use.

assign [class="ncmpcpp"] workspace $ws2
bindsym $mod+m exec --no-startup-id kitty --class ncmpcpp -e ncmpcpp

More like a scratchpad option.

for_window [instance="ncmpcpp"] floating enable move position 492px 38px resize set 1500px 600px
for_window [instance="cava"] floating enable move position 492px 640px resize set 1500px 300px
2 Likes

That’s what I use, but for moc.

assign [class="^Moc$"] $ws10

bindsym $mod+Control+z exec "xterm -fa terminus-12 -class Moc -e mocp"

You should also be able to use the “focus” option so that ncmpcpp will open on $wsX, and grab focus. I was having some issues with that last time I tried; need to revisit that functionality.

Don’t mean to derail the thread @Dobbie03

1 Like

If I want a to focus on program upon opening I just use the below. If this is what your saying. ?

for_window [instance="tixati"] focus

You can do this with more then one program at once.

for_window [class=URxvt|Firefox|Geany|Evince|Soffice|libreoffice*|mpv|Ghb|Xfburn|Gimp*|Inkscape|Vlc|Lxappearance|Audacity] focus

@Dobbie03 Sorry if i’am stealing your post…just trying to help.

1 Like

I’m all sorted, thanks though.

I have a fair understanding of i3, it was that I missed the exec that was meant to be in the command.

1 Like