From f2d85486ef46692151091c00a4d655c789f6fbba Mon Sep 17 00:00:00 2001 From: MoetaYuko Date: Wed, 1 May 2024 20:16:42 +0800 Subject: [PATCH] switchwall: fix transition position for hidpi and multi-monitor --- .config/ags/scripts/color_generation/switchwall.sh | 6 ++++-- scriptdata/dependencies.conf | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/ags/scripts/color_generation/switchwall.sh b/.config/ags/scripts/color_generation/switchwall.sh index 6f7bee64..6ed03eb9 100755 --- a/.config/ags/scripts/color_generation/switchwall.sh +++ b/.config/ags/scripts/color_generation/switchwall.sh @@ -5,11 +5,13 @@ if [ "$1" == "--noswitch" ]; then # imgpath=$(ags run-js 'wallpaper.get(0)') else # Select and set image (hyprland) - cd "$HOME/Pictures" + cd "$(xdg-user-dir PICTURES)" imgpath=$(yad --width 1200 --height 800 --file --title='Choose wallpaper' --add-preview --large-preview) - screensizey=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2 | head -1) + read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs) cursorposx=$(hyprctl cursorpos -j | gojq '.x' 2>/dev/null) || cursorposx=960 + cursorposx=$(bc <<< "scale=0; ($cursorposx - $screenx) * $scale / 1") cursorposy=$(hyprctl cursorpos -j | gojq '.y' 2>/dev/null) || cursorposy=540 + cursorposy=$(bc <<< "scale=0; ($cursorposy - $screeny) * $scale / 1") cursorposy_inverted=$(( screensizey - cursorposy )) if [ "$imgpath" == '' ]; then diff --git a/scriptdata/dependencies.conf b/scriptdata/dependencies.conf index a117b76c..dd396e13 100644 --- a/scriptdata/dependencies.conf +++ b/scriptdata/dependencies.conf @@ -16,7 +16,6 @@ tinyxml2 gtkmm3 gtksourceviewmm cairomm python-build python-pillow python-pywal python-setuptools-scm python-wheel ### Basic graphic env -xorg-xrandr xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-hyprland-git ### Player and Audio