Hi everybody,
I'm trying to integrate a basic (radio) remote control into my system
for muting and volume change.
I use thd (triggerhappy) and the LMS CLI commands.
Basically, the triggerhappy conf file has this structure:
Code:
--------------------
KEY_NAME 1 command_to_be_executed
--------------------
For example, to mute/unmute the player manually from the command line, I
can use either
Code:
--------------------
echo -e "MyPlayerName mixer muting\nexit\n" | nc localhost 9090
--------------------
or, in a telnet session
Code:
--------------------
MyPlayerName mixer muting
--------------------
However, if I put
Code:
--------------------
echo -e "MyPlayerName mixer muting\nexit\n" | nc localhost 9090
--------------------
into my triggerhappy conf file, the command isn't executed.
As a workaround, I put the commands into individual script files that
are called from my triggerhappy conf file,
for example
Code:
--------------------
#!/bin/bash
telnet localhost 9090 <<EOF
MyPlayerName mixer muting
exit
EOF
--------------------
called from
Code:
--------------------
KEY_MUTE 1 /etc/triggerhappy/triggers.d/mute.sh
--------------------
This works nicely, however, I feel that this is not the elegant way...
Could sb point me to the way to integrate the commands directly into the
triggerhappy conf? I feel that it might have to do with user rights, but
my Linux skills are still insufficient. The triggerhappy conf says:
> # The Triggerhappy daemon (thd) drops its root privileges after
> # startup and becomes "nobody". If you want it to retain its root
> # status (e.g. to run commands only accessible to the system user),
> # uncomment the following line or specifiy the user option yourself:
> #
Thanks for your help!
Martin
PCP (always latest version) on RasPi 3 with PhatDac (player & server)
PCP on several RasPis 2 +3
2 Airplay speakers (Sony SA-NS510) integrated via Airplay Bridge Plugin
------------------------------------------------------------------------
streampunk's Profile: http://forums.slimdevices.com/member.php?userid=66210
View this thread: http://forums.slimdevices.com/showthread.php?t=108852
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix