|
7 | 7 |
|
8 | 8 |
|
9 | 9 | # 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" |
11 | 11 |
|
12 | 12 | # Place scripts here to be called when using the function switch. |
13 | 13 | # Switch up (off) = sends a 0 as the first argument to the script. |
@@ -76,30 +76,42 @@ init_tmp_dirs() { |
76 | 76 |
|
77 | 77 | update_scripts_to_run() { |
78 | 78 |
|
| 79 | + log_message "Updating fnkey and switch scripts" |
| 80 | + |
79 | 81 | # Clean out remnant scripts |
80 | 82 | rm -f "$SWITCH_DIR"/* 2>/dev/null |
81 | 83 | rm -f "$BUTTON_DIR"/* 2>/dev/null |
82 | 84 |
|
83 | 85 | switch_val="$(get_switch_val)" |
84 | 86 | fn1_val="$(get_fn1_val)" |
85 | 87 | fn2_val="$(get_fn2_val)" |
| 88 | + log_message "s: $switch_val ; f1: $fn1_val ; f2: $fn2_val" |
| 89 | + |
86 | 90 |
|
87 | 91 | set -- |
88 | 92 | scripts="$(get_scripts_from_menu_description "$fn1_val")" |
89 | 93 | set -- $scripts |
90 | 94 | fn1_press="$1" |
91 | 95 | fn1_release="$2" |
92 | 96 |
|
| 97 | + log_message "f1 press script: $fn1_press" |
| 98 | + log_message "f1 release script: $fn1_release" |
| 99 | + |
93 | 100 | set -- |
94 | 101 | scripts="$(get_scripts_from_menu_description "$fn2_val")" |
95 | 102 | set -- $scripts |
96 | 103 | fn2_press="$1" |
97 | 104 | fn2_release="$2" |
98 | 105 |
|
| 106 | + log_message "f2 press script: $fn2_press" |
| 107 | + log_message "f2 release script: $fn2_release" |
| 108 | + |
99 | 109 | set -- |
100 | 110 | set -- $(get_scripts_from_menu_description "$switch_val") |
101 | 111 | switch_script="$1" |
102 | 112 |
|
| 113 | + log_message "switch toggle script: $switch_script" |
| 114 | + |
103 | 115 | if [ -n "$switch_script" ] && [ -f "$SPRUCE_FN_DIR/switch/$switch_script" ]; then |
104 | 116 | cp -f "$SPRUCE_FN_DIR/switch/$switch_script" "$SWITCH_DIR"/ |
105 | 117 | fi |
@@ -144,6 +156,7 @@ monitor_for_config_changes() { |
144 | 156 | values_differ "$prev_fn2" "$next_fn2" || \ |
145 | 157 | values_differ "$prev_switch" "$next_switch" |
146 | 158 | then |
| 159 | + log_message "One of the fn settings has changed." |
147 | 160 | update_scripts_to_run |
148 | 161 | prev_fn1="$next_fn1" |
149 | 162 | prev_fn2="$next_fn2" |
|
0 commit comments