Skip to content

Commit c756975

Browse files
authored
Merge pull request #16 from cobaltgit/coulomb-dev
Coulomb
2 parents 700cd0e + f11b9fd commit c756975

File tree

235 files changed

+361
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+361
-80
lines changed

Apps/BootLogo/launch.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
#!/bin/sh
22

3+
. /mnt/SDCARD/System/scripts/helpers.sh
4+
35
cd "$(dirname "$0")"
46

57
BOOTLOGO_MAX_BYTES=524288 # 512KiB
68
BOOTLOGO="bootlogo.bmp"
79
LOG_FILE="/mnt/SDCARD/System/log/bootlogo.log"
810

911
if [ $(wc -c <$BOOTLOGO) -gt $BOOTLOGO_MAX_BYTES ]; then
10-
echo "BootLogo: image must not be greater than $BOOTLOGO_MAX_BYTES bytes" > "$LOG_FILE"
12+
echo "BootLogo: must be 512KiB or smaller" >> "$LOG_FILE"
13+
display -d 2000 -t "Boot logo must be 512KiB or smaller. Exiting..."
1114
exit 1
1215
fi
1316

14-
echo "BootLogo: writing $BOOTLOGO" > "$LOG_FILE"
15-
dd if=$BOOTLOGO of=/dev/by-name/bootlogo bs=65536 > "$LOG_FILE" 2>&1
17+
display -t "Updating bootlogo..."
18+
dd if=$BOOTLOGO of=/dev/by-name/bootlogo bs=65536 >> "$LOG_FILE" 2>&1
1619
if [ $? -eq 0 ]; then
17-
echo "BootLogo: replacement success!" > "$LOG_FILE"
20+
display -d 2000 -t "Boot logo update success."
1821
else
19-
echo "BootLogo: replacement failed!" > "$LOG_FILE"
20-
fi
22+
display -d 2000 -t "Boot logo update failed. Check the log for more details."
23+
fi

Apps/EmuClean/launch.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
. /mnt/SDCARD/System/scripts/helpers.sh
66

77
EMU_DIR="/mnt/SDCARD/Emus"
8+
SHOWN_COUNT=0
9+
HIDDEN_COUNT=0
810

911
set_cpuclock --mode performance
1012

