commit 06f522be3657cab4e2939b5ecab269242c731abe Author: Vince Date: Mon Jan 17 11:40:15 2022 +0800 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/1080p/Monterey-dark.jpg b/1080p/Monterey-dark.jpg new file mode 100644 index 0000000..b5db960 Binary files /dev/null and b/1080p/Monterey-dark.jpg differ diff --git a/1080p/Monterey-dark.png b/1080p/Monterey-dark.png new file mode 100644 index 0000000..f74530d Binary files /dev/null and b/1080p/Monterey-dark.png differ diff --git a/1080p/Monterey-light.jpg b/1080p/Monterey-light.jpg new file mode 100644 index 0000000..6c5331c Binary files /dev/null and b/1080p/Monterey-light.jpg differ diff --git a/1080p/Monterey-light.png b/1080p/Monterey-light.png new file mode 100644 index 0000000..25b5dc3 Binary files /dev/null and b/1080p/Monterey-light.png differ diff --git a/1080p/Monterey-morning.jpg b/1080p/Monterey-morning.jpg new file mode 100644 index 0000000..d8b42e4 Binary files /dev/null and b/1080p/Monterey-morning.jpg differ diff --git a/1080p/Monterey-morning.png b/1080p/Monterey-morning.png new file mode 100644 index 0000000..b99e577 Binary files /dev/null and b/1080p/Monterey-morning.png differ diff --git a/1080p/Monterey.jpg b/1080p/Monterey.jpg new file mode 100644 index 0000000..488e9ff Binary files /dev/null and b/1080p/Monterey.jpg differ diff --git a/1080p/Monterey.png b/1080p/Monterey.png new file mode 100644 index 0000000..49ed16b Binary files /dev/null and b/1080p/Monterey.png differ diff --git a/1080p/WhiteSur-dark.jpg b/1080p/WhiteSur-dark.jpg new file mode 100644 index 0000000..b5e557e Binary files /dev/null and b/1080p/WhiteSur-dark.jpg differ diff --git a/1080p/WhiteSur-dark.png b/1080p/WhiteSur-dark.png new file mode 100644 index 0000000..44a22ab Binary files /dev/null and b/1080p/WhiteSur-dark.png differ diff --git a/1080p/WhiteSur-light.jpg b/1080p/WhiteSur-light.jpg new file mode 100644 index 0000000..fa15d3d Binary files /dev/null and b/1080p/WhiteSur-light.jpg differ diff --git a/1080p/WhiteSur-light.png b/1080p/WhiteSur-light.png new file mode 100644 index 0000000..6edc9cd Binary files /dev/null and b/1080p/WhiteSur-light.png differ diff --git a/1080p/WhiteSur-morning.jpg b/1080p/WhiteSur-morning.jpg new file mode 100644 index 0000000..aa648b2 Binary files /dev/null and b/1080p/WhiteSur-morning.jpg differ diff --git a/1080p/WhiteSur-morning.png b/1080p/WhiteSur-morning.png new file mode 100644 index 0000000..c4eb88b Binary files /dev/null and b/1080p/WhiteSur-morning.png differ diff --git a/1080p/WhiteSur.jpg b/1080p/WhiteSur.jpg new file mode 100644 index 0000000..f85d42d Binary files /dev/null and b/1080p/WhiteSur.jpg differ diff --git a/1080p/WhiteSur.png b/1080p/WhiteSur.png new file mode 100644 index 0000000..5ede213 Binary files /dev/null and b/1080p/WhiteSur.png differ diff --git a/2k/Monterey-dark.jpg b/2k/Monterey-dark.jpg new file mode 100644 index 0000000..bdfc4cb Binary files /dev/null and b/2k/Monterey-dark.jpg differ diff --git a/2k/Monterey-dark.png b/2k/Monterey-dark.png new file mode 100644 index 0000000..c465e77 Binary files /dev/null and b/2k/Monterey-dark.png differ diff --git a/2k/Monterey-light.jpg b/2k/Monterey-light.jpg new file mode 100644 index 0000000..4b1aed3 Binary files /dev/null and b/2k/Monterey-light.jpg differ diff --git a/2k/Monterey-light.png b/2k/Monterey-light.png new file mode 100644 index 0000000..6f988e9 Binary files /dev/null and b/2k/Monterey-light.png differ diff --git a/2k/Monterey-morning.jpg b/2k/Monterey-morning.jpg new file mode 100644 index 0000000..662c02f Binary files /dev/null and b/2k/Monterey-morning.jpg differ diff --git a/2k/Monterey-morning.png b/2k/Monterey-morning.png new file mode 100644 index 0000000..9cfbd1b Binary files /dev/null and b/2k/Monterey-morning.png differ diff --git a/2k/Monterey.jpg b/2k/Monterey.jpg new file mode 100644 index 0000000..d0b4140 Binary files /dev/null and b/2k/Monterey.jpg differ diff --git a/2k/Monterey.png b/2k/Monterey.png new file mode 100644 index 0000000..9406b07 Binary files /dev/null and b/2k/Monterey.png differ diff --git a/2k/WhiteSur-dark.jpg b/2k/WhiteSur-dark.jpg new file mode 100644 index 0000000..5d43c02 Binary files /dev/null and b/2k/WhiteSur-dark.jpg differ diff --git a/2k/WhiteSur-dark.png b/2k/WhiteSur-dark.png new file mode 100644 index 0000000..cb07816 Binary files /dev/null and b/2k/WhiteSur-dark.png differ diff --git a/2k/WhiteSur-light.jpg b/2k/WhiteSur-light.jpg new file mode 100644 index 0000000..43c0357 Binary files /dev/null and b/2k/WhiteSur-light.jpg differ diff --git a/2k/WhiteSur-light.png b/2k/WhiteSur-light.png new file mode 100644 index 0000000..14e92e8 Binary files /dev/null and b/2k/WhiteSur-light.png differ diff --git a/2k/WhiteSur-morning.jpg b/2k/WhiteSur-morning.jpg new file mode 100644 index 0000000..3aebc4c Binary files /dev/null and b/2k/WhiteSur-morning.jpg differ diff --git a/2k/WhiteSur-morning.png b/2k/WhiteSur-morning.png new file mode 100644 index 0000000..35ad6eb Binary files /dev/null and b/2k/WhiteSur-morning.png differ diff --git a/2k/WhiteSur.jpg b/2k/WhiteSur.jpg new file mode 100644 index 0000000..0df4ea4 Binary files /dev/null and b/2k/WhiteSur.jpg differ diff --git a/2k/WhiteSur.png b/2k/WhiteSur.png new file mode 100644 index 0000000..2435d52 Binary files /dev/null and b/2k/WhiteSur.png differ diff --git a/4k/Monterey-dark.jpg b/4k/Monterey-dark.jpg new file mode 100644 index 0000000..38551df Binary files /dev/null and b/4k/Monterey-dark.jpg differ diff --git a/4k/Monterey-dark.png b/4k/Monterey-dark.png new file mode 100644 index 0000000..b600b42 Binary files /dev/null and b/4k/Monterey-dark.png differ diff --git a/4k/Monterey-light.jpg b/4k/Monterey-light.jpg new file mode 100644 index 0000000..da8758a Binary files /dev/null and b/4k/Monterey-light.jpg differ diff --git a/4k/Monterey-light.png b/4k/Monterey-light.png new file mode 100644 index 0000000..f7a3788 Binary files /dev/null and b/4k/Monterey-light.png differ diff --git a/4k/Monterey-morning.jpg b/4k/Monterey-morning.jpg new file mode 100644 index 0000000..81f57ad Binary files /dev/null and b/4k/Monterey-morning.jpg differ diff --git a/4k/Monterey-morning.png b/4k/Monterey-morning.png new file mode 100644 index 0000000..dee6514 Binary files /dev/null and b/4k/Monterey-morning.png differ diff --git a/4k/Monterey.jpg b/4k/Monterey.jpg new file mode 100644 index 0000000..62979cd Binary files /dev/null and b/4k/Monterey.jpg differ diff --git a/4k/Monterey.png b/4k/Monterey.png new file mode 100644 index 0000000..6546e80 Binary files /dev/null and b/4k/Monterey.png differ diff --git a/4k/WhiteSur-dark.jpg b/4k/WhiteSur-dark.jpg new file mode 100644 index 0000000..2678504 Binary files /dev/null and b/4k/WhiteSur-dark.jpg differ diff --git a/4k/WhiteSur-dark.png b/4k/WhiteSur-dark.png new file mode 100644 index 0000000..4916949 Binary files /dev/null and b/4k/WhiteSur-dark.png differ diff --git a/4k/WhiteSur-light.jpg b/4k/WhiteSur-light.jpg new file mode 100644 index 0000000..8efbc1f Binary files /dev/null and b/4k/WhiteSur-light.jpg differ diff --git a/4k/WhiteSur-light.png b/4k/WhiteSur-light.png new file mode 100644 index 0000000..a845f9d Binary files /dev/null and b/4k/WhiteSur-light.png differ diff --git a/4k/WhiteSur-morning.jpg b/4k/WhiteSur-morning.jpg new file mode 100644 index 0000000..d6b8ff8 Binary files /dev/null and b/4k/WhiteSur-morning.jpg differ diff --git a/4k/WhiteSur-morning.png b/4k/WhiteSur-morning.png new file mode 100644 index 0000000..12e6128 Binary files /dev/null and b/4k/WhiteSur-morning.png differ diff --git a/4k/WhiteSur.jpg b/4k/WhiteSur.jpg new file mode 100644 index 0000000..0b7d543 Binary files /dev/null and b/4k/WhiteSur.jpg differ diff --git a/4k/WhiteSur.png b/4k/WhiteSur.png new file mode 100644 index 0000000..9e254c5 Binary files /dev/null and b/4k/WhiteSur.png differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..32500da --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Vince + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Monterey-dark.svg b/Monterey-dark.svg new file mode 100644 index 0000000..a01337f --- /dev/null +++ b/Monterey-dark.svg @@ -0,0 +1,1155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Monterey-light.svg b/Monterey-light.svg new file mode 100644 index 0000000..0688a5f --- /dev/null +++ b/Monterey-light.svg @@ -0,0 +1,1158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Monterey-morning.svg b/Monterey-morning.svg new file mode 100644 index 0000000..b8f7d85 --- /dev/null +++ b/Monterey-morning.svg @@ -0,0 +1,1285 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Monterey.svg b/Monterey.svg new file mode 100644 index 0000000..792cc8d --- /dev/null +++ b/Monterey.svg @@ -0,0 +1,1253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..6e6a041 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ + +# MacOS Wallpapers for linux desktop + +## WhiteSur (Big Sur) Wallpapers +![1](1080p/WhiteSur-light.png) +![2](1080p/WhiteSur.png) +![3](1080p/WhiteSur-dark.png) + +## Monterey Wallpapers +![1](1080p/Monterey-light.png) +![2](1080p/Monterey.png) +![3](1080p/Monterey-dark.png) + +## Installation + +### Install Gnome Backgrounds (wallpaper will change according to time) + +```sh +sudo ./install-gnome-backgrounds.sh +``` + +> Options: + +``` + -t, --theme VARIANT Specify theme variant(s) [whitesur|monterey] (Default: All variants)s) + -s, --screen VARIANT Specify screen variant [1080p|2k|4k] (Default: 1080p) + -u, --uninstall Uninstall wallpappers + -h, --help Show help +``` + +### Install Normal Wallpappers + +```sh +./install-wallpapers.sh +``` + +> Options: + +``` + -t, --theme VARIANT Specify theme variant(s) [whitesur|monterey] (Default: All variants)s) + -c, --color VARIANT Specify color variant(s) [light|dark] (Default: All variants)s) + -s, --screen VARIANT Specify screen variant [1080p|2k|4k] (Default: 1080p) + -u, --uninstall Uninstall wallpappers + -h, --help Show help +``` diff --git a/WhiteSur-dark.svg b/WhiteSur-dark.svg new file mode 100644 index 0000000..9899380 --- /dev/null +++ b/WhiteSur-dark.svg @@ -0,0 +1,832 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WhiteSur-light.svg b/WhiteSur-light.svg new file mode 100644 index 0000000..8a0e9e9 --- /dev/null +++ b/WhiteSur-light.svg @@ -0,0 +1,780 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WhiteSur-morning.svg b/WhiteSur-morning.svg new file mode 100644 index 0000000..7cddcc9 --- /dev/null +++ b/WhiteSur-morning.svg @@ -0,0 +1,822 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WhiteSur.svg b/WhiteSur.svg new file mode 100644 index 0000000..391e377 --- /dev/null +++ b/WhiteSur.svg @@ -0,0 +1,888 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/install-gnome-backgrounds.sh b/install-gnome-backgrounds.sh new file mode 100755 index 0000000..5fb92bd --- /dev/null +++ b/install-gnome-backgrounds.sh @@ -0,0 +1,185 @@ +#!/bin/bash + +readonly ROOT_UID=0 +readonly MAX_DELAY=20 # max delay for user to enter root password + +REPO_DIR="$(cd "$(dirname "$0")" && pwd)" +BACKGROUND_DIR="/usr/share/backgrounds" +PROPERTIES_DIR="/usr/share/gnome-background-properties" + +THEME_VARIANTS=('WhiteSur' 'Monterey') +SCREEN_VARIANTS=('1080p' '2k' '4k') + +#COLORS +CDEF=" \033[0m" # default color +CCIN=" \033[0;36m" # info color +CGSC=" \033[0;32m" # success color +CRER=" \033[0;31m" # error color +CWAR=" \033[0;33m" # waring color +b_CDEF=" \033[1;37m" # bold default color +b_CCIN=" \033[1;36m" # bold info color +b_CGSC=" \033[1;32m" # bold success color +b_CRER=" \033[1;31m" # bold error color +b_CWAR=" \033[1;33m" # bold warning color + +# echo like ... with flag type and display message colors +prompt () { + case ${1} in + "-s"|"--success") + echo -e "${b_CGSC}${@/-s/}${CDEF}";; # print success message + "-e"|"--error") + echo -e "${b_CRER}${@/-e/}${CDEF}";; # print error message + "-w"|"--warning") + echo -e "${b_CWAR}${@/-w/}${CDEF}";; # print warning message + "-i"|"--info") + echo -e "${b_CCIN}${@/-i/}${CDEF}";; # print info message + *) + echo -e "$@" + ;; + esac +} + +usage() { + cat << EOF +Usage: $0 [OPTION]... + +OPTIONS: + -t, --theme VARIANT Specify theme variant(s) [whitesur|monterey] (Default: All variants)s) + -s, --screen VARIANT Specify screen variant [1080p|2k|4k] (Default: 1080p) + -u, --uninstall Uninstall wallpappers + -h, --help Show help + +INSTALLATION EXAMPLES: +Install WhiteSur version on 4k display: + $0 -t whitesur -s 4k +EOF +} + +install() { + local theme="$1" + local screen="$2" + + prompt -i "\n * Install ${theme} ${screen} version in ${BACKGROUND_DIR}... " + [[ -d ${BACKGROUND_DIR}/${theme} ]] && rm -rf ${BACKGROUND_DIR}/${theme} + [[ -f ${PROPERTIES_DIR}/${theme}.xml ]] && rm -rf ${PROPERTIES_DIR}/${theme}.xml + mkdir -p ${BACKGROUND_DIR}/${theme} + cp -r ${REPO_DIR}/${screen}/${theme}{'','-morning','-light'}.jpg ${BACKGROUND_DIR}/${theme} + cp -r ${REPO_DIR}/xml-files/timed-xml-files/${theme}-timed.xml ${BACKGROUND_DIR}/${theme} + cp -r ${REPO_DIR}/xml-files/gnome-background-properties/${theme}.xml ${PROPERTIES_DIR} +} + +uninstall() { + local theme="$1" + prompt -i "\n * Uninstall ${theme}... " + [[ -d ${BACKGROUND_DIR}/${theme} ]] && rm -rf ${BACKGROUND_DIR}/${theme} + [[ -f ${PROPERTIES_DIR}/${theme}.xml ]] && rm -rf ${PROPERTIES_DIR}/${theme}.xml +} + +while [[ $# -gt 0 ]]; do + case "${1}" in + -u|--uninstall) + uninstall='true' + shift + ;; + -t|--theme) + shift + for theme in "$@"; do + case "$theme" in + whitesur) + themes+=("${THEME_VARIANTS[0]}") + shift 1 + ;; + monterey) + themes+=("${THEME_VARIANTS[1]}") + shift 1 + ;; + -*) + break + ;; + *) + prompt -e "ERROR: Unrecognized theme variant '$1'." + prompt -i "Try '$0 --help' for more information." + exit 1 + ;; + esac + done + ;; + -s|--screen) + shift + for screen in "$@"; do + case "$screen" in + 1080p) + screens+=("${SCREEN_VARIANTS[0]}") + shift 1 + ;; + 2k) + screens+=("${SCREEN_VARIANTS[1]}") + shift 1 + ;; + 4k) + screens+=("${SCREEN_VARIANTS[2]}") + shift 1 + ;; + -*) + break + ;; + *) + prompt -e "ERROR: Unrecognized screen variant '$1'." + prompt -i "Try '$0 --help' for more information." + exit 1 + ;; + esac + done + ;; + -h|--help) + usage + exit 0 + ;; + *) + prompt -e "ERROR: Unrecognized installation option '$1'." + prompt -i "Try '$0 --help' for more information." + exit 1 + ;; + esac +done + +if [[ "${#themes[@]}" -eq 0 ]] ; then + themes=("${THEME_VARIANTS[@]}") +fi + +if [[ "${#screens[@]}" -eq 0 ]] ; then + screens=("${SCREEN_VARIANTS[@]}") +fi + +install_wallpaper() { + echo + for theme in "${themes[@]}"; do + for screen in "${screens[0]}"; do + install "$theme" "$screen" + done + done + echo +} + +uninstall_wallpaper() { + echo + for theme in "${themes[@]}"; do + uninstall "$theme" + done + echo +} + +if [[ $UID -ne $ROOT_UID ]]; then + echo + prompt -e "ERROR: Need root access! please run this script with sudo." + echo + exit 1 +fi + +if [[ "${uninstall}" != 'true' ]]; then + install_wallpaper +else + uninstall_wallpaper +fi + +prompt -s "Finished!" diff --git a/install-wallpapers.sh b/install-wallpapers.sh new file mode 100755 index 0000000..4817e94 --- /dev/null +++ b/install-wallpapers.sh @@ -0,0 +1,206 @@ +#!/bin/bash + +REPO_DIR="$(cd "$(dirname "$0")" && pwd)" +WALLPAPER_DIR="$HOME/.local/share/backgrounds" + +THEME_VARIANTS=('WhiteSur' 'Monterey') +COLOR_VARIANTS=('' '-light' '-dark') +SCREEN_VARIANTS=('1080p' '2k' '4k') + +#COLORS +CDEF=" \033[0m" # default color +CCIN=" \033[0;36m" # info color +CGSC=" \033[0;32m" # success color +CRER=" \033[0;31m" # error color +CWAR=" \033[0;33m" # waring color +b_CDEF=" \033[1;37m" # bold default color +b_CCIN=" \033[1;36m" # bold info color +b_CGSC=" \033[1;32m" # bold success color +b_CRER=" \033[1;31m" # bold error color +b_CWAR=" \033[1;33m" # bold warning color + +# echo like ... with flag type and display message colors +prompt () { + case ${1} in + "-s"|"--success") + echo -e "${b_CGSC}${@/-s/}${CDEF}";; # print success message + "-e"|"--error") + echo -e "${b_CRER}${@/-e/}${CDEF}";; # print error message + "-w"|"--warning") + echo -e "${b_CWAR}${@/-w/}${CDEF}";; # print warning message + "-i"|"--info") + echo -e "${b_CCIN}${@/-i/}${CDEF}";; # print info message + *) + echo -e "$@" + ;; + esac +} + +usage() { + cat << EOF +Usage: $0 [OPTION]... + +OPTIONS: + -t, --theme VARIANT Specify theme variant(s) [whitesur|monterey] (Default: All variants)s) + -c, --color VARIANT Specify color variant(s) [night|light|dark] (Default: All variants)s) + -s, --screen VARIANT Specify screen variant [1080p|2k|4k] (Default: 1080p) + -u, --uninstall Uninstall wallpappers + -h, --help Show help + +INSTALLATION EXAMPLES: +Install WhiteSur dark version on 4k display: + $0 -t whitesur -c dark -s 4k +EOF +} + +install() { + local theme="$1" + local color="$2" + local screen="$3" + prompt -i "\n * Install ${theme}${color} in ${WALLPAPER_DIR}... " + mkdir -p "${WALLPAPER_DIR}" + [[ -f ${WALLPAPER_DIR}/${theme}${color}.png ]] && rm -rf ${WALLPAPER_DIR}/${theme}${color}.png + cp -r ${REPO_DIR}/${screen}/${theme}${color}.png ${WALLPAPER_DIR} +} + +uninstall() { + local theme="$1" + local color="$2" + prompt -i "\n * Uninstall ${theme}${color}... " + [[ -f ${WALLPAPER_DIR}/${theme}${color}.png ]] && rm -rf ${WALLPAPER_DIR}/${theme}${color}.png +} + +while [[ $# -gt 0 ]]; do + case "${1}" in + -u|--uninstall) + uninstall='true' + shift + ;; + -t|--theme) + shift + for theme in "$@"; do + case "$theme" in + whitesur) + themes+=("${THEME_VARIANTS[0]}") + shift 1 + ;; + monterey) + themes+=("${THEME_VARIANTS[1]}") + shift 1 + ;; + -*) + break + ;; + *) + echo "ERROR: Unrecognized color variant '$1'." + echo "Try '$0 --help' for more information." + exit 1 + ;; + esac + done + ;; + -c|--color) + shift + for color in "$@"; do + case "$color" in + night) + colors+=("${COLOR_VARIANTS[0]}") + shift 1 + ;; + light) + colors+=("${COLOR_VARIANTS[1]}") + shift 1 + ;; + dark) + colors+=("${COLOR_VARIANTS[2]}") + shift 1 + ;; + -*) + break + ;; + *) + echo "ERROR: Unrecognized color variant '$1'." + echo "Try '$0 --help' for more information." + exit 1 + ;; + esac + done + ;; + -s|--screen) + shift + for screen in "$@"; do + case "$screen" in + 1080p) + screens+=("${SCREEN_VARIANTS[0]}") + shift 1 + ;; + 2k) + screens+=("${SCREEN_VARIANTS[1]}") + shift 1 + ;; + 4k) + screens+=("${SCREEN_VARIANTS[2]}") + shift 1 + ;; + -*) + break + ;; + *) + echo "ERROR: Unrecognized color variant '$1'." + echo "Try '$0 --help' for more information." + exit 1 + ;; + esac + done + ;; + -h|--help) + usage + exit 0 + ;; + *) + prompt -e "ERROR: Unrecognized installation option '$1'." + prompt -i "Try '$0 --help' for more information." + exit 1 + ;; + esac +done + +if [[ "${#themes[@]}" -eq 0 ]] ; then + themes=("${THEME_VARIANTS[@]}") +fi + +if [[ "${#colors[@]}" -eq 0 ]] ; then + colors=("${COLOR_VARIANTS[@]}") +fi + +if [[ "${#screens[@]}" -eq 0 ]] ; then + screens=("${SCREEN_VARIANTS[0]}") +fi + +install_wallpaper() { + for theme in "${themes[@]}"; do + for color in "${colors[@]}"; do + for screen in "${screens[@]}"; do + install "$theme" "$color" "$screen" + done + done + done +} + +uninstall_wallpaper() { + for theme in "${themes[@]}"; do + for color in "${colors[@]}"; do + uninstall "$theme" "$color" + done + done +} + +echo +if [[ "${uninstall}" != 'true' ]]; then + install_wallpaper +else + uninstall_wallpaper +fi +prompt -s "\n * All done!" +echo + diff --git a/render-wallpapers.sh b/render-wallpapers.sh new file mode 100755 index 0000000..2ae16f3 --- /dev/null +++ b/render-wallpapers.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +INKSCAPE="$(command -v inkscape)" || true +OPTIPNG="$(command -v optipng)" || true +CONVERT="$(command -v convert)" || true + +for theme in 'Monterey' 'WhiteSur'; do + for screen in '1080p' '2k' '4k'; do + for color in '' '-light' '-dark' '-morning'; do + +if [[ "${screen}" == '1080p' ]]; then + DPI="96" +elif [[ "${screen}" == '2k' ]]; then + DPI="128" +elif [[ "${screen}" == '4k' ]]; then + DPI="192" +fi + +SRC_FILE="${theme}${color}.svg" +PNG_file="${screen}/${theme}${color}.png" +JPG_file="${screen}/${theme}${color}.jpg" + +if [[ -f "$PNG_file" ]]; then + echo "'$PNG_file' exist! " +else + echo "Rendering '$PNG_file'" + "$INKSCAPE" --export-dpi="$DPI" \ + --export-filename="$PNG_file" "$SRC_FILE" >/dev/null + +# if [[ -n "${OPTIPNG}" ]]; then +# "$OPTIPNG" -o7 --quiet "$PNG_file" +# fi +fi + +if [[ -f "$JPG_file" ]]; then + echo "'$JPG_file' exist! " +else + echo "Rendering '$JPG_file'" + "$CONVERT" "$PNG_file" -quality 100 "${screen}/${theme}${color}.jpg" +fi + + done + done +done + + diff --git a/xml-files/gnome-background-properties/Monterey.xml b/xml-files/gnome-background-properties/Monterey.xml new file mode 100644 index 0000000..d3e4e42 --- /dev/null +++ b/xml-files/gnome-background-properties/Monterey.xml @@ -0,0 +1,12 @@ + + + + + Monterey Background + /usr/share/backgrounds/Monterey/Monterey-timed.xml + zoom + solid + #ffffff + #000000 + + diff --git a/xml-files/gnome-background-properties/WhiteSur.xml b/xml-files/gnome-background-properties/WhiteSur.xml new file mode 100644 index 0000000..45aa430 --- /dev/null +++ b/xml-files/gnome-background-properties/WhiteSur.xml @@ -0,0 +1,12 @@ + + + + + WhiteSur Background + /usr/share/backgrounds/WhiteSur/WhiteSur-timed.xml + zoom + solid + #ffffff + #000000 + + diff --git a/xml-files/timed-xml-files/Monterey-timed.xml b/xml-files/timed-xml-files/Monterey-timed.xml new file mode 100644 index 0000000..d4bda94 --- /dev/null +++ b/xml-files/timed-xml-files/Monterey-timed.xml @@ -0,0 +1,51 @@ + + + 2011 + 11 + 24 + 7 + 00 + 00 + + + + + + +3600.0 +/usr/share/backgrounds/Monterey/Monterey-morning.jpg + + + + +18000.0 +/usr/share/backgrounds/Monterey/Monterey-morning.jpg +/usr/share/backgrounds/Monterey/Monterey-light.jpg + + + + +18000.0 +/usr/share/backgrounds/Monterey/Monterey-light.jpg + + + + +21600.0 +/usr/share/backgrounds/Monterey/Monterey-light.jpg +/usr/share/backgrounds/Monterey/Monterey.jpg + + + + +18000.0 +/usr/share/backgrounds/Monterey/Monterey.jpg + + + + +7200.0 +/usr/share/backgrounds/Monterey/Monterey.jpg +/usr/share/backgrounds/Monterey/Monterey-morning.jpg + + diff --git a/xml-files/timed-xml-files/WhiteSur-timed.xml b/xml-files/timed-xml-files/WhiteSur-timed.xml new file mode 100644 index 0000000..807c1f6 --- /dev/null +++ b/xml-files/timed-xml-files/WhiteSur-timed.xml @@ -0,0 +1,51 @@ + + + 2011 + 11 + 24 + 7 + 00 + 00 + + + + + + +3600.0 +/usr/share/backgrounds/WhiteSur/WhiteSur-morning.jpg + + + + +18000.0 +/usr/share/backgrounds/WhiteSur/WhiteSur-morning.jpg +/usr/share/backgrounds/WhiteSur/WhiteSur-light.jpg + + + + +18000.0 +/usr/share/backgrounds/WhiteSur/WhiteSur-light.jpg + + + + +21600.0 +/usr/share/backgrounds/WhiteSur/WhiteSur-light.jpg +/usr/share/backgrounds/WhiteSur/WhiteSur.jpg + + + + +18000.0 +/usr/share/backgrounds/WhiteSur/WhiteSur.jpg + + + + +7200.0 +/usr/share/backgrounds/WhiteSur/WhiteSur.jpg +/usr/share/backgrounds/WhiteSur/WhiteSur-morning.jpg + +