Skip to content

Commit

Permalink
Beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
hugorosario committed Jan 20, 2025
1 parent 0014d61 commit 200fcca
Show file tree
Hide file tree
Showing 31 changed files with 1,365 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Apps/BrickTools/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label":"Tools",
"icon":"icon.png",
"iconsel":"icon.png",
"launch":"launch.sh",
"description":"Tools and system apps."
}
Binary file added Apps/BrickTools/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Apps/BrickTools/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Apps/BrickTools/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

SCRIPTDIR=$(realpath "$(dirname $0)")

# Copy jq command to the system if it doesn't exist
if [ ! -f /mnt/SDCARD/System/bin/jq ]; then
mkdir -p /mnt/SDCARD/System/bin
cp $SCRIPTDIR/bin/jq /mnt/SDCARD/System/bin
chmod +x /mnt/SDCARD/System/bin/jq
fi
5 changes: 5 additions & 0 deletions Apps/BrickTools/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

progdir=$(dirname "$0")
cd $progdir
./trimuitools
210 changes: 210 additions & 0 deletions Apps/BrickTools/menu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
[
{
"label": "Utilities",
"type": "menu",
"description": "Some useful tools",
"menu": [
{
"label": "Sort favorites",
"description": "Sort the favorites list alphabetically",
"type": "cmd",
"execute": "./scripts/sortfavorites.sh",
"output": "line"
},
{
"label": "Reboot",
"description": "Reboot the system",
"type": "cmd",
"execute": "./scripts/reboot.sh",
"output": "line"
}
]
},
{
"label": "Network",
"type": "menu",
"description": "Network related tools and settings",
"menu": [
{
"label": "IP Address",
"description": "{{ip_address}}",
"type": "cmd",
"execute": "./scripts/ip.sh",
"output": "line",
"load": "./scripts/ip.sh"
},
{
"label": "SFTPGo Server",
"description": "{{listening}}",
"type": "toggle",
"execute": "./scripts/sftpgo.sh",
"output": "line",
"load": "./scripts/sftpgo.sh check"
},
{
"label": "SSH Server",
"description": "{{listening}}",
"type": "toggle",
"execute": "./scripts/sshd.sh",
"output": "line",
"load": "./scripts/sshd.sh check"
},
{
"label": "Syncthing",
"description": "{{listening}}",
"type": "toggle",
"execute": "./scripts/syncthing.sh",
"output": "line",
"load": "./scripts/syncthing.sh check"
}
]
},
{
"label": "User Interface",
"type": "menu",
"description": "User Interface related tools and settings",
"menu": [
{
"label": "Start Tab",
"description": "Set the start tab of the UI",
"type": "select",
"execute": "./scripts/tabs.sh",
"output": "none",
"load": "./scripts/tabs.sh check",
"items": [
"Favorites",
"Recent",
"Best",
"Games",
"Apps",
"Netplay",
"Settings"
]
},
{
"label": "Top-Left Logo",
"description": "Enable/Disable the top-left logo",
"type": "toggle",
"execute": "./scripts/toplogo.sh",
"output": "none",
"load": "./scripts/toplogo.sh check"
},
{
"label": "Click sound",
"description": "Enable/Disable click sound",
"type": "toggle",
"execute": "./scripts/soundclick.sh",
"output": "none",
"load": "./scripts/soundclick.sh check"
},
{
"label": "Background music",
"description": "Enable/Disable background music",
"type": "toggle",
"execute": "./scripts/soundmusic.sh",
"output": "none",
"load": "./scripts/soundmusic.sh check"
}
]
},
{
"label": "LED Control",
"type": "menu",
"description": "Set LED control options",
"menu": [
{
"label": "LED Mode",
"description": "Set the LED mode",
"type": "select",
"items": [
"Default",
"Battery level",
"CPU speed",
"Temperature",
"Effect"
],
"execute": "./scripts/ledmode.sh",
"output": "none",
"load": "./scripts/ledmode.sh check"
},
{
"label": "LED effect",
"description": "Set the LED effect",
"type": "select",
"items": [
"Disable",
"Linear",
"Breath",
"Sniff",
"Static",
"Blink 1",
"Blink 2",
"Blink 3"
],
"execute": "./scripts/ledeffect.sh",
"output": "none",
"load": "./scripts/ledeffect.sh check"
},
{
"label": "LED effect delay",
"description": "Set the LED effect delay (seconds)",
"type": "select",
"items": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
],
"execute": "./scripts/leddelay.sh",
"output": "none",
"load": "./scripts/leddelay.sh check"
},
{
"label": "LED effect color",
"description": "Set the LED effect color",
"type": "select",
"items": [
"Red",
"Green",
"Blue",
"Yellow",
"Purple",
"Cyan",
"White"
],
"execute": "./scripts/ledcolor.sh",
"output": "none",
"load": "./scripts/ledcolor.sh check"
}
]
},
{
"label": "System",
"type": "menu",
"description": "System related tools and settings",
"menu": [
{
"label": "Switch F1/F2 buttons",
"description": "Switch the F1/F2 buttons with Select/Start",
"type": "toggle",
"execute": "./scripts/switchf1f2.sh",
"output": "line",
"load": "./scripts/switchf1f2.sh check"
},
{
"label": "Max CPU Frequency",
"description": "Set the maximum CPU frequency permanently.",
"type": "toggle",
"execute": "./scripts/cpumax.sh",
"output": "none",
"load": "./scripts/cpumax.sh check"
}
]
}
]
Binary file added Apps/BrickTools/scripts/bin/jq
Binary file not shown.
Binary file added Apps/BrickTools/scripts/bin/syncthing
Binary file not shown.
Binary file added Apps/BrickTools/scripts/bin/trimui_inputd
Binary file not shown.
33 changes: 33 additions & 0 deletions Apps/BrickTools/scripts/cpumax.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

ACTION=$1

SCRIPTDIR=$(dirname $0)
BOOTFILE="/mnt/SDCARD/System/starts/cpumax_boot.sh"

mkdir -p /mnt/SDCARD/System/starts

if [ "$ACTION" == "check" ]; then
if [ -f $BOOTFILE ]; then
echo "{{state=1}}"
else
echo "{{state=0}}"
fi
exit 0
fi

if [ "$ACTION" == "1" ]; then
pkill -f $BOOTFILE
rm -f $BOOTFILE
cp $SCRIPTDIR/cpumax_boot.sh $BOOTFILE
chmod +x $BOOTFILE
$BOOTFILE > /dev/null &
exit 0
fi

if [ "$ACTION" == "0" ]; then
pkill -f $BOOTFILE
rm -f $BOOTFILE
exit 0
fi

16 changes: 16 additions & 0 deletions Apps/BrickTools/scripts/cpumax_boot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

while true; do

echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo "Set CPU governor to performance."
for CPU in /sys/devices/system/cpu/cpu[0-3]; do
# Set minimum frequency
echo -n "2000000" > "$CPU"/cpufreq/scaling_min_freq
echo "Set minimum CPU frequency to 2000000 for $CPU."

echo -n "2000000" > "$CPU"/cpufreq/scaling_max_freq
echo "Set maximum CPU frequency to 2000000 for $CPU."
done
sleep 3
done
16 changes: 16 additions & 0 deletions Apps/BrickTools/scripts/ip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# This script will display the current IP address

echo "Checking network connection..."
IP=$(ip route get 1 2>/dev/null | awk '{print $NF;exit}')

#if empty, show an error message
if [ -z "$IP" ]; then
echo "Unable to get IP address.\nPlease check your network connection."
fi

#display the IP address in tag format for updating app labels
echo "{{ip_address=$IP}}"
echo "Current IP address\n$IP"

exit 0
Loading

0 comments on commit 200fcca

Please sign in to comment.