fix swww query (#270)

This commit is contained in:
end-4 2024-03-16 19:52:59 +07:00
parent 9e9a300b01
commit f6e9f4b6dc
3 changed files with 4 additions and 4 deletions

View file

@ -11,7 +11,7 @@ colorstrings=''
colorlist=()
colorvalues=()
# wallpath=$(swww query | awk -F 'image: ' '{print $2}')
# wallpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}')
# wallpath_png="$HOME"'/.cache/ags/user/generated/hypr/lockscreen.png'
# convert "$wallpath" "$wallpath_png"
# wallpath_png=$(echo "$wallpath_png" | sed 's/\//\\\//g')

View file

@ -35,8 +35,8 @@ elif len(sys.argv) > 1 and sys.argv[1] == '--color':
else:
# try:
# imagePath = subprocess.check_output("ags run-js 'wallpaper.get(0)'", shell=True)
imagePath = subprocess.check_output("swww query | awk -F 'image: ' '{print $2}'", shell=True)
imagePath = imagePath[:-1].decode("utf-8")
imagePath = subprocess.check_output("swww query | head -1 | awk -F 'image: ' '{print $2}'", shell=True)
imagePath = imagePath[:-1].decode("utf-8")
img = Image.open(imagePath)
basewidth = 64
wpercent = (basewidth/float(img.size[0]))

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
if [ "$1" == "--noswitch" ]; then
imgpath=$(swww query | awk -F 'image: ' '{print $2}'| head -n 1)
imgpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}')
# imgpath=$(ags run-js 'wallpaper.get(0)')
else
# Select and set image (hyprland)