forked from Shinonome/dots-hyprland
user-friendly wallpaper; some fixes
This commit is contained in:
@@ -34,7 +34,7 @@ elif len(sys.argv) > 1 and sys.argv[1] == '--color':
|
||||
newtheme = themeFromSourceColor(argbFromHex(colorstr))
|
||||
else:
|
||||
# try:
|
||||
imagePath = subprocess.check_output("swww query | awk -F 'image: ' '{print $2}'", shell=True)
|
||||
imagePath = subprocess.check_output("ags run-js 'wallpaper.get(0)'", shell=True)
|
||||
imagePath = imagePath[:-1].decode("utf-8")
|
||||
img = Image.open(imagePath)
|
||||
basewidth = 64
|
||||
|
||||
@@ -1,28 +1,18 @@
|
||||
#!/usr/bin/bash
|
||||
# Switches swww wallpaper
|
||||
# Requires: coreutils, xrandr, hyprland
|
||||
|
||||
if [ "$1" == "--noswitch" ]; then
|
||||
imgpath=$(swww query | awk -F 'image: ' '{print $2}')
|
||||
imgpath=$(ags run-js 'wallpaper.get(0)')
|
||||
else
|
||||
# Select and set image (hyprland)
|
||||
cd "$HOME/Pictures"
|
||||
imgpath=$(yad --width 1200 --height 800 --file --title='Choose wallpaper')
|
||||
screensizey=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2 | head -1)
|
||||
cursorposx=$(hyprctl cursorpos -j | gojq '.x')
|
||||
cursorposy=$(hyprctl cursorpos -j | gojq '.y')
|
||||
cursorposy_inverted=$(( screensizey - cursorposy ))
|
||||
|
||||
if [ "$imgpath" == '' ]; then
|
||||
echo 'Aborted'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo Sending "$imgpath" to swww. Cursor pos: ["$cursorposx, $cursorposy_inverted"]
|
||||
# Change swww wallpaper
|
||||
swww img "$imgpath" --transition-step 100 --transition-fps 60 \
|
||||
--transition-type grow --transition-angle 30 --transition-duration 1 \
|
||||
--transition-pos "$cursorposx, $cursorposy_inverted"
|
||||
ags run-js "wallpaper.set('${imgpath}')"
|
||||
fi
|
||||
|
||||
# Generate colors for ags n stuff
|
||||
|
||||
Reference in New Issue
Block a user