Replaced set-lockscreen by the new version of set-wallpaper (modified), and many more but not that significant changes

This commit is contained in:
Gu://em_ 2025-02-09 21:07:10 +01:00
parent 3a293cf0f3
commit 6e4c3bb974
14 changed files with 70 additions and 18 deletions

View file

@ -6,7 +6,7 @@ print_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 " set Sets the current battery charging limit to the provided level (set to 0 to disable battery charging limit)"
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

13
.local/bin/rust-quick-run.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
# Compiles and run a single rust file while keeping a clean directory
if [ ! -e "$1" ]; then
echo "'$1': No such file or directory"
else
rustc $1 -o a.out
if [ $? == 0 ]; then
./a.out
rm a.out
fi
fi

View file

@ -1,22 +1,50 @@
#!/bin/sh
# Actually just a modified version of the set-wallpaper script, explaining some potential inconsistencies in variables naming or whatever else.
print_help() {
echo "Usage: $0 [input-file]"
echo
echo "Changes your current lockscreen 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/hyprlock.conf
wallpaper_path=~/.config/hypr/images/lockscreen # 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/lockscreen\.[^[:space:]]*/lockscreen.$file_extension/g" $wallpaper_config # Replace current extension by new extension
if [ $? != 0 ]; then
echo "Aborted."
exit 1
fi
echo "Done"
exit 0
else