This commit is contained in:
Vince 2021-06-23 10:38:41 +08:00
parent be53598417
commit da070afeb9
6 changed files with 78 additions and 31 deletions

View file

@ -320,6 +320,10 @@ Note:
<img src="https://github.com/vinceliuice/WhiteSur-gtk-theme/blob/pictures/pictures/whitesur-wallpaper.png"/>
</a> </p>
<br>
<p align="center"> <a href="https://github.com/vinceliuice/WhiteSur-kde/tree/master/wallpaper">
<img src="https://github.com/vinceliuice/WhiteSur-gtk-theme/blob/pictures/pictures/Monterey-wallpaper.png"/>
</a> </p>
<br>
<p align="center"> <a href="https://github.com/vinceliuice/WhiteSur-kde/tree/master/wallpaper">
<img src="https://github.com/vinceliuice/WhiteSur-gtk-theme/blob/pictures/pictures/download-button.png"/>
</a> </p>

14
wallpapers/README.md Normal file
View file

@ -0,0 +1,14 @@
# MacOS Wallpapers for linux desktop
## WhiteSur (Big Sur) Wallpapers
![1](WhiteSur-light.png)
![2](WhiteSur-dark.png)
## Monterey Wallpapers
![1](Monterey-light.png)
![2](Monterey-dark.png)
## Installation
### Install

View file

@ -6,9 +6,9 @@
fill="none"
version="1.1"
id="svg282"
sodipodi:docname="BigSur-dark.svg"
sodipodi:docname="WhiteSur-dark.svg"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
inkscape:export-filename="/home/vince/Documents/GitHub/WhiteSur-gtk-theme/src/wallpapers/BigSur-dark.png"
inkscape:export-filename="/home/vince/Documents/GitHub/WhiteSur-gtk-theme/wallpapers/WhiteSur-dark.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
@ -28,7 +28,7 @@
inkscape:cx="-2040.3177"
inkscape:cy="-368.73211"
inkscape:window-width="1920"
inkscape:window-height="932"
inkscape:window-height="942"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -6,7 +6,7 @@
<filename>/usr/share/backgrounds/Monterey/Monterey-timed.xml</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#555555</pcolor>
<pcolor>#ffffff</pcolor>
<scolor>#000000</scolor>
</wallpaper>
</wallpapers>

View file

@ -6,7 +6,7 @@
<filename>/usr/share/backgrounds/WhiteSur/WhiteSur-timed.xml</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#555555</pcolor>
<pcolor>#ffffff</pcolor>
<scolor>#000000</scolor>
</wallpaper>
</wallpapers>

View file

@ -55,6 +55,7 @@ uninstall() {
}
while [[ $# -gt 0 ]]; do
PROG_ARGS+=("${1}")
case "${1}" in
-u|--uninstall)
uninstall='true'
@ -99,19 +100,7 @@ if [[ "${#themes[@]}" -eq 0 ]] ; then
themes=("${THEME_VARIANTS[@]}")
fi
install_wallpaper() {
for theme in "${themes[@]}"; do
install "$theme"
done
}
uninstall_wallpaper() {
for theme in "${themes[@]}"; do
uninstall "$theme"
done
}
sudo_access() {
install_access() {
# Error message
prompt -e "\n [ Error! ] -> Run me as root ! "
@ -126,19 +115,59 @@ sudo_access() {
}
}
if [[ "$UID" -eq "$ROOT_UID" ]] && [[ "${uninstall}" != 'true' ]]; then
prompt -s ""; install_wallpaper
prompt -s "\n * All done!"
prompt -s ""
else
[[ "${uninstall}" != 'true' ]] && sudo_access
fi
uninstall_access() {
#Check if password is cached (if cache timestamp not expired yet)
sudo -n true 2> /dev/null && echo
if [[ "$UID" -eq "$ROOT_UID" ]] && [[ "${uninstall}" == 'true' ]]; then
prompt -s ""; uninstall_wallpaper
prompt -s "\n * All done!"
prompt -s ""
if [[ $? == 0 ]]; then
#No need to ask for password
sudo "$0" "${PROG_ARGS[@]}"
else
#Ask for password
prompt -e "\n [ Error! ] -> Run me as root! "
read -p " [ Trusted ] Specify the root password : " -t ${MAX_DELAY} -s
sudo -S echo <<< $REPLY 2> /dev/null && echo
if [[ $? == 0 ]]; then
#Correct password, use with sudo's stdin
sudo -S "$0" "${PROG_ARGS[@]}" <<< $REPLY
else
#block for 3 seconds before allowing another attempt
sleep 3
clear
prompt -e "\n [ Error! ] -> Incorrect password!\n"
exit 1
fi
fi
}
install_wallpaper() {
if [[ "$UID" == "$ROOT_UID" ]]; then
echo
for theme in "${themes[@]}"; do
install "$theme"
done
else
install_access
echo
fi
}
uninstall_wallpaper() {
if [[ "$UID" == "$ROOT_UID" ]]; then
echo
for theme in "${themes[@]}"; do
uninstall "$theme"
done
else
uninstall_access
echo
fi
}
if [[ "${uninstall}" != 'true' ]]; then
install_wallpaper
else
prompt -i "\n Run this with sudo, try it again!"
exit 1
uninstall_wallpaper
fi