Skip to content

Commit

Permalink
Fix starttab on device change
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevrdid committed Jan 9, 2025
1 parent 7e81bdf commit f3a0d3e
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

source "$(dirname "$0")"/.switcher.sh
source /mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

source "$(dirname "$0")"/.switcher.sh
source /mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

source "$(dirname "$0")"/.switcher.sh
source /mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

source "$(dirname "$0")"/.switcher.sh
source /mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

source "$(dirname "$0")"/.switcher.sh
source /mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

source "$(dirname "$0")"/.switcher.sh
source /mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

source "$(dirname "$0")"/.switcher.sh
source /mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh
5 changes: 4 additions & 1 deletion System/starts/°customization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ if [ -f "/tmp/device_changed" ]; then
sed -i 's/^ScreenHeight =.*$/ScreenHeight = 720' $n64_conf
fi

/mnt/SDCARD/System/usr/trimui/scripts/overlays_switcher.sh
/mnt/SDCARD/System/usr/trimui/scripts/inputd_switcher.sh -s
/mnt/SDCARD/System/usr/trimui/scripts/starttab_switcher.sh -s
/mnt/SDCARD/System/usr/trimui/scripts/overlays_switcher.sh -s


# manage theme differences
themes_dir="/mnt/SDCARD/Themes"
Expand Down
4 changes: 0 additions & 4 deletions System/starts/°post_starts.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
PATH="/mnt/SDCARD/System/bin:$PATH"
export LD_LIBRARY_PATH="/mnt/SDCARD/System/lib:/mnt/SDCARD/System/lib/samba:/mnt/SDCARD/Apps/PortMaster/PortMaster:/usr/trimui/lib:$LD_LIBRARY_PATH"

if [ -f /tmp/device_changed ]; then
/mnt/SDCARD/System/usr/trimui/scripts/inputd_switcher.sh
fi

# Swap A B
SWAP_AB_enabled=$(/mnt/SDCARD/System/bin/jq -r '["SWAP A B"]' "/mnt/SDCARD/System/etc/crossmix.json")
if [ "$SWAP_AB_enabled" -eq 1 ]; then
Expand Down
2 changes: 1 addition & 1 deletion System/usr/trimui/scripts/inputd_switcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ script_name=$(basename "$0" .sh)
if [ "$script_name" = "inputd_switcher" ]; then
polling_rate=$(/mnt/SDCARD/System/bin/jq -r '.["POLLING RATE"]' "/mnt/SDCARD/System/etc/crossmix.json")
else
[ "$1" != "-s" ] && /mnt/SDCARD/System/usr/trimui/scripts/infoscreen.sh -m "Applying $polling_rate polling rate..." -t 1
polling_rate=$script_name
fi

Expand Down Expand Up @@ -64,6 +65,5 @@ jq --arg polling_rate "$polling_rate" '. += {"POLLING RATE": $polling_rate}' "$j
# update database of "System Tools" database
/mnt/SDCARD/System/usr/trimui/scripts/mainui_state_update.sh "POLLING RATE" "$polling_rate"

/mnt/SDCARD/System/usr/trimui/scripts/infoscreen.sh -m "Applying $polling_rate polling rate..." -t 1
pkill trimui_inputd
pkill -KILL MainUI
6 changes: 3 additions & 3 deletions System/usr/trimui/scripts/overlays_switcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ PATH="/mnt/SDCARD/System/bin:$PATH"
LD_LIBRARY_PATH="/mnt/SDCARD/System/lib:/usr/trimui/lib:$LD_LIBRARY_PATH"
script_name="$(basename "$0" .sh)"
if [ "$script_name" = "overlays_switcher" ]; then
script_name=$(/mnt/SDCARD/System/bin/jq -r '.["OVERLAYS"]' "/mnt/SDCARD/System/etc/crossmix.json")
else
[ "$1" != "-s" ] && /mnt/SDCARD/System/usr/trimui/scripts/infoscreen.sh -m "Applying \"$(basename "$0" .sh)\" by default..."
script_name=$(jq -r '.["OVERLAYS"]' "/mnt/SDCARD/System/etc/crossmix.json")
elif [ "$1" != "-s" ]; then
/mnt/SDCARD/System/usr/trimui/scripts/infoscreen.sh -m "Applying \"$(basename "$0" .sh)\" by default..."
fi

ratio=$(echo "${script_name#*- }" | tr ' ' '-')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
PATH="/mnt/SDCARD/System/bin:$PATH"
LD_LIBRARY_PATH="/mnt/SDCARD/System/lib:/usr/trimui/lib:$LD_LIBRARY_PATH"

silent=false
for arg in "$@"; do
if [ "$arg" = "-s" ]; then
silent=true
break
fi
done

script_name=$(basename "$0" .sh)

if [ "$silent" = false ]; then
if [ "$script_name" = starttab_switcher ]; then
script_name=$(jq -r '.["START TAB"]' /mnt/SDCARD/System/etc/crossmix.json);
elif [ "$1" != "-s" ]; then
/mnt/SDCARD/System/usr/trimui/scripts/infoscreen.sh -m "$script_name by default."
fi

Expand Down

0 comments on commit f3a0d3e

Please sign in to comment.