File tree Expand file tree Collapse file tree 2 files changed +14
-40
lines changed
Expand file tree Collapse file tree 2 files changed +14
-40
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- # Delete file only if file exists
4- # remove <file1> <file2> ...
5- function remove () {
6- local _list
7- local _file
8- _list=($( echo " $@ " ) )
9- for _file in " ${_list[@]} " ; do
10- if [[ -f ${_file} ]]; then
11- rm -f " ${_file} "
12- elif [[ -d ${_file} ]]; then
13- rm -rf " ${_file} "
14- fi
15- done
16- }
17-
18- image=" ${1} "
19- replace=" ${2} "
3+ image=" /usr/share/lxde/wallpapers/lxde_${1} .jpg"
4+ replace=" /usr/share/backgrounds/${2} .png"
205
216# Replace wallpaper.
22- remove " /usr/share/lxde/wallpapers/lxde_${image} .jpg"
23- ln -s " /usr/share/backgrounds/${replace} .png" " /usr/share/lxde/wallpapers/lxde_${image} .jpg"
24- chmod 644 " /usr/share/backgrounds/${replace} .png"
7+ if [[ -f " ${image} " ]] && [[ -f " ${replace} " ]]; then
8+ rm -rf " ${image} "
9+ ln -s " ${replace} " " ${image} "
10+ chmod 644 " ${replace} "
11+ fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- # Delete file only if file exists
4- # remove <file1> <file2> ...
5- function remove () {
6- local _list
7- local _file
8- _list=($( echo " $@ " ) )
9- for _file in " ${_list[@]} " ; do
10- if [[ -f ${_file} ]]; then
11- rm -f " ${_file} "
12- elif [[ -d ${_file} ]]; then
13- rm -rf " ${_file} "
14- fi
15- done
16- }
17-
18- image=" ${1} "
19- replace=" ${2} "
3+ image=" /usr/share/backgrounds/xfce/xfce-${1} .png"
4+ replace=" /usr/share/backgrounds/${2} .png"
205
216# Replace wallpaper.
22- remove " /usr/share/backgrounds/xfce/xfce-${image} .png"
23- ln -s " /usr/share/backgrounds/${replace} .png" " /usr/share/backgrounds/xfce/xfce-${image} .png"
24- chmod 644 " /usr/share/backgrounds/${replace} .png"
7+ if [[ -f " ${image} " ]] && [[ -f " ${replace} " ]]; then
8+ rm -rf " ${image} "
9+ ln -s " ${replace} " " ${image} "
10+ chmod 644 " ${replace} "
11+ fi
You can’t perform that action at this time.
0 commit comments