I'm trying to control the volume of a nearby music player by sending a command to the server. That is easy enough:
echo "[mac address] mixer volume -10" | nc server 9090
works perfectly from the command line and decreases the volume by 10 points. Likewise, +10 increases the volume. Now I want to assign these commands to key combinations Ctrl + F7 and Ctrl + F8, respectively. I open up the System Settings/Keyboard panel and enter two custom key combinations. However, these don't work: nothing happens when I press the keys.
I tried adding full paths to echo
(/bin/echo
) and nc
(/bin/nc
); then I tried redirecting the SYSOUT and SYSERR of the nc
command to some log file, but nothing shows up (but then, nc
is not supposed to output anything). Finally, I put the string [mac address] mixer volume -10
in a file called .softer
and set the key combination to
/bin/nc server 9090 < /home/jos/.softer
Likewise with .louder
. Still, nothing happens.
What am I doing wrong? Again, all versions of these commands do work and change the volume if issued from the command line.
A possible answer (I usually use it) is to create
.sh
file containing this command then assign abash /path/to/sh-file
command using shortcuts this should solve your problem.