Skip to content

Commit 014047c

Browse files
committed
gotchu stupid bug
1 parent 0443c5c commit 014047c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

spruce/scripts/platform/device_functions/utils/trimui-fn/fn_setting_watchdog.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
# we stow all our function scripts in $SPRUCE_FN_DIR/switch and $SPRUCE_FN_DIR/button.
10-
SPRUCE_FN_DIR="/mnt/SDCARD/spruce/platform/device_functions/utils/trimui-fn"
10+
SPRUCE_FN_DIR="/mnt/SDCARD/spruce/scripts/platform/device_functions/utils/trimui-fn"
1111

1212
# Place scripts here to be called when using the function switch.
1313
# Switch up (off) = sends a 0 as the first argument to the script.
@@ -76,30 +76,42 @@ init_tmp_dirs() {
7676

7777
update_scripts_to_run() {
7878

79+
log_message "Updating fnkey and switch scripts"
80+
7981
# Clean out remnant scripts
8082
rm -f "$SWITCH_DIR"/* 2>/dev/null
8183
rm -f "$BUTTON_DIR"/* 2>/dev/null
8284

8385
switch_val="$(get_switch_val)"
8486
fn1_val="$(get_fn1_val)"
8587
fn2_val="$(get_fn2_val)"
88+
log_message "s: $switch_val ; f1: $fn1_val ; f2: $fn2_val"
89+
8690

8791
set --
8892
scripts="$(get_scripts_from_menu_description "$fn1_val")"
8993
set -- $scripts
9094
fn1_press="$1"
9195
fn1_release="$2"
9296

97+
log_message "f1 press script: $fn1_press"
98+
log_message "f1 release script: $fn1_release"
99+
93100
set --
94101
scripts="$(get_scripts_from_menu_description "$fn2_val")"
95102
set -- $scripts
96103
fn2_press="$1"
97104
fn2_release="$2"
98105

106+
log_message "f2 press script: $fn2_press"
107+
log_message "f2 release script: $fn2_release"
108+
99109
set --
100110
set -- $(get_scripts_from_menu_description "$switch_val")
101111
switch_script="$1"
102112

113+
log_message "switch toggle script: $switch_script"
114+
103115
if [ -n "$switch_script" ] && [ -f "$SPRUCE_FN_DIR/switch/$switch_script" ]; then
104116
cp -f "$SPRUCE_FN_DIR/switch/$switch_script" "$SWITCH_DIR"/
105117
fi
@@ -144,6 +156,7 @@ monitor_for_config_changes() {
144156
values_differ "$prev_fn2" "$next_fn2" || \
145157
values_differ "$prev_switch" "$next_switch"
146158
then
159+
log_message "One of the fn settings has changed."
147160
update_scripts_to_run
148161
prev_fn1="$next_fn1"
149162
prev_fn2="$next_fn2"

0 commit comments

Comments
 (0)