Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some bindsym exec commands do not work as expected #518

Closed
harrisonrodgers opened this issue Mar 18, 2016 · 3 comments
Closed

some bindsym exec commands do not work as expected #518

harrisonrodgers opened this issue Mar 18, 2016 · 3 comments

Comments

@harrisonrodgers
Copy link

Hello.

I was trying to specify colors for dmenu in bindsym and:

bindsym $mod+a exec dmenu_run -b -i -nb "#FDF6E3" -nf "#657B83" -sb "#EEE8D5" -sf "#CB4B16"

  • does not work in sway
  • works in i3

bindsym $mod+d exec dmenu_run -b -i -nb '#FDF6E3' -nf '#657B83' -sb '#EEE8D5' -sf '#CB4B16'

  • does not work in sway
  • works in i3

bindsym $mod+g exec dmenu_run -b -i -nb "'#FDF6E3'" -nf "'#657B83'" -sb "'#EEE8D5'" -sf "'#CB4B16'"

  • works in sway
  • does not work in i3

Note the following work from a terminal:

  • dmenu_run -b -i -nb #FDF6E3 -nf #657B83 -sb #EEE8D5 -sf #CB4B16
  • dmenu_run -b -i -nb '#FDF6E3' -nf '#657B83' -sb '#EEE8D5' -sf '#CB4B16'
  • dmenu_run -b -i -nb "#FDF6E3" -nf "#657B83" -sb "#EEE8D5" -sf "#CB4B16"

sway -d -V output http://pastebin.com/raw/5F1hruns

Thanks.

mikkeloscar added a commit to mikkeloscar/sway that referenced this issue Mar 18, 2016
Before passing a command to a command handler the quotes are stripped
from each argument in the command. This is usually the wanted behavior
but causes a problem in the case of `exec` where quoted arguments can be
required when passing the exec command to `/bin/sh -c`.

This patch makes `exec` a special case and doesn't strip quotes from the
arguments. It will just pass the exec command verbatim to the exec
command handler.

Fix swaywm#518
@ilpianista
Copy link

ilpianista commented May 1, 2016

Commit 99f26c6 breaks the following config:

bindsym $mod+x exec "dmenu_run -i -nb '#181818' -nf '#d8d8d8' -sb '#181818' -sf '#a1b56c'"

This works in i3, but doesn't in sway.

I'm missing why strip_quotes strips all quotes and not just starting and trailing quotes?

@mikkeloscar
Copy link
Collaborator

This has been discussed a bit here: #521

Basically in any sane implementation anything wrapped in "" means a single argument, if you start to make special cases like i3 does, it gets complicated and confusing. We like to avoid that if possible.

@ddevault
Copy link
Contributor

ddevault commented May 1, 2016

To clarify: this is a place where I am willing to break backwards compatability in exchange for saner behaviour. The correct command is:

bindsym $mod+x exec dmenu_run -i -nb '#181818' -nf '#d8d8d8' -sb '#181818' -sf '#a1b56c'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants