This commit is contained in:
2024-12-13 01:01:50 -07:00
parent 0a0a444a2d
commit 2600016096
24 changed files with 330 additions and 139 deletions

View File

@@ -4,18 +4,22 @@ if [ -f "$HOME/.profile" ]; then
source "$HOME/.profile"
fi
# Note: In the future, when multi-monitor support is added, the monitor offset could be retrieved from xrandr
# here and fed into feh using --geometry
monitor=($(xrandr | grep " connected" | head -n 1 | awk '{ split($4, a, /[+x]/); print $1 " " a[1] " " a[2]; }'))
monitor=($(xrandr | awk -v name="$1" '$1 == name && $2 == "connected" {
for(i=1;i<=NF;i++) {
if($i ~ /[0-9]+x[0-9]+\+[0-9]+\+[0-9]+/) {
split($i, a, /[+x]/); print $1 " " a[1] " " a[2]; exit
}
}
}'))
monitor_name="${monitor[0]}"
monitor_width="${monitor[1]}"
monitor_height="${monitor[2]}"
prop="/backdrop/screen0/monitor${monitor_name}/workspace0/last-image"
path="$1"
path="$2"
wallpaper_dir="$HOME/.local/share/le_wallpaper"
wallpaper_path="${wallpaper_dir}/wallpaper.png"
wallpaper_store="${wallpaper_dir}/source_path"
wallpaper_path="${wallpaper_dir}/${monitor_name}.png"
wallpaper_store="${wallpaper_dir}/${monitor_name}_path"
mkdir -p "$wallpaper_dir"
@@ -55,4 +59,5 @@ shchemes create_theme imagemagick \
echo "Setting wallpaper: $path"
xfconf-query -c xfce4-desktop -p "$prop" -s "$wallpaper_path"
echo "$path" > "$wallpaper_store"
feh --bg-center "$wallpaper_path"
le-wallpaper-open