hyprland: Fix swap-bg script for files with spaces

This commit is contained in:
Donovan Glover 2024-04-20 15:33:36 -04:00
parent 65c815d155
commit d87ae2c7de
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -346,12 +346,12 @@ in
text = /* fish */ ''
#!/usr/bin/env fish
set M "$(swww query | choose -1)"
set M1 "$(echo "$M" | head -n 1)"
set M2 "$(echo "$M" | tail -n 1)"
set M "$(swww query | cut -d ':' -f 5)"
set M1 "$(echo "$M" | head -n 1 | awk '{$1=$1};1')"
set M2 "$(echo "$M" | tail -n 1 | awk '{$1=$1};1')"
~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | tail -n 1)" $M1
~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | head -n 1)" $M2
~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | tail -n 1)" "$M1"
~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | head -n 1)" "$M2"
'';
};