Discussion:
[tclug-list] Bash script from fluxbox keys
Clark Andreasen
2015-03-10 04:50:11 UTC
Permalink
Not sure how much introduction is necessary here, but in any event, I've
just set up a debian installation with fluxbox and I've been customizing
things the way I like them, but I 've run into an issue trying to replicate
the features of a program called puush under windows.
Essentially what I've done is taken this
<https://github.com/blha303/puush-linux/blob/master/puush> script (although
I'm using curl with -s, not -#), in combination with scrot and fluxbox to
make Ctrl-Shift-4 allow me to select an area of the screen, and then pass
that to puush for uploading and dump the url to the clipboard with xclip.
I've been trying to run a separate shell script that looks like this:

#!/bin/bash
scrot -s -e 'puush $f' | xclip -selection c

from .fluxbox/keys using a line like this:

Control Shift 13 :exec 'sh /path/to/file.sh'

and after trying many different variations on that, I still can't get it to
work, the hotkey works if I assign a different command to it, and running
said shell script from the terminal works great, but combined, nothing
happens.

Thanks,
Clark A.
Seth Miller
2015-03-10 21:11:47 UTC
Permalink
Clark,

You already have the shebang at the top of your script. You don't need the
sh command.

Control Shift 13 :exec /path/to/file.sh

Seth Miller
Post by Clark Andreasen
Not sure how much introduction is necessary here, but in any event, I've
just set up a debian installation with fluxbox and I've been customizing
things the way I like them, but I 've run into an issue trying to replicate
the features of a program called puush under windows.
Essentially what I've done is taken this
<https://github.com/blha303/puush-linux/blob/master/puush> script
(although I'm using curl with -s, not -#), in combination with scrot and
fluxbox to make Ctrl-Shift-4 allow me to select an area of the screen, and
then pass that to puush for uploading and dump the url to the clipboard
with xclip. I've been trying to run a separate shell script that looks like
#!/bin/bash
scrot -s -e 'puush $f' | xclip -selection c
Control Shift 13 :exec 'sh /path/to/file.sh'
and after trying many different variations on that, I still can't get it
to work, the hotkey works if I assign a different command to it, and
running said shell script from the terminal works great, but combined,
nothing happens.
Thanks,
Clark A.
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Clark Andreasen
2015-03-10 22:33:53 UTC
Permalink
Good to know, however it doesn't seem to work either way...
On a suggestion I also tried checking how it was being run with pstree, and
got this: (.puush is the name of the shell script)

init(1)---login(2887)---bash(3047)---startx(18355)---xinit(18372)---ck-launch-sessi(18378)---fluxbox(18413)---.puush(29126)---pstre+

vs this when run from xterm:

init(1)---login(2887)---bash(3047)---startx(18355)---xinit(18372)---ck-launch-sessi(18378)---fluxbox(18413)---xterm(18972)---bash(18974)---.puush(29187)---pstree(29188)

So I think it's executing fine, but something about scrot or the puush
upload script won't work the way fluxbox handles it, could there be an
issue because it takes too long? It does have to wait for a me to select
the right area, save the screenshot, upload it, and dump the resulting url
to clipboard.

Thanks,
Clark A.
Post by Seth Miller
Clark,
You already have the shebang at the top of your script. You don't need the
sh command.
Control Shift 13 :exec /path/to/file.sh
Seth Miller
On Mon, Mar 9, 2015 at 11:50 PM, Clark Andreasen <
Post by Clark Andreasen
Not sure how much introduction is necessary here, but in any event, I've
just set up a debian installation with fluxbox and I've been customizing
things the way I like them, but I 've run into an issue trying to replicate
the features of a program called puush under windows.
Essentially what I've done is taken this
<https://github.com/blha303/puush-linux/blob/master/puush> script
(although I'm using curl with -s, not -#), in combination with scrot and
fluxbox to make Ctrl-Shift-4 allow me to select an area of the screen, and
then pass that to puush for uploading and dump the url to the clipboard
with xclip. I've been trying to run a separate shell script that looks like
#!/bin/bash
scrot -s -e 'puush $f' | xclip -selection c
Control Shift 13 :exec 'sh /path/to/file.sh'
and after trying many different variations on that, I still can't get it
to work, the hotkey works if I assign a different command to it, and
running said shell script from the terminal works great, but combined,
nothing happens.
Thanks,
Clark A.
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://mailman.mn-linux.org/mailman/listinfo/tclug-list
Loading...