Waybar now remembers when it must hide or show after reboot, set-wallpaper and batteryctl patches, changed waybar style once again, plus various minor tweaks

This commit is contained in:
Gu://em_ 2025-01-20 12:53:06 +01:00
parent 806d59b71d
commit 3a293cf0f3
15 changed files with 107 additions and 32 deletions

View file

@ -2,7 +2,7 @@
# Definitions
threshold_config=/sys/class/power_supply/BAT1/charge_control_end_threshold
show_help() {
print_help() {
echo "Usage: ${0} (get|set) [level]"
echo
echo " get Gets the current battery charging limit"
@ -35,6 +35,6 @@ elif [ $# -eq 2 ] && [[ $1 == "set" ]] && [ $2 -le 99 ] && [ $2 -ge 0 ]; then
fi
else
show_help
print_help
fi

View file

@ -1,8 +1,8 @@
#!/bin/sh
if [ $(whoami) != root ]; then
echo "- Please run this script as root"
echo "sudo $0"
echo "Please run this script as root"
echo "-> sudo $0"
echo
sudo $0
exit $?

View file

@ -1,25 +1,53 @@
#!/bin/sh
print_help() {
echo "Usage: $0 [input-file]"
echo
echo "Changes your current wallpaper"
echo "Please note that this script is made to be used with the Atlas Desktop and will probably not work on most other desktops."
}
if [ $# -ne 1 ]; then
print_help
exit 1
fi
# Check if file exists
if [ -e $1 ]; then
if [ -e "$1" ]; then
# Variables declaration
wallpaper_config=~/.config/hypr/hyprpaper.conf
wallpaper_path=~/.config/hypr/images/wallpaper # Doesn't contain file extension
file_extension="${1##*.}"
# In case file has no extension
if [ "${file_extension}" == "$1" ]; then
echo "Error: please provide a file extension (ex: .jpg, .png...)"
exit 1
fi
# Remove old wallpaper
rm $wallpaper_path*
# Copy file
cp $1 "${wallpaper_path}.${file_extension}"
cp "$1" "${wallpaper_path}.${file_extension}"
if [ $? != 0 ]; then
echo "Aborted."
exit 1
fi
# Update config
sed -i "s/wallpaper\.[^[:space:]]*/wallpaper.$file_extension/g" $wallpaper_config # Replace current extension by new extension
if [ $? != 0 ]; then
echo "Aborted."
exit 1
fi
# Reload Hyprpaper
pkill hyprpaper
nohup hyprpaper </dev/null >/dev/null 2>&1 &
hyprctl dispatch exec hyprpaper > /dev/null # Start hyprpaper and hide stdout output
# Or you can do the old fashioned way :
# nohup hyprpaper </dev/null >/dev/null 2>&1 &
echo "Done"
exit 0