Added a .scripts dir and an autostart_desktop.sh script to replace dex

This commit is contained in:
Jaden Provost Maxwell-Comfort
2024-01-08 13:51:15 -08:00
parent 2470afaefc
commit 716b4fb7d6
3 changed files with 9 additions and 3 deletions

6
.scripts/autostart_desktop.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
for file in $HOME/.config/autostart/*; do
exec_line=$(cat "$file" | grep '^Exec' | cut -d '=' -f2-)
eval "$exec_line"
done

22
.scripts/brightness.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
if [[ $# != 1 ]]; then
echo "Usage: $0 <brightness percentage>"
echo "Example: $0 5 # Increase brighness by 5%"
echo "Example: $0 -5 # Decrease brighness by 5%"
exit 1
fi
file_root="/sys/class/backlight/$(ls /sys/class/backlight | head -n 1)"
max=$(cat "$file_root/max_brightness")
current=$(cat "$file_root/actual_brightness")
new=$(($current + ($max / 100 * $1)))
if [ "$new" -ge "$max" ]; then
echo "$max" > $file_root/brightness
elif [ "$new" -le "0" ]; then
echo "0" > $file_root/brightness
else
echo "$new" > $file_root/brightness
fi