Commits

Ulrich Hansen committed 0aba166

Prepare for the use of more than one desktop-theme-packages.

  • Participants
  • Parent commits f855f4a

Comments (0)

Files changed (1)

 
 set -e
 
+# Count the previously installed desktop-theme-packages in /usr/share
+# and add their number to the priority. So the last installed package
+# always gets the highest priority.
+
+base_priority=90
+desktop_theme_packages=$(/usr/bin/find /usr/share/desktop-theme-* -prune | /usr/bin/wc -l)
+priority=$((base_priority+$desktop_theme_packages))
+
 install_alternatives() {
     update-alternatives --install \
         /usr/share/images/desktop-base/desktop-background \
         desktop-background \
-        /usr/share/desktop-theme-growing/backgrounds/growing-wallpaper.png 90
+        /usr/share/desktop-theme-growing/backgrounds/growing-wallpaper.png $priority
 
     update-alternatives --install \
         /usr/share/images/desktop-base/desktop-background.xml \
         desktop-background.xml \
-        /usr/share/desktop-theme-growing/backgrounds/growing-gnome-lockscreen.xml 90
+        /usr/share/desktop-theme-growing/backgrounds/growing-gnome-lockscreen.xml $priority
 
     update-alternatives --install \
         /usr/share/gdm/dconf/15-desktop-theme-settings \
         desktop-gdm3-background \
-        /usr/share/desktop-theme-growing/gdm3/growing-gdm3-background.conf 90
+        /usr/share/desktop-theme-growing/gdm3/growing-gdm3-background.conf $priority
 
     update-alternatives --install \
         /usr/share/images/desktop-base/desktop-grub.png \
         desktop-grub \
-        /usr/share/desktop-theme-growing/grub/growing-grub.png 90
+        /usr/share/desktop-theme-growing/grub/growing-grub.png $priority
 
     update-alternatives --install \
 	/usr/share/images/desktop-base/desktop-grub-theme \
 	desktop-grub-theme \
-	/usr/share/desktop-theme-growing/grub/theme/theme.txt 90
+	/usr/share/desktop-theme-growing/grub/theme/theme.txt $priority
 
     update-alternatives --install \
 	/usr/share/desktop-base/profiles/kde-profile/share/config/ksplashrc \
 	desktop-ksplash \
-	/usr/share/desktop-theme-growing/ksplash/growing-ksplash.conf 90
+	/usr/share/desktop-theme-growing/ksplash/growing-ksplash.conf $priority
 
     update-alternatives --install \
         /etc/default/kdm.d/15_desktop-theme \
         desktop-kdm-theme \
-        /usr/share/desktop-theme-growing/kdm-theme/growing-kdm-theme.conf 90
+        /usr/share/desktop-theme-growing/kdm-theme/growing-kdm-theme.conf $priority
 
     update-alternatives --install \
         /usr/share/kde4/apps/plasma-desktop/init/15-desktop-theme.js \
         desktop-kde-wallpaper \
-        /usr/share/desktop-theme-growing/kde-wallpaper/growing-kde-wallpaper.conf 90
+        /usr/share/desktop-theme-growing/kde-wallpaper/growing-kde-wallpaper.conf $priority
 
     update-alternatives --install \
 	/usr/share/images/desktop-base/desktop-login \
 	desktop-login \
-	/usr/share/desktop-theme-growing/backgrounds/growing-login.png 90
+	/usr/share/desktop-theme-growing/backgrounds/growing-login.png $priority
 }
 
 set_alternatives_auto() {