69 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
#!/bin/sh
 | 
						|
  
 | 
						|
set -e
 | 
						|
 | 
						|
FILES_TO_DIVERT="
 | 
						|
/etc/lightdm/lightdm-gtk-greeter.conf
 | 
						|
/etc/plymouth/plymouthd.conf
 | 
						|
/etc/xdg/xfce4/helpers.rc
 | 
						|
/etc/xdg/qterminal.org/qterminal.ini
 | 
						|
/etc/xdg/xfce4/panel/default.xml
 | 
						|
/etc/xdg/xfce4/terminal/terminalrc
 | 
						|
/etc/xdg/xfce4/whiskermenu/defaults.rc
 | 
						|
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
 | 
						|
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
 | 
						|
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
 | 
						|
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
 | 
						|
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
 | 
						|
" # END FILES_TO_DIVERT
 | 
						|
 | 
						|
install_all() {
 | 
						|
    local opt=$1
 | 
						|
    for file in $FILES_TO_DIVERT
 | 
						|
    do
 | 
						|
       install_config_file "$file" "$opt"
 | 
						|
    done
 | 
						|
}
 | 
						|
 | 
						|
install_config_file() {
 | 
						|
    local file=$1
 | 
						|
    local opt=$2
 | 
						|
    local orig_file="/usr/share/kali-themes$file"
 | 
						|
    if [ "$opt" = "force" ] || ([ ! -e $file ] && [ -e $orig_file ]); then
 | 
						|
	echo "Installing $orig_file as $file"
 | 
						|
	mkdir -p $(dirname $file)
 | 
						|
	cp $orig_file $file
 | 
						|
    fi
 | 
						|
}
 | 
						|
 | 
						|
if [ "$1" = "configure" ]; then
 | 
						|
    if [ -z "$2" ]; then
 | 
						|
	# Initial install
 | 
						|
	install_all force
 | 
						|
    else
 | 
						|
	# Upgrade all files once
 | 
						|
	if dpkg --compare-versions "$2" lt "2019.4.15"; then
 | 
						|
	    install_all force
 | 
						|
	fi
 | 
						|
	# Install remaining new files
 | 
						|
	install_all
 | 
						|
    fi
 | 
						|
    # Configure /root/.face to have a red-background avatar
 | 
						|
    if [ ! -e /root/.face ]; then
 | 
						|
	cp /usr/share/icons/Flat-Remix-Blue-Dark/apps/scalable/avatar-root.svg /root/.face
 | 
						|
    fi
 | 
						|
    # Copy grub theme to /boot
 | 
						|
    mkdir -p /boot/grub/themes/kali
 | 
						|
    cp -r /usr/share/grub/themes/kali/* /boot/grub/themes/kali/
 | 
						|
    # Rebuild the grub configuration with our config changes
 | 
						|
    if which update-grub >/dev/null; then
 | 
						|
	update-grub || true
 | 
						|
    fi
 | 
						|
    # Rebuild the initrd for plymouth
 | 
						|
    if which update-initramfs >/dev/null; then
 | 
						|
	update-initramfs -u
 | 
						|
    fi
 | 
						|
fi
 | 
						|
 | 
						|
#DEBHELPER#
 |