This commit is contained in:
NAME
2022-06-18 15:15:18 -04:00
parent dc915e293f
commit f1cad2f3cd
+18 -17
View File
@@ -28,30 +28,31 @@ odict(){
# Linux specific functions # Linux specific functions
if [[ "$OSTYPE" == "linux-gnu"* ]]; then if [[ "$OSTYPE" == "linux-gnu"* ]]; then
set_wallpaper(){ function set_wallpaper(){
local file=$1 local file=$1
# convert to abs path # convert to abs path
if [[ ! "$file" = /* ]]; then if [[ ! "$file" = /* ]]; then
file=$(pwd)/$1 file=$(pwd)/$1
fi fi
gsettings set org.gnome.desktop.background picture-uri file://$file gsettings set org.gnome.desktop.background picture-uri file://$file
} }
fi fi
# Mac OSX specific functions # Mac OSX specific functions
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
set_wallpaper(){ function set_wallpaper(){
local file=$1 local file=$1
# convert to abs path # convert to abs path
if [[ ! "$file" = /* ]]; then if [[ ! "$file" = /* ]]; then
file=$(pwd)/$1 file=$(pwd)/$1
fi fi
apple_script_single_desk="tell application \"Finder\" to set desktop picture to POSIX file \"$file\"" apple_script_single_desk="tell application \"Finder\" to set desktop picture to POSIX file \"$file\""
osascript -e "$apple_script_single_desk" osascript -e "$apple_script_single_desk"
} }
fi fi