13+
display -t "Refreshing displayed emulators..."
14+
1115
for EMU in "$EMU_DIR"/*; do
1216
if [ -d "$EMU" ]; then
1317
EXTENSIONS="$(awk -F ':' '/extlist/ {print $2}' "$EMU/config.json" | sed 's/^[[:space:]]*//; s/[",]//g')" # no jq? no problem. might add it later down the line though
@@ -17,11 +21,15 @@ for EMU in "$EMU_DIR"/*; do
1721
if [ "$ROM_COUNT" -eq 0 ]; then
1822
echo "EmuClean: no roms, hiding $EMU"
1923
sed -i 's/^{*$/{{/' "$EMU/config.json" # break config.json so emulator doesn't show
24+
HIDDEN_COUNT=$((HIDDEN_COUNT + 1))
2025
elif [ "$ROM_COUNT" -gt 0 ]; then
2126
echo "EmuClean: $ROM_COUNT roms detected in system $EMU, showing"
2227
sed -i 's/^{{*$/{/' "$EMU/config.json" # fix config.json to show emulator
28+
SHOWN_COUNT=$((SHOWN_COUNT + 1))
2329
fi
2430
fi
2531
done
2632

33+
display -d 2000 -t "Done! $SHOWN_COUNT systems shown, $HIDDEN_COUNT systems hidden"
34+
2735
set_cpuclock --mode smart # reset cpu clock

Apps/Reboot/bg.png

-5.48 KB
Binary file not shown.

Apps/Reboot/launch.sh

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
#!/bin/sh
2-
echo $0 $*
3-
progdir=`dirname "$0"`
4-
cd $progdir
5-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$progdir
62

7-
echo "=============================================="
8-
echo "================== reboot ==================="
9-
echo "=============================================="
3+
. /mnt/SDCARD/System/scripts/helpers.sh
104

11-
chmod 777 reboot_wait
12-
./reboot_wait&
13-
sleep 1
14-
reboot
5+
display -d 2000 -t "Rebooting your Smart..."
6+
7+
reboot

Apps/Reboot/reboot_wait

-5.41 KB
Binary file not shown.

Apps/SSH/launch.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ SSH_APP_CONFIG="/mnt/SDCARD/Apps/SSH/config.json"
99
IP="$(ip addr show wlan0 | awk '/inet[^6]/ {split($2, a, "/"); print a[1]}')"
1010

1111
if $SSH_ENABLED; then
12+
display -d 1000 -t "Disabling SSH..."
1213
SSH_ENABLED=false
1314
echo -E "$(/mnt/SDCARD/System/bin/jq '.description = "Turned off"' "$SSH_APP_CONFIG")" > "$SSH_APP_CONFIG"
1415
stop_dropbear_process
1516
else
17+
display -d 1000 -t "Enabling SSH..."
1618
SSH_ENABLED=true
1719
if [ -z "$IP" ]; then
1820
DESCRIPTION="Not connected"
@@ -23,4 +25,6 @@ else
2325
start_dropbear_process
2426
fi
2527

26-
update_setting "network" "ssh" "$SSH_ENABLED"
28+
update_setting "network" "ssh" "$SSH_ENABLED"
29+
30+
kill_display

Apps/Syncthing/launch.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ SYNCTHING_APP_CONFIG="/mnt/SDCARD/Apps/Syncthing/config.json"
99
IP="$(ip addr show wlan0 | awk '/inet[^6]/ {split($2, a, "/"); print a[1]}')"
1010

1111
if $SYNCTHING_ENABLED; then
12+
display -d 1000 -t "Disabling Syncthing..."
1213
SYNCTHING_ENABLED=false
1314
echo -E "$(/mnt/SDCARD/System/bin/jq '.description = "Turned off"' "$SYNCTHING_APP_CONFIG")" > "$SYNCTHING_APP_CONFIG"
1415
stop_syncthing_process
1516
else
17+
display -d 1000 -t "Enabling Syncthing..."
1618
SYNCTHING_ENABLED=true
1719
if [ -z "$IP" ]; then
1820
DESCRIPTION="Not connected"
@@ -23,4 +25,6 @@ else
2325
start_syncthing_process
2426
fi
2527

26-
update_setting "network" "syncthing" "$SYNCTHING_ENABLED"
28+
update_setting "network" "syncthing" "$SYNCTHING_ENABLED"
29+
30+
kill_display

Apps/WifiFileTransferToggle/launch.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
set -x
4+
35
. /mnt/SDCARD/System/scripts/helpers.sh
46
. /mnt/SDCARD/System/scripts/networkHelpers.sh
57

@@ -9,10 +11,12 @@ DUFS_APP_CONFIG="/mnt/SDCARD/Apps/WifiFileTransferToggle/config.json"
911
IP="$(ip addr show wlan0 | awk '/inet[^6]/ {split($2, a, "/"); print a[1]}')"
1012

1113
if $DUFS_ENABLED; then
14+
display -d 1000 -t "Disabling dufs..."
1215
DUFS_ENABLED=false
1316
echo -E "$(/mnt/SDCARD/System/bin/jq '.description = "Turned off"' "$DUFS_APP_CONFIG")" > "$DUFS_APP_CONFIG"
1417
stop_dufs_process
1518
else
19+
display -d 1000 -t "Enabling dufs..."
1620
DUFS_ENABLED=true
1721
if [ -z "$IP" ]; then
1822
DESCRIPTION="Not connected"
@@ -23,4 +27,6 @@ else
2327
start_dufs_process
2428
fi
2529

26-
update_setting "network" "dufs" "$DUFS_ENABLED"
30+
update_setting "network" "dufs" "$DUFS_ENABLED"
31+
32+
kill_display

Emus/.emu_setup/cpu_switch.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
. /mnt/SDCARD/System/scripts/helpers.sh
4+
35
EMU="$(echo "$1" | cut -d'/' -f5)"
46
CONFIG="/mnt/SDCARD/Emus/${EMU}/config.json"
57
OPT="/mnt/SDCARD/Emus/.emu_setup/opts/${EMU}.opt"
@@ -22,4 +24,6 @@ case "$CPU_MODE" in
2224
esac
2325

2426
sed -i "s|\"CPU:.*\"|\"CPU: $NEW_DISPLAY\"|g" "$CONFIG"
25-
sed -i "s|CPU_MODE=.*|CPU_MODE=\"$NEW_MODE\"|g" "$OPT"
27+
sed -i "s|CPU_MODE=.*|CPU_MODE=\"$NEW_MODE\"|g" "$OPT"
28+
29+
display -d 1000 -t "CPU mode for $EMU set to $NEW_MODE."

Emus/.emu_setup/del_override.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/sh
22

3+
. /mnt/SDCARD/System/scripts/helpers.sh
4+
35
EMU="$(echo "$1" | cut -d'/' -f5)"
46
GAME="$(basename "$1")"
57
OVERRIDE_FILE="/mnt/SDCARD/Emus/.emu_setup/overrides/${EMU}/${GAME}.opt"
68

7-
rm -f "$SYS_OPT" "$OVERRIDE_FILE"
9+
rm -f "$SYS_OPT" "$OVERRIDE_FILE"
10+
11+
display -d 1000 -t "Deleted CPU override for game $GAME"

0 commit comments

Comments
 (0)