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

exec with "scrot -e "mv ; feh" gives an error

asked 2014-07-11 17:38:27 +0000

simendsjo gravatar image

updated 2014-07-11 17:38:57 +0000

I think this might be a problem with scrot, but I really have no idea :)

I have the following bindings:

bindsym Print exec --no-startup-id scrot '%Y-%m-%d-%T.png' -e 'mv $f ~/Screenshots/'

bindsym Shift+Print exec scrot '%Y-%m-%d-%T.png' -e 'mv $f ~/Screenshots/ ; feh ~/Screenshots/%Y-%m-%d-%T.png'

The first one works fine, but the one that should execute feh after taking the screenshot doesn't work as expected. I get the following error:

ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'mode', 'bar' ERROR: Your command: exec scrot '%Y-%m-%d-%T.png' -e 'mv $f ~/Screenshots/ ; feh ~/Screenshots/%Y-%m-%d-%T.png' ERROR: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2014-07-11 17:50:05 +0000

Michael gravatar image

You need to quote the command since it contains a semicolon, which is used in i3 to separate commands:

bindsym Shift+Print exec "scrot '%Y-%m-%d-%T.png' -e 'mv $f ~/Screenshots/ ; feh ~/Screenshots/%Y-%m-%d-%T.png'"
edit flag offensive delete link more

Comments

Of course! Thanks!

simendsjo gravatar imagesimendsjo ( 2014-07-11 18:50:36 +0000 )edit

Question Tools

Stats

Asked: 2014-07-11 17:38:27 +0000

Seen: 382 times

Last updated: Jul 11 '14