diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-23 21:26:50 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-23 21:26:50 +1100 |
| commit | 790b55cee4fa66e84e59675e496213761ceb4a47 (patch) | |
| tree | 26f053ad81b508229c53be71cea1f2d6c8542788 | |
| parent | install: better link install (diff) | |
| download | caelestia-cli-790b55cee4fa66e84e59675e496213761ceb4a47.tar.gz caelestia-cli-790b55cee4fa66e84e59675e496213761ceb4a47.tar.bz2 caelestia-cli-790b55cee4fa66e84e59675e496213761ceb4a47.zip | |
wallpaper: use test
Use test instead of [ ]
| -rwxr-xr-x | wallpaper.fish | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wallpaper.fish b/wallpaper.fish index b21f87f..4eb8769 100755 --- a/wallpaper.fish +++ b/wallpaper.fish @@ -50,9 +50,9 @@ else end # Set last wallpaper if not same as given - if [ -f "$last_wallpaper_path" ] + if test -f "$last_wallpaper_path" set last_wallpaper (cat $last_wallpaper_path) - [ -z "$last_wallpaper" -o "$last_wallpaper" = "$chosen_wallpaper" ] && set -e last_wallpaper + test -z "$last_wallpaper" -o "$last_wallpaper" = "$chosen_wallpaper" && set -e last_wallpaper end else # The path to the directory containing the selection of wallpapers @@ -64,9 +64,9 @@ else end # Get all files in $wallpapers_dir and exclude the last wallpaper (if it exists) - if [ -f "$last_wallpaper_path" ] + if test -f "$last_wallpaper_path" set last_wallpaper (cat $last_wallpaper_path) - [ -n "$last_wallpaper" ] && set unfiltered_wallpapers (get-valid-wallpapers | grep -v $last_wallpaper) + test -n "$last_wallpaper" && set unfiltered_wallpapers (get-valid-wallpapers | grep -v $last_wallpaper) end set -q unfiltered_wallpapers || set unfiltered_wallpapers (get-valid-wallpapers) @@ -85,14 +85,14 @@ else # Add wallpapers that are larger than the screen size * threshold to list to choose from ($wallpapers) for i in (seq 1 (count $wall_sizes)) set -l wall_size (string split ' ' $wall_sizes[$i]) - if [ $wall_size[1] -ge $screen_size[1] -a $wall_size[2] -ge $screen_size[2] ] + if test $wall_size[1] -ge $screen_size[1] -a $wall_size[2] -ge $screen_size[2] set -a wallpapers $unfiltered_wallpapers[$i] end end end # Check if the $wallpapers list is unset or empty - if ! set -q wallpapers || [ -z "$wallpapers" ] + if ! set -q wallpapers || test -z "$wallpapers" error "No valid images found in $wallpapers_dir" exit 1 end |