Sync with desktop-base

This commit is contained in:
Sophie Brun
2019-10-22 10:19:07 +02:00
parent ca6b2e813a
commit d8cdd711ad
58 changed files with 76066 additions and 2 deletions
+4 -2
View File
@@ -3,8 +3,10 @@ Section: misc
Priority: optional
Maintainer: Kali Developers <devel@kali.org>
Uploaders: Daniel Ruiz de Alegría <daniel@drasite.com>, Raphaël Hertzog <raphael@offensive-security.com>
Build-Depends: debhelper-compat (= 12)
Standards-Version: 4.4.0
Build-Depends: debhelper-compat (= 12),
librsvg2-bin,
optipng,
Standards-Version: 4.4.1
Vcs-Git: https://gitlab.com/kalilinux/packages/kali-themes.git
Vcs-Browser: https://gitlab.com/kalilinux/packages/kali-themes
+209
View File
@@ -0,0 +1,209 @@
#!/bin/sh
set -e
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ]; then
# Vendor logo alternative
update-alternatives --install \
/usr/share/images/vendor-logos \
vendor-logos \
/usr/share/kali-theme-common/kali-logos 60 \
--slave /usr/share/icons/vendor/64x64/emblems/emblem-vendor.png \
emblem-vendor-64 \
/usr/share/icons/kali-theme-common/64x64/emblems/emblem-kali.png \
--slave /usr/share/icons/vendor/128x128/emblems/emblem-vendor.png \
emblem-vendor-128 \
/usr/share/icons/kali-theme-common/128x128/emblems/emblem-kali.png \
--slave /usr/share/icons/vendor/256x256/emblems/emblem-vendor.png \
emblem-vendor-256 \
/usr/share/icons/kali-theme-common/256x256/emblems/emblem-kali.png \
--slave /usr/share/icons/vendor/scalable/emblems/emblem-vendor.svg \
emblem-vendor-scalable \
/usr/share/icons/kali-theme-common/scalable/emblems/emblem-kali.svg \
# Theme package alternatives
while read theme priority; do
update-alternatives --install \
/usr/share/desktop-base/active-theme \
desktop-theme \
/usr/share/kali-theme-common/$theme-theme $priority
done << EOF
kali 60
EOF
# Use active theme as highest priority for background
active_background=/usr/share/desktop-base/active-theme/wallpaper/contents/images/1920x1080.svg
if [ -e ${active_background} ]; then
update-alternatives --install \
/usr/share/images/desktop-base/desktop-background \
desktop-background ${active_background} 70
fi
# Alternatives for the background in theme packages
while read theme filename priority; do
update-alternatives --install \
/usr/share/images/desktop-base/desktop-background \
desktop-background \
/usr/share/kali-theme-common/$theme-theme/wallpaper/contents/images/$filename $priority
done << EOF
kali 1024x768.svg 67
kali 1280x720.svg 67
kali 1280x800.svg 67
kali 1280x1024.svg 67
kali 1600x1200.svg 67
kali 1920x1080.svg 67
kali 1920x1200.svg 67
kali 2560x1440.svg 67
kali 2560x1600.svg 67
kali 3840x2160.svg 67
EOF
# Set up an alternative for the XML version of the background
# (for GNOME)
# Highest priority for active theme
active_background_xml=/usr/share/desktop-base/active-theme/wallpaper/gnome-background.xml
if [ -e ${active_background_xml} ]; then
update-alternatives --install \
/usr/share/images/desktop-base/desktop-background.xml \
desktop-background.xml ${active_background_xml} 50
fi
# Alternatives for theme packages
while read theme priority; do
update-alternatives --install \
/usr/share/images/desktop-base/desktop-background.xml \
desktop-background.xml \
/usr/share/kali-theme-common/$theme-theme/wallpaper/gnome-background.xml $priority
done << EOF
kali 45
EOF
# Set up an alternative for the XML version of the lock screen
# (for GNOME)
# Highest priority for active theme
active_lockscreen=/usr/share/desktop-base/active-theme/lockscreen/gnome-background.xml
if [ -e ${active_lockscreen} ]; then
update-alternatives --install \
/usr/share/images/desktop-base/desktop-lockscreen.xml \
desktop-lockscreen.xml ${active_lockscreen} 50
fi
# Alternatives for theme packages
while read theme priority; do
update-alternatives --install \
/usr/share/images/desktop-base/desktop-lockscreen.xml \
desktop-lockscreen.xml \
/usr/share/kali-theme-common/$theme-theme/lockscreen/gnome-background.xml $priority
done << EOF
kali 45
EOF
# Set up an alternative for the wallpaper for Plasma 5/KDE
# Highest priority for active theme
active_plasma_wallpaper=/usr/share/desktop-base/active-theme/wallpaper
if [ -e ${active_plasma_wallpaper} ]; then
update-alternatives --install \
/usr/share/wallpapers/DebianTheme \
desktop-plasma5-wallpaper ${active_plasma_wallpaper} 50
fi
# Alternatives for theme packages
while read theme priority; do
update-alternatives --install \
/usr/share/wallpapers/DebianTheme \
desktop-plasma5-wallpaper \
/usr/share/kali-theme-common/$theme-theme/wallpaper $priority
done << EOF
kali 45
EOF
# Login theme
# Highest priority for active theme
active_login_background=/usr/share/desktop-base/active-theme/login/background.svg
if [ -e ${active_login_background} ]; then
update-alternatives --install /usr/share/images/desktop-base/login-background.svg \
desktop-login-background ${active_login_background} 50
fi
# Alternatives for theme packages
while read theme background priority; do
update-alternatives --install /usr/share/images/desktop-base/login-background.svg \
desktop-login-background \
/usr/share/kali-theme-common/$theme-theme/login/$background $priority
done << EOF
kali background.svg 45
EOF
# Set up an alternative for the GRUB background/colors config
# Highest priority for active theme
# Favor widescreen / hi-res background for efi installations detected
# by the presence of grub-efi* packages (not the grub-efi*-bin which dont
# necessary account for grub being the active bootloader).
if dpkg-query --list grub-efi* | grep -v "^... grub-efi[^[:space:]]*-bin" | grep -q "^[ih][HUFWti] " ; then
echo "grub-efi* packages found, using 16/9 as default grub background ratio"
grub_first_ratio="16x9"
grub_second_ratio="4x3"
else
echo "No grub-efi* package found, using 4/3 as default grub background ratio"
grub_first_ratio="4x3"
grub_second_ratio="16x9"
fi
active_grub_background=/usr/share/desktop-base/active-theme/grub/grub_background.sh
active_grub_first_ratio=/usr/share/desktop-base/active-theme/grub/grub-${grub_first_ratio}.png
if [ -e ${active_grub_first_ratio} ] && [ -e ${active_grub_background} ]; then
update-alternatives --install \
/usr/share/images/desktop-base/desktop-grub.png \
desktop-grub ${active_grub_first_ratio} 50 \
--slave /usr/share/desktop-base/grub_background.sh \
desktop-grub.sh ${active_grub_background}
fi
active_grub_second_ratio=/usr/share/desktop-base/active-theme/grub/grub-${grub_second_ratio}.png
if [ -e ${active_grub_second_ratio} ] && [ -e ${active_grub_background} ]; then
update-alternatives --install \
/usr/share/images/desktop-base/desktop-grub.png \
desktop-grub ${active_grub_second_ratio} 45 \
--slave /usr/share/desktop-base/grub_background.sh \
desktop-grub.sh ${active_grub_background}
fi
# Alternatives for theme packages
while read theme ratio priority; do
update-alternatives --install /usr/share/images/desktop-base/desktop-grub.png \
desktop-grub \
/usr/share/kali-theme-common/$theme-theme/grub/grub-$ratio.png $priority \
--slave /usr/share/desktop-base/grub_background.sh \
desktop-grub.sh \
/usr/share/kali-theme-common/$theme-theme/grub/grub_background.sh
done << EOF
kali 4x3 45
kali 16x9 45
EOF
# Apply GRUB background update into /boot
# Try detecting active grub packages (so not -doc, -common, -bin) as a hint
# that GRUB is being used as bootloader before calling update-grub.
# Some people use the *-bin packages without using GRUB as bootloader
# (see #851893 for more context).
if dpkg-query --list "grub-*" | grep -v "^... grub\(-common\|-emu\|[^[:space:]]*\(-bin\|-doc\)\)" | grep -q "^[ih][HUFWti] " \
&& which update-grub > /dev/null ; then
# Ensure the background image file has actually been written to disc
# before updating.
sync
# Report success whatever grub return status. This is needed at least
# in live systems fon installation to succeed (see #850601).
# Until we find a better solution like detecting were in a live image
# and not calling update-grub at all.
update-grub || echo "Updating grub failed, report success anyway!"
fi
if which update-initramfs > /dev/null; then
update-initramfs -u
fi
fi
# Set Kali as default plymouth theme
if [ "${1}" = "configure" ] && dpkg --compare-versions "$2" lt "10.0.2+kali3"; then
if which plymouth-set-default-theme > /dev/null; then
plymouth-set-default-theme kali
if which update-initramfs > /dev/null; then
update-initramfs -u
fi
fi
fi
#DEBHELPER#
+144
View File
@@ -0,0 +1,144 @@
#!/bin/sh
set -e
if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
# Remove vendor logos alternative, all slaves get removed automatically
update-alternatives --remove \
vendor-logos \
/usr/share/desktop-base/kali-logos
# Remove background alternatives for theme packages
while read theme filename; do
update-alternatives --remove \
desktop-background \
/usr/share/desktop-base/$theme-theme/wallpaper/contents/images/$filename $priority
done << EOF
kali 1024x768.svg
kali 1280x720.svg
kali 1280x800.svg
kali 1280x1024.svg
kali 1600x1200.svg
kali 1920x1080.svg
kali 1920x1200.svg
kali 2560x1440.svg
kali 2560x1600.svg
kali 3840x2160.svg
EOF
# *Last* remove background *highest priority* alternatives for active theme
update-alternatives --remove desktop-background /usr/share/desktop-base/active-theme/wallpaper/contents/images/1920x1080.svg
# Remove desktop-background.xml alternatives
# For theme packages
while read theme; do
update-alternatives --remove \
desktop-background.xml \
/usr/share/desktop-base/$theme-theme/wallpaper/gnome-background.xml $priority
done << EOF
kali
EOF
# *Lastly* remove *highest priority* alternative for active theme
update-alternatives --remove \
desktop-background.xml \
/usr/share/desktop-base/active-theme/wallpaper/gnome-background.xml
# Remove desktop-lockscreen.xml alternatives
# For theme packages
while read theme; do
update-alternatives --remove \
desktop-lockscreen.xml \
/usr/share/desktop-base/$theme-theme/lockscreen/gnome-background.xml $priority
done << EOF
kali
EOF
# *Last* remove *highest priority* alternative for active theme
update-alternatives --remove \
desktop-lockscreen.xml \
/usr/share/desktop-base/active-theme/lockscreen/gnome-background.xml
# Remove Plasma 5/KDE wallpaper alternatives
# For theme packages
while read theme; do
update-alternatives --remove \
desktop-plasma5-wallpaper \
/usr/share/desktop-base/$theme-theme/wallpaper
done << EOF
kali
EOF
# *Last* remove *highest priority* alternative for active theme
update-alternatives --remove \
desktop-plasma5-wallpaper \
/usr/share/desktop-base/active-theme/wallpaper
# Remove login theme alternatives
# For theme packages
# Alternative for theme packages
while read theme background; do
update-alternatives --remove \
desktop-login-background \
/usr/share/desktop-base/$theme-theme/login/$background
done << EOF
kali background.svg
EOF
# *Last* remove *highest priority* alternative for active theme
update-alternatives --remove \
desktop-login-background \
/usr/share/desktop-base/active-theme/login/background.svg
# Remove GRUB alternatives
# Remove alternative for the GRUB background/colors config
while read theme priority; do
update-alternatives --remove \
desktop-grub.sh \
/usr/share/desktop-base/$theme-theme/grub/grub_background.sh
done << EOF
kali
EOF
# Remove background alternatives
while read theme ratio; do
update-alternatives --remove \
desktop-grub.sh \
/usr/share/desktop-base/$theme-theme/grub/grub_background.sh
update-alternatives --remove \
desktop-grub \
/usr/share/desktop-base/$theme-theme/grub/grub-$ratio.png
done << EOF
kali 4x3
kali 16x9
EOF
## *Lastly* remove *highest priority* alternative
num_grub_efi_installed=$(dpkg-query --list "grub-efi*" 2> /dev/null | grep "^i" | wc -l)
if [ $num_grub_efi_installed -gt 0 ] ; then
remove_first_ratio=4x3
remove_last_ratio=16x9
else
remove_first_ratio=16x9
remove_last_ratio=4x3
fi
update-alternatives --remove \
desktop-grub.sh \
/usr/share/desktop-base/active-theme/grub/grub_background.sh
update-alternatives --remove \
desktop-grub \
/usr/share/desktop-base/active-theme/grub/grub-$remove_first_ratio.png
update-alternatives --remove \
desktop-grub \
/usr/share/desktop-base/active-theme/grub/grub-$remove_last_ratio.png
# Remove theme package alternatives
while read theme; do
update-alternatives --remove \
desktop-theme \
/usr/share/desktop-base/$theme-theme
done << EOF
kali
EOF
## *Lastly* remove *highest priority* alternative
update-alternatives --remove \
desktop-theme \
/usr/share/desktop-base/futureprototype-theme
fi
# Tag to allow some debhelper commands to inject relevant code
#DEBHELPER#
+5
View File
@@ -3,3 +3,8 @@ Color-Schemes/* usr/share/
Icon-Theme/* usr/share/icons/
Window-Theme/* usr/share/themes/
Grub-Theme/* boot/grub/themes/
usr/share/desktop-base/
usr/share/icons/
usr/share/plymouth/
usr/share/gnome-background-properties/
usr/share/wallpapers/