This post will refer to a GNU/Linux desktop system running Arch and using the JWM window manager. I found a really nice little script at
http://www.thelinuxrain.com/articles...r-translations and am trying to implement it on my system. I installed missing dependencies, copied over the script to my system, then chmod'd it. Testing from the command line reveals that it works as intended. Here is what the script looks like:
Code:
#!/bin/bash
xclip -o | trans -e google -b \
| tee >(yad --geometry=300x800+1550+100 --text-info --wrap) >(xclip -i)
exit 0
However, to make the script operate optimally, I should invoke it using keystrokes. JWM is quite congenial to implementing custom key bindings and I've already set up more than one of these for running some simple little scripts I wrote for my system. Yet, when I try to implement keystrokes to run the script referenced above, I am unable to get it to work (nothing happens when I press the relevant keys). I've tried various permutations and have been over my .jwmrc file many times, but I cannot get it to work and am unable thus far to comprehend why I'm having these problems invoking the script using keystrokes.
In an attempt to do some troubleshooting, I redirected stderr to a file (my current key binding looks as follows:
Code:
<Key mask="4" key="t">exec:trans-paste.sh >>trans-paste_err.txt 2>&1</Key>
) The output written to that file, after having pressed the specified key combination, is
Code:
/path/to/trans-paste.sh: line 4: syntax error near unexpected token `('
/path/to/trans-paste.sh: line 4: `xclip -o | trans -e google -b | tee >(yad --geometry=300x800+1550+100 --text-info --wrap) >(xclip -i) exit 0'
Doing some searches on that error message led me to believe I should escape the parenthesis or quote them. I'm not real bash saavy, but my attempts at trying those sorts of things have not brought resolution. Of course I could well be doing something wrong.
So can anyone here provide any pointers on why I am seeing these results? Perhaps this is something peculiar to the way scripts are interpreted within JWM? Not sure where to turn for diagnosis of this issue, which has proved thus far to exceed my rather paltry technical acumen. TIA