Debian+i3, run scrot from i3 config with symbind

I’m trying to invoke scrot with a bindsym so I have a keyboard shortcut to take screenshots

This command works when run as a one-liner or as a bash .sh:


<span style="color:#323232;">save_dir="/home/dork/apache/drkt.eu/subdomains/u/";
</span><span style="color:#323232;">random_name=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1).png;
</span><span style="color:#323232;">scrot -s "$save_dir/$random_name";
</span><span style="color:#323232;">echo -n "https://u.drkt.eu/$random_name" | xsel --clipboard
</span>

It does not work when ran by i3 bindsym $mod+Shift+Z exec bash -c save_dir=“/home/dork/apache/drkt.eu/subdomains/u/”; random_name=$(cat /dev/urandom | tr -dc ‘a-zA-Z0-9’ | fold -w 6 | head -n 1).png; scrot -s “$save_dir/$random_name”; echo -n “https://u.drkt.eu/$random_name” | xsel --clipboard

i3 reports an error when the above is run, but not when as a shell script, though neither work. I assume that’s just because bash is eating the error and not reporting it back to i3

This is the error when ran as a one-liner:


<span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x00600000
</span><span style="color:#323232;">ERROR: Received ExposeEvent for unknown window 0x00600000
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x00600000
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x00600007
</span><span style="color:#323232;">ERROR: Received ExposeEvent for unknown window 0x00600007
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x00600007
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x0060000a
</span><span style="color:#323232;">ERROR: Received ExposeEvent for unknown window 0x0060000a
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x0060000a
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x0060000d
</span><span style="color:#323232;">ERROR: Received ExposeEvent for unknown window 0x0060000d
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x0060000d
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x00600010
</span><span style="color:#323232;">ERROR: Received ConfigureNotify for unknown window 0x00600010
</span><span style="color:#323232;">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', 'title_window_icon', 'mode', 'bar', 'gaps'
</span><span style="color:#323232;">ERROR: Your command: exec bash -c save_dir="/home/dork/apache/drkt.eu/subdomains/u/"; random_name=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1).png; scrot -s "$save_dir/$random_name"; echo -n "https://u.drkt.eu/$random_name" | xsel --clipboard
</span><span style="color:#323232;">ERROR:                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</span><span style="color:#323232;">/run/user/1000/i3/errorlog.1235 (END)
</span><span style="color:#323232;">
</span>

I am open to alternatives if there is a better way to do this than the i3 config!

Thank you for reading <3

lemmyreader,

Does inserting --release like this bindsym --release $mod+z exec scrot -s help ?

drkt,
@drkt@lemmy.dbzer0.com avatar

I’m afraid not; it’s the exact same error

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux4noobs@lemmy.world
  • Durango
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • osvaldo12
  • modclub
  • normalnudes
  • provamag3
  • tester
  • anitta
  • Leos
  • megavids
  • lostlight
  • All magazines