Splitted hyprland config file to make config easier, created some more scripts to manage lockscreen wallpaper and battery charging limit, changed waybar appearance (testing) and added some aliases (galaxy book specific)
This commit is contained in:
parent
1965d9cf0a
commit
e722ac37d1
16 changed files with 419 additions and 344 deletions
40
.local/bin/batteryctl
Executable file
40
.local/bin/batteryctl
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Definitions
|
||||
threshold_config=/sys/class/power_supply/BAT1/charge_control_end_threshold
|
||||
show_help() {
|
||||
echo "Usage: ${0} (get|set) [level]"
|
||||
echo
|
||||
echo " get Gets the current battery charging limit"
|
||||
echo " set Sets the current battery charging limit to the provided level"
|
||||
echo
|
||||
echo "Please note that this script is made for Samsung Galaxy Book Computers and only works with Galaxy Book Extras module loaded and enabled."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if file is present
|
||||
if ! ([ -e $threshold_config ]); then
|
||||
echo "Couldn't find '${threshold_config}': No such file or directory"
|
||||
echo "Please ensure the concerned module is loaded correctly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check parameters
|
||||
# get
|
||||
if [ $# -eq 1 ] && [[ $1 == "get" ]]; then
|
||||
cat $threshold_config
|
||||
|
||||
# set (check level option)
|
||||
elif [ $# -eq 2 ] && [[ $1 == "set" ]] && [ $2 -le 99 ] && [ $2 -ge 0 ]; then
|
||||
echo $2 | sudo tee $threshold_config
|
||||
if [ $? == 0 ]; then
|
||||
echo "Done"
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
show_help
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue