summaryrefslogtreecommitdiff
path: root/script/uactivity/activity/-20-switch_tv
diff options
context:
space:
mode:
Diffstat (limited to 'script/uactivity/activity/-20-switch_tv')
-rw-r--r--script/uactivity/activity/-20-switch_tv23
1 files changed, 20 insertions, 3 deletions
diff --git a/script/uactivity/activity/-20-switch_tv b/script/uactivity/activity/-20-switch_tv
index f014e6f..7059e1f 100644
--- a/script/uactivity/activity/-20-switch_tv
+++ b/script/uactivity/activity/-20-switch_tv
@@ -1,7 +1,24 @@
#!/bin/sh
-([ "${2}" = "true" ] && [ "${1}" != "shutdown" ]) \
- && irsend -d /var/run/lirc/ya_usbir SEND_ONCE TP av \
- || irsend -d /var/run/lirc/ya_usbir SEND_ONCE TP off
+switch_tv(){
+ [ "${1}" = "on" ] && irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_REMOTE on
+ [ "${1}" = "off" ] && irsend -d /var/run/lirc/ya_usbir SEND_ONCE TV_REMOTE off
+}
+
+
+case "${1}" in
+ startup)
+ true
+ ;;
+ started)
+ [ "${2}" = "true" ] && switch_tv on
+ ;;
+ shutdown)
+ switch_tv off
+ ;;
+ running)
+ [ "${2}" = "true" ] && switch_tv on || switch_tv off
+ ;;
+esac
exit 0