From f1cad2f3cd24c095bfb04b51bc0da54a74a33fcd Mon Sep 17 00:00:00 2001 From: NAME Date: Sat, 18 Jun 2022 15:15:18 -0400 Subject: [PATCH] fix bug --- bash_tools.sh | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/bash_tools.sh b/bash_tools.sh index 0b11f0a..29d0064 100644 --- a/bash_tools.sh +++ b/bash_tools.sh @@ -28,30 +28,31 @@ odict(){ # Linux specific functions if [[ "$OSTYPE" == "linux-gnu"* ]]; then - set_wallpaper(){ - local file=$1 - # convert to abs path - if [[ ! "$file" = /* ]]; then - file=$(pwd)/$1 - fi - gsettings set org.gnome.desktop.background picture-uri file://$file - } +function set_wallpaper(){ + local file=$1 + # convert to abs path + if [[ ! "$file" = /* ]]; then + file=$(pwd)/$1 + fi + gsettings set org.gnome.desktop.background picture-uri file://$file +} + fi # Mac OSX specific functions if [[ "$OSTYPE" == "darwin"* ]]; then - set_wallpaper(){ - local file=$1 - # convert to abs path - if [[ ! "$file" = /* ]]; then - file=$(pwd)/$1 - fi +function set_wallpaper(){ + local file=$1 + # convert to abs path + if [[ ! "$file" = /* ]]; then + file=$(pwd)/$1 + fi - apple_script_single_desk="tell application \"Finder\" to set desktop picture to POSIX file \"$file\"" - osascript -e "$apple_script_single_desk" - } + apple_script_single_desk="tell application \"Finder\" to set desktop picture to POSIX file \"$file\"" + osascript -e "$apple_script_single_desk" +} fi