4 Commits

Author SHA1 Message Date
Vince
5c1d7ca20b Merge pull request #11 from sam-itt/patch-1
Fix install-gnome-backgrounds.sh --screen argument
2025-04-02 20:07:49 +08:00
sam-itt
a0821a4343 Fix install-gnome-backgrounds.sh --screen argument
${screens[2]} should be ${screens[@]} otherwise the --screen argument won't work.
2025-04-02 13:44:28 +02:00
vinceliuice
3a24624d04 update 2024-10-24 13:41:05 +08:00
vinceliuice
0a1f5d0ebd update 2023-07-29 22:30:53 +08:00
13 changed files with 141 additions and 58 deletions

BIN
4k/Sonoma-dark.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 KiB

BIN
4k/Sonoma-light.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 KiB

View File

@@ -4,10 +4,16 @@ 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' 'Ventura')
if [[ "$UID" -eq "$ROOT_UID" ]]; then
BACKGROUND_DIR="/usr/share/backgrounds"
PROPERTIES_DIR="/usr/share/gnome-background-properties"
else
BACKGROUND_DIR="$HOME/.local/share/backgrounds"
PROPERTIES_DIR="$HOME/.local/share/gnome-background-properties"
fi
THEME_VARIANTS=('WhiteSur' 'Monterey' 'Ventura' 'Sonoma')
SCREEN_VARIANTS=('1080p' '2k' '4k')
#COLORS
@@ -44,7 +50,7 @@ usage() {
Usage: $0 [OPTION]...
OPTIONS:
-t, --theme VARIANT Specify theme variant(s) [whitesur|monterey|ventura] (Default: All variants)s)
-t, --theme VARIANT Specify theme variant(s) [whitesur|monterey|ventura|sonoma] (Default: All variants)s)
-s, --screen VARIANT Specify screen variant [1080p|2k|4k] (Default: 4k)
-u, --uninstall Uninstall wallpappers
-h, --help Show help
@@ -64,7 +70,7 @@ install() {
[[ -f ${PROPERTIES_DIR}/${theme}.xml ]] && rm -rf ${PROPERTIES_DIR}/${theme}.xml
mkdir -p ${BACKGROUND_DIR}/${theme}
if [[ "${theme}" == 'Ventura' ]]; then
if [[ "${theme}" == 'Ventura' || "${theme}" == 'Sonoma' ]]; then
cp -a --no-preserve=ownership ${REPO_DIR}/4k/${theme}{'-dark','-light'}.jpg ${BACKGROUND_DIR}/${theme}
else
cp -a --no-preserve=ownership ${REPO_DIR}/${screen}/${theme}{'','-morning','-light'}.jpg ${BACKGROUND_DIR}/${theme}
@@ -72,6 +78,9 @@ install() {
cp -a --no-preserve=ownership ${REPO_DIR}/xml-files/timed-xml-files/${theme}-timed.xml ${BACKGROUND_DIR}/${theme}
cp -a --no-preserve=ownership ${REPO_DIR}/xml-files/gnome-background-properties/${theme}.xml ${PROPERTIES_DIR}
sed -i "s/@BACKGROUNDDIR@/$(printf '%s\n' "${BACKGROUND_DIR}" | sed 's/[\/&]/\\&/g')/g" "${BACKGROUND_DIR}/${theme}/${theme}-timed.xml"
sed -i "s/@BACKGROUNDDIR@/$(printf '%s\n' "${BACKGROUND_DIR}" | sed 's/[\/&]/\\&/g')/g" "${PROPERTIES_DIR}/${theme}.xml"
}
uninstall() {
@@ -90,7 +99,7 @@ install_nord_wallpaper() {
prompt -w "Install Nord version in ${BACKGROUND_DIR}... \n"
mkdir -p ${BACKGROUND_DIR}/Wallpaper-nord
cp -a --no-preserve=ownership ${REPO_DIR}/Wallpaper-nord/{'Mojave-nord','WhiteSur-nord'}{'-dark','-light'}.png ${BACKGROUND_DIR}/Wallpaper-nord
cp -a --no-preserve=ownership ${REPO_DIR}/xml-files/gnome-background-properties/Mojave.xml ${PROPERTIES_DIR}
cp -a --no-preserve=ownership ${REPO_DIR}/xml-files/gnome-background-properties/Mojave-nord.xml ${PROPERTIES_DIR}
}
while [[ $# -gt 0 ]]; do
@@ -115,6 +124,10 @@ while [[ $# -gt 0 ]]; do
themes+=("${THEME_VARIANTS[2]}")
shift 1
;;
sonoma)
themes+=("${THEME_VARIANTS[3]}")
shift 1
;;
-*)
break
;;
@@ -176,7 +189,7 @@ fi
install_wallpaper() {
echo
for theme in "${themes[@]}"; do
for screen in "${screens[2]}"; do
for screen in "${screens[@]}"; do
install "$theme" "$screen"
done
done
@@ -191,13 +204,6 @@ uninstall_wallpaper() {
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 && install_nord_wallpaper
else

View File

@@ -3,7 +3,7 @@
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
WALLPAPER_DIR="$HOME/.local/share/backgrounds"
THEME_VARIANTS=('WhiteSur' 'Monterey' 'Ventura')
THEME_VARIANTS=('WhiteSur' 'Monterey' 'Ventura' 'Sonoma')
COLOR_VARIANTS=('' '-light' '-dark')
SCREEN_VARIANTS=('1080p' '2k' '4k')
@@ -61,13 +61,13 @@ install() {
prompt -i "\n * Install ${theme}${color} in ${WALLPAPER_DIR}... "
mkdir -p "${WALLPAPER_DIR}"
if [[ "${theme}" == 'Ventura' ]]; then
if [[ "${theme}" == 'Ventura' || "${theme}" == 'Sonoma' ]]; then
[[ "${color}" == '' ]] && local color='-light'
fi
[[ -f ${WALLPAPER_DIR}/${theme}${color}.jpg ]] && rm -rf ${WALLPAPER_DIR}/${theme}${color}.jpg
if [[ "${theme}" == 'Ventura' ]]; then
if [[ "${theme}" == 'Ventura' || "${theme}" == 'Sonoma' ]]; then
cp -a --no-preserve=ownership ${REPO_DIR}/4k/${theme}${color}.jpg ${WALLPAPER_DIR}
else
cp -a --no-preserve=ownership ${REPO_DIR}/${screen}/${theme}${color}.jpg ${WALLPAPER_DIR}
@@ -114,7 +114,11 @@ while [[ $# -gt 0 ]]; do
shift 1
;;
ventura)
themes+=("${THEME_VARIANTS[1]}")
themes+=("${THEME_VARIANTS[2]}")
shift 1
;;
sonoma)
themes+=("${THEME_VARIANTS[3]}")
shift 1
;;
-*)

View File

@@ -3,8 +3,8 @@
<wallpapers>
<wallpaper deleted="false">
<name>Mojave Nord Background</name>
<filename>/usr/share/backgrounds/Wallpaper-nord/Mojave-nord-light.png</filename>
<filename-dark>/usr/share/backgrounds/Wallpaper-nord/Mojave-nord-dark.png</filename-dark>
<filename>@BACKGROUNDDIR@/Wallpaper-nord/Mojave-nord-light.png</filename>
<filename-dark>@BACKGROUNDDIR@/Wallpaper-nord/Mojave-nord-dark.png</filename-dark>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#3071AE</pcolor>

View File

@@ -3,8 +3,8 @@
<wallpapers>
<wallpaper deleted="false">
<name>Monterey Background</name>
<filename>/usr/share/backgrounds/Monterey/Monterey-light.jpg</filename>
<filename-dark>/usr/share/backgrounds/Monterey/Monterey.jpg</filename-dark>
<filename>@BACKGROUNDDIR@/Monterey/Monterey-light.jpg</filename>
<filename-dark>@BACKGROUNDDIR@/Monterey/Monterey.jpg</filename-dark>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#51a2da</pcolor>
@@ -13,7 +13,7 @@
<wallpaper deleted="false">
<name>Monterey Time of Day</name>
<filename>/usr/share/backgrounds/Monterey/Monterey-timed.xml</filename>
<filename>@BACKGROUNDDIR@/Monterey/Monterey-timed.xml</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#ffffff</pcolor>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
<wallpaper deleted="false">
<name>Sonoma Background</name>
<filename>@BACKGROUNDDIR@/Sonoma/Sonoma-light.jpg</filename>
<filename-dark>@BACKGROUNDDIR@/Sonoma/Sonoma-dark.jpg</filename-dark>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#51a2da</pcolor>
<scolor>#294172</scolor>
</wallpaper>
<wallpaper deleted="false">
<name>Sonoma Time of Day</name>
<filename>@BACKGROUNDDIR@/Sonoma/Sonoma-timed.xml</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#ffffff</pcolor>
<scolor>#000000</scolor>
</wallpaper>
</wallpapers>

View File

@@ -3,8 +3,8 @@
<wallpapers>
<wallpaper deleted="false">
<name>Ventura Background</name>
<filename>/usr/share/backgrounds/Ventura/Ventura-light.jpg</filename>
<filename-dark>/usr/share/backgrounds/Ventura/Ventura-dark.jpg</filename-dark>
<filename>@BACKGROUNDDIR@/Ventura/Ventura-light.jpg</filename>
<filename-dark>@BACKGROUNDDIR@/Ventura/Ventura-dark.jpg</filename-dark>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#51a2da</pcolor>
@@ -13,7 +13,7 @@
<wallpaper deleted="false">
<name>Ventura Time of Day</name>
<filename>/usr/share/backgrounds/Ventura/Ventura-timed.xml</filename>
<filename>@BACKGROUNDDIR@/Ventura/Ventura-timed.xml</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#ffffff</pcolor>

View File

@@ -3,8 +3,8 @@
<wallpapers>
<wallpaper deleted="false">
<name>WhiteSur Background</name>
<filename>/usr/share/backgrounds/WhiteSur/WhiteSur-light.jpg</filename>
<filename-dark>/usr/share/backgrounds/WhiteSur/WhiteSur.jpg</filename-dark>
<filename>@BACKGROUNDDIR@/WhiteSur/WhiteSur-light.jpg</filename>
<filename-dark>@BACKGROUNDDIR@/WhiteSur/WhiteSur.jpg</filename-dark>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#51a2da</pcolor>
@@ -13,8 +13,8 @@
<wallpaper deleted="false">
<name>WhiteSur Nord Background</name>
<filename>/usr/share/backgrounds/Wallpaper-nord/WhiteSur-nord-light.png</filename>
<filename-dark>/usr/share/backgrounds/Wallpaper-nord/WhiteSur-nord-dark.png</filename-dark>
<filename>@BACKGROUNDDIR@/Wallpaper-nord/WhiteSur-nord-light.png</filename>
<filename-dark>@BACKGROUNDDIR@/Wallpaper-nord/WhiteSur-nord-dark.png</filename-dark>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#6882b3</pcolor>
@@ -23,7 +23,7 @@
<wallpaper deleted="false">
<name>WhiteSur Time of Day</name>
<filename>/usr/share/backgrounds/WhiteSur/WhiteSur-timed.xml</filename>
<filename>@BACKGROUNDDIR@/WhiteSur/WhiteSur-timed.xml</filename>
<options>zoom</options>
<shade_type>solid</shade_type>
<pcolor>#ffffff</pcolor>

View File

@@ -13,39 +13,39 @@
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/usr/share/backgrounds/Monterey/Monterey-morning.jpg</file>
<file>@BACKGROUNDDIR@/Monterey/Monterey-morning.jpg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/usr/share/backgrounds/Monterey/Monterey-morning.jpg</from>
<to>/usr/share/backgrounds/Monterey/Monterey-light.jpg</to>
<from>@BACKGROUNDDIR@/Monterey/Monterey-morning.jpg</from>
<to>@BACKGROUNDDIR@/Monterey/Monterey-light.jpg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 5 hours ending at 6 PM. -->
<static>
<duration>18000.0</duration>
<file>/usr/share/backgrounds/Monterey/Monterey-light.jpg</file>
<file>@BACKGROUNDDIR@/Monterey/Monterey-light.jpg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 6 hours up until midnight. -->
<transition type="overlay">
<duration>21600.0</duration>
<from>/usr/share/backgrounds/Monterey/Monterey-light.jpg</from>
<to>/usr/share/backgrounds/Monterey/Monterey.jpg</to>
<from>@BACKGROUNDDIR@/Monterey/Monterey-light.jpg</from>
<to>@BACKGROUNDDIR@/Monterey/Monterey.jpg</to>
</transition>
<!-- It's midnight. It'll stay dark for 5 hours up until 5 AM. -->
<static>
<duration>18000.0</duration>
<file>/usr/share/backgrounds/Monterey/Monterey.jpg</file>
<file>@BACKGROUNDDIR@/Monterey/Monterey.jpg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/usr/share/backgrounds/Monterey/Monterey.jpg</from>
<to>/usr/share/backgrounds/Monterey/Monterey-morning.jpg</to>
<from>@BACKGROUNDDIR@/Monterey/Monterey.jpg</from>
<to>@BACKGROUNDDIR@/Monterey/Monterey-morning.jpg</to>
</transition>
</background>

View File

@@ -0,0 +1,51 @@
<background>
<starttime>
<year>2011</year>
<month>11</month>
<day>24</day>
<hour>7</hour>
<minute>00</minute>
<second>00</second>
</starttime>
<!-- This animation will start at 7 AM. -->
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>@BACKGROUNDDIR@/Sonoma/Sonoma-light.jpg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>@BACKGROUNDDIR@/Sonoma/Sonoma-light.jpg</from>
<to>@BACKGROUNDDIR@/Sonoma/Sonoma-light.jpg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 5 hours ending at 6 PM. -->
<static>
<duration>18000.0</duration>
<file>@BACKGROUNDDIR@/Sonoma/Sonoma-light.jpg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 6 hours up until midnight. -->
<transition type="overlay">
<duration>21600.0</duration>
<from>@BACKGROUNDDIR@/Sonoma/Sonoma-light.jpg</from>
<to>@BACKGROUNDDIR@/Sonoma/Sonoma-dark.jpg</to>
</transition>
<!-- It's midnight. It'll stay dark for 5 hours up until 5 AM. -->
<static>
<duration>18000.0</duration>
<file>@BACKGROUNDDIR@/Sonoma/Sonoma-dark.jpg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>@BACKGROUNDDIR@/Sonoma/Sonoma-dark.jpg</from>
<to>@BACKGROUNDDIR@/Sonoma/Sonoma-light.jpg</to>
</transition>
</background>

View File

@@ -13,39 +13,39 @@
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/usr/share/backgrounds/Ventura/Ventura-light.jpg</file>
<file>@BACKGROUNDDIR@/Ventura/Ventura-light.jpg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/usr/share/backgrounds/Ventura/Ventura-light.jpg</from>
<to>/usr/share/backgrounds/Ventura/Ventura-light.jpg</to>
<from>@BACKGROUNDDIR@/Ventura/Ventura-light.jpg</from>
<to>@BACKGROUNDDIR@/Ventura/Ventura-light.jpg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 5 hours ending at 6 PM. -->
<static>
<duration>18000.0</duration>
<file>/usr/share/backgrounds/Ventura/Ventura-light.jpg</file>
<file>@BACKGROUNDDIR@/Ventura/Ventura-light.jpg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 6 hours up until midnight. -->
<transition type="overlay">
<duration>21600.0</duration>
<from>/usr/share/backgrounds/Ventura/Ventura-light.jpg</from>
<to>/usr/share/backgrounds/Ventura/Ventura-dark.jpg</to>
<from>@BACKGROUNDDIR@/Ventura/Ventura-light.jpg</from>
<to>@BACKGROUNDDIR@/Ventura/Ventura-dark.jpg</to>
</transition>
<!-- It's midnight. It'll stay dark for 5 hours up until 5 AM. -->
<static>
<duration>18000.0</duration>
<file>/usr/share/backgrounds/Ventura/Ventura-dark.jpg</file>
<file>@BACKGROUNDDIR@/Ventura/Ventura-dark.jpg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/usr/share/backgrounds/Ventura/Ventura-dark.jpg</from>
<to>/usr/share/backgrounds/Ventura/Ventura-light.jpg</to>
<from>@BACKGROUNDDIR@/Ventura/Ventura-dark.jpg</from>
<to>@BACKGROUNDDIR@/Ventura/Ventura-light.jpg</to>
</transition>
</background>

View File

@@ -13,39 +13,39 @@
<!-- We start with sunrise at 7 AM. It will remain up for 1 hour. -->
<static>
<duration>3600.0</duration>
<file>/usr/share/backgrounds/WhiteSur/WhiteSur-morning.jpg</file>
<file>@BACKGROUNDDIR@/WhiteSur/WhiteSur-morning.jpg</file>
</static>
<!-- Sunrise starts to transition to day at 8 AM. The transition lasts for 5 hours, ending at 1 PM. -->
<transition type="overlay">
<duration>18000.0</duration>
<from>/usr/share/backgrounds/WhiteSur/WhiteSur-morning.jpg</from>
<to>/usr/share/backgrounds/WhiteSur/WhiteSur-light.jpg</to>
<from>@BACKGROUNDDIR@/WhiteSur/WhiteSur-morning.jpg</from>
<to>@BACKGROUNDDIR@/WhiteSur/WhiteSur-light.jpg</to>
</transition>
<!-- It's 1 PM, we're showing the day image in full force now, for 5 hours ending at 6 PM. -->
<static>
<duration>18000.0</duration>
<file>/usr/share/backgrounds/WhiteSur/WhiteSur-light.jpg</file>
<file>@BACKGROUNDDIR@/WhiteSur/WhiteSur-light.jpg</file>
</static>
<!-- It's 7 PM and it's going to start to get darker. This will transition for 6 hours up until midnight. -->
<transition type="overlay">
<duration>21600.0</duration>
<from>/usr/share/backgrounds/WhiteSur/WhiteSur-light.jpg</from>
<to>/usr/share/backgrounds/WhiteSur/WhiteSur.jpg</to>
<from>@BACKGROUNDDIR@/WhiteSur/WhiteSur-light.jpg</from>
<to>@BACKGROUNDDIR@/WhiteSur/WhiteSur.jpg</to>
</transition>
<!-- It's midnight. It'll stay dark for 5 hours up until 5 AM. -->
<static>
<duration>18000.0</duration>
<file>/usr/share/backgrounds/WhiteSur/WhiteSur.jpg</file>
<file>@BACKGROUNDDIR@/WhiteSur/WhiteSur.jpg</file>
</static>
<!-- It's 5 AM. We'll start transitioning to sunrise for 2 hours up until 7 AM. -->
<transition type="overlay">
<duration>7200.0</duration>
<from>/usr/share/backgrounds/WhiteSur/WhiteSur.jpg</from>
<to>/usr/share/backgrounds/WhiteSur/WhiteSur-morning.jpg</to>
<from>@BACKGROUNDDIR@/WhiteSur/WhiteSur.jpg</from>
<to>@BACKGROUNDDIR@/WhiteSur/WhiteSur-morning.jpg</to>
</transition>
</background>