From f6e9f4b6dc0d9bb3fbb160fe6dcadcb710d7f0d3 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 16 Mar 2024 19:52:59 +0700 Subject: [PATCH] fix swww query (#270) --- .config/ags/scripts/color_generation/applycolor.sh | 2 +- .../ags/scripts/color_generation/generate_colors_material.py | 4 ++-- .config/ags/scripts/color_generation/switchwall.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/ags/scripts/color_generation/applycolor.sh b/.config/ags/scripts/color_generation/applycolor.sh index 7fab4e18..a8e41e9d 100755 --- a/.config/ags/scripts/color_generation/applycolor.sh +++ b/.config/ags/scripts/color_generation/applycolor.sh @@ -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') diff --git a/.config/ags/scripts/color_generation/generate_colors_material.py b/.config/ags/scripts/color_generation/generate_colors_material.py index deb34bf8..86c6d9d1 100755 --- a/.config/ags/scripts/color_generation/generate_colors_material.py +++ b/.config/ags/scripts/color_generation/generate_colors_material.py @@ -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])) diff --git a/.config/ags/scripts/color_generation/switchwall.sh b/.config/ags/scripts/color_generation/switchwall.sh index 05a9fe54..fe4bca97 100755 --- a/.config/ags/scripts/color_generation/switchwall.sh +++ b/.config/ags/scripts/color_generation/switchwall.sh @@ -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)