This commit is contained in:
Nachuan Tang
2022-07-27 01:53:10 -04:00
parent 7fec8b0c5c
commit 1c10c2a04c
2 changed files with 37 additions and 29 deletions
+2 -29
View File
@@ -48,35 +48,8 @@ function dict(){
python $DOTFILE_DIR/bash_tools/dict.py $1 $2
}
# Linux specific functions
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
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
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"
}
fi
# set_wallpaper() function
source $DOTFILE_DIR/bash_tools/wallpaper.sh
#
# Command Configuration
+35
View File
@@ -0,0 +1,35 @@
# Linux specific functions
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
set_gnome_wp() {
gsettings set org.gnome.desktop.background picture-uri "file://$1"
gsettings set org.gnome.desktop.background picture-uri-dark "file://$1"
}
function set_wallpaper(){
local file=$1
# convert to abs path
if [[ ! "$file" = /* ]]; then
file=$(pwd)/$1
fi
set_gnome_wp $file
}
fi
# Mac OSX specific functions
if [[ "$OSTYPE" == "darwin"* ]]; then
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"
}
fi