made wallpaper settable with xdg config
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||
|
||||
# Folder with full-size wallpapers
|
||||
WALLPAPER_DIR=$("$SCRIPT_DIR/../../scripts/wallpaper_dir.sh")
|
||||
if [ -z "$WALLPAPER_DIR" ]; then
|
||||
echo "Failed to determine wallpaper directory. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Path to the image is the first argument
|
||||
IMAGE="$1"
|
||||
image_name=$(basename "$IMAGE")
|
||||
image="$HOME/Pictures/Wallpapers/$image_name"
|
||||
image="$WALLPAPER_DIR/$image_name"
|
||||
|
||||
echo "start"
|
||||
|
||||
@@ -45,6 +54,7 @@ elif [ -x "/usr/bin/hyprpaper" ]; then
|
||||
sed -i "3s|path = .*|path = ${image}|" ~/.config/hypr/hyprpaper.conf
|
||||
|
||||
hyprctl monitors -j | jq -r 'sort_by(.id) | .[].name' | while IFS= read -r display; do
|
||||
echo "hyprctl hyprpaper wallpaper $display, $image"
|
||||
hyprctl hyprpaper wallpaper "$display, $image"
|
||||
done
|
||||
fi
|
||||
@@ -74,9 +84,9 @@ if [ -x "/usr/bin/sddm" ]; then
|
||||
else
|
||||
cp $image $blurred_wp
|
||||
fi
|
||||
if [ -x "/usr/bin/sddm" ] && [ -d "/usr/share/backgrounds" ]; then
|
||||
sddm_background="/usr/share/backgrounds/background.jpg"
|
||||
cp "$image" "$sddm_background"
|
||||
fi
|
||||
# if [ -x "/usr/bin/sddm" ] && [ -d "/usr/share/backgrounds" ]; then
|
||||
# sddm_background="/usr/share/backgrounds/background.jpg"
|
||||
# cp "$image" "$sddm_background"
|
||||
# fi
|
||||
|
||||
echo "test"
|
||||
|
||||
Reference in New Issue
Block a user