From 326b550b2fa4013c121e2080f217841b5faa722a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega=20Froysa?= Date: Fri, 14 Apr 2023 11:57:50 +0200 Subject: [PATCH] setbg: no arguments resets wallpaper Also with some minor improvements of the code. --- setbg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setbg b/setbg index 42300af..a261975 100755 --- a/setbg +++ b/setbg @@ -1,8 +1,12 @@ #!/bin/sh -[ $# -ne 1 ] && - echo "Requires an image argument." && +if [ $# -gt 1 ] +then + echo "Too many arguments" exit 1 +fi + +[ $# -eq 1 ] && + cp $1 $HOME/.local/share/wallpaper.jpg -cp $1 $HOME/.local/share/wallpaper.jpg xwallpaper --zoom $HOME/.local/share/wallpaper.jpg