From 41ef9361be1f7d7a64923cf524a4974f13eab1d0 Mon Sep 17 00:00:00 2001 From: sydarn Date: Wed, 10 Jan 2024 18:53:51 +0100 Subject: [PATCH] jslisten: control volume and brightness virtually with btn and d-pad --- .../tools/jslisten/config/jslisten_hotkeys | 3 ++- .../tools/jslisten/config/jslisten_profile | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/tools/jslisten/config/jslisten_hotkeys b/packages/tools/jslisten/config/jslisten_hotkeys index 5f686c589..19960e289 100644 --- a/packages/tools/jslisten/config/jslisten_hotkeys +++ b/packages/tools/jslisten/config/jslisten_hotkeys @@ -21,4 +21,5 @@ BTN_QUIT_HOTKEY=${DEVICE_BTN_SELECT} BTN_QUIT_SELECT=${DEVICE_BTN_START} BTN_KILL_HOTKEY=${DEVICE_BTN_TL} BTN_KILL_SELECTA=${DEVICE_BTN_SELECT} -BTN_KILL_SELECTB=${DEVICE_BTN_START} \ No newline at end of file +BTN_KILL_SELECTB=${DEVICE_BTN_START} +BTN_VOLBRIGHT_HOTKEY=${DEVICE_BTN_SELECT} diff --git a/packages/tools/jslisten/config/jslisten_profile b/packages/tools/jslisten/config/jslisten_profile index 2d488c3aa..a24feed7d 100644 --- a/packages/tools/jslisten/config/jslisten_profile +++ b/packages/tools/jslisten/config/jslisten_profile @@ -13,6 +13,28 @@ else source /usr/config/jslisten_hotkeys fi +read -d '\n' GLOBAL << EOF +[IncrVol] +program="/usr/bin/volume up" +button1="${BTN_VOLBRIGHT_HOTKEY}" +button2="${DEVICE_BTN_DPAD_RIGHT}" + +[DecrVol] +program="/usr/bin/volume down" +button1="${BTN_VOLBRIGHT_HOTKEY}" +button2="${DEVICE_BTN_DPAD_LEFT}" + +[IncrBright] +program="/usr/bin/brightness up" +button1="${BTN_VOLBRIGHT_HOTKEY}" +button2="${DEVICE_BTN_DPAD_UP}" + +[DecrBright] +program="/usr/bin/brightness down" +button1="${BTN_VOLBRIGHT_HOTKEY}" +button2="${DEVICE_BTN_DPAD_DOWN}" +EOF + jslisten() { JSLISTENCONF="/storage/.config/system/configs/jslisten.cfg" if [ "$1" == "set" ] @@ -71,6 +93,7 @@ button1=${BTN_KILL_HOTKEY} button2=${BTN_KILL_SELECTA} button3=${BTN_KILL_SELECTB} +$(echo "$GLOBAL") EOF systemctl start jslisten elif [ "$1" == "stop" ]