start supporting KDE

This commit is contained in:
Tobias Powalowski 2022-05-20 10:32:26 +02:00
parent e1159e1481
commit 5f16a793c7
5 changed files with 341 additions and 267 deletions

View file

@ -4,21 +4,24 @@ _PACKAGES="base linux linux-firmware linux-firmware-marvell"
# grub setup # grub setup
_GRUB_CONFIG="/usr/share/archboot/grub/archboot-main-grub.cfg" _GRUB_CONFIG="/usr/share/archboot/grub/archboot-main-grub.cfg"
_GRUB_BACKGROUND="/usr/share/archboot/grub/archboot-background.png" _GRUB_BACKGROUND="/usr/share/archboot/grub/archboot-background.png"
### XFCE defaults ### X defaults
# needed full installed packages in environment for X # needed full installed packages in environment for X
_FULL_PACKAGES="libunwind libelf libevent python talloc gdbm fuse3 gcc-libs perl glibc libtiff glib2 libcups harfbuzz avahi nss p11-kit libp11-kit fuse tpm2-tss libsecret smbclient libcap tevent libbsd libldap tdb ldb libmd jansson libsasl pcre2" _X_PACKAGES="libunwind libelf libevent python talloc gdbm fuse3 gcc-libs perl glibc libtiff glib2 libcups harfbuzz avahi nss p11-kit libp11-kit fuse tpm2-tss libsecret smbclient libcap tevent libbsd libldap tdb ldb libmd jansson libsasl pcre2 xorg tigervnc gparted nss-mdns"
# ignore packages to upgrade before X startup eg. kernel and firmware # ignore packages to upgrade before X startup eg. kernel and firmware
_X_IGNORE="linux linux-firmware linux-firmware-marvell" _X_IGNORE="linux linux-firmware linux-firmware-marvell"
# X packages
_X_PACKAGES="xorg chromium xfce4 tigervnc breeze-icons gvfs gvfs-smb thunar-archive-plugin file-roller gparted gnome-keyring nss-mdns mousepad ristretto"
# don't show in xfce menu
_HIDE_MENU="xfce4-mail-reader xfce4-about"
# VNC password # VNC password
_VNC_PW="archboot" _VNC_PW="archboot"
### XFCE defaults
# Xfce packages
_XFCE_PACKAGES="chromium xfce4 breeze-icons gvfs gvfs-smb thunar-archive-plugin file-roller gnome-keyring mousepad ristretto"
# don't show in xfce menu
_HIDE_MENU="xfce4-mail-reader xfce4-about"
### KDE defaults
_KDE_PACKAGES="chromium plasma-desktop konsole kscreen kate dolphin"
### zram setup ### zram setup
_ZRAM_ALGORITHM="zstd" _ZRAM_ALGORITHM="zstd"
# size for /usr.zram # size for /usr.zram
_ZRAM_USR="1900M" _ZRAM_USR="3G"
# size for --latest and --latest-install option # size for --latest and --latest-install option
_ZRAM_SIZE="3G" _ZRAM_SIZE="3G"
# size used for --latest-image option # size used for --latest-image option

View file

@ -4,6 +4,8 @@
. /usr/lib/archboot/common.sh . /usr/lib/archboot/common.sh
. /usr/lib/archboot/container.sh . /usr/lib/archboot/container.sh
. /usr/lib/archboot/update-installer.sh . /usr/lib/archboot/update-installer.sh
. /usr/lib/archboot/xfce.sh
. /usr/lib/archboot/kde.sh
[[ -z "${1}" ]] && usage [[ -z "${1}" ]] && usage
@ -14,6 +16,7 @@ while [ $# -gt 0 ]; do
-latest-install|--latest-install) _L_INSTALL_COMPLETE="1";; -latest-install|--latest-install) _L_INSTALL_COMPLETE="1";;
-latest-image|--latest-image) _G_RELEASE="1" ;; -latest-image|--latest-image) _G_RELEASE="1" ;;
-launch-xfce|--launch-xfce) _L_XFCE="1" ;; -launch-xfce|--launch-xfce) _L_XFCE="1" ;;
-launch-kde|--launch-kde) _L_KDE="1" ;;
-h|--h|?) usage ;; -h|--h|?) usage ;;
*) usage ;; *) usage ;;
esac esac
@ -82,24 +85,32 @@ if [[ "${_G_RELEASE}" == "1" ]]; then
echo -e "\033[1mFinished:\033[0m New isofiles are located in ${_W_DIR}" echo -e "\033[1mFinished:\033[0m New isofiles are located in ${_W_DIR}"
fi fi
# Launch xfce # X launch
if [[ "${_L_XFCE}" == "1" ]]; then if [[ "${_L_XFCE}" == "1" || "${_L_KDE}" == "1" ]]; then
if ! [[ -e /usr/bin/startxfce4 ]]; then if ! [[ -d /usr.zram ]]; then
echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram ..." echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram ..."
_zram_usr "${_ZRAM_USR}" _zram_usr "${_ZRAM_USR}"
else
echo -e "\033[1mStep 1/5:\033[0m Move /usr to /usr.zram already done ..."
fi
echo -e "\033[1mStep 2/5:\033[0m Waiting for gpg pacman keyring import to finish ..." echo -e "\033[1mStep 2/5:\033[0m Waiting for gpg pacman keyring import to finish ..."
_gpg_check _gpg_check
echo -e "\033[1mStep 3/5:\033[0m Installing XFCE desktop now ..." # Launch xfce
echo " This will need some time ..." if [[ "${_L_XFCE}" == "1" ]]; then
_prepare_xfce >/dev/tty7 2>&1 _install_xfce
echo -e "\033[1mStep 4/5:\033[0m Configuring XFCE desktop ..." fi
_configure_xfce >/dev/tty7 2>&1 if [[ "${_L_KDE}" == "1" ]]; then
_install_kde
fi
echo -e "\033[1mStep 5/5:\033[0m Starting avahi-daemon ..." echo -e "\033[1mStep 5/5:\033[0m Starting avahi-daemon ..."
systemctl start avahi-daemon.service systemctl start avahi-daemon.service
_autostart_vnc
if [[ "${_L_XFCE}" == "1" ]]; then
_start_xfce
fi fi
echo "Setting VNC password /etc/tigervnc/passwd to ${_VNC_PW} ..." if [[ "${_L_KDE}" == "1" ]]; then
echo "${_VNC_PW}" | vncpasswd -f > /etc/tigervnc/passwd _start_kde
echo -e "Launching XFCE now, logging is done on \033[1m/dev/tty8\033[0m ..."
startxfce4 >/dev/tty8 2>&1
echo -e "To relaunch XFCE desktop use: \033[92mstartxfce4\033[0m"
fi fi
fi

37
usr/lib/archboot/kde.sh Normal file
View file

@ -0,0 +1,37 @@
#!/bin/bash
# created by Tobias Powalowski <tpowa@archlinux.org>
_install_kde() {
if ! [[ -e /usr/bin/startplasma-x11 ]]; then
echo -e "\033[1mStep 3/5:\033[0m Installing KDE desktop now ..."
echo " This will need some time ..."
_prepare_x _KDE_PACKAGES >/dev/tty7 2>&1
echo -e "\033[1mStep 4/5:\033[0m Configuring KDE desktop ..."
_configure_kde >/dev/tty7 2>&1
fi
}
_start_kde() {
echo -e "Launching KDE now, logging is done on \033[1m/dev/tty8\033[0m ..."
echo startplasma-x11 > /root/.xinitrc
startx >/dev/tty8 2>&1
echo -e "To relaunch KDE desktop use: \033[92mstartx\033[0m"
}
_configure_kde() {
echo "Configuring KDE panel ..."
#echo "Adding gparted to xfce top level menu ..."
#sed -i -e 's#Categories=.*#Categories=X-Xfce-Toplevel;#g' /usr/share/applications/gparted.desktop
#echo "Hiding ${_HIDE_MENU} menu entries ..."
#for i in ${_HIDE_MENU}; do
# echo 'NoDisplay=true' >> /usr/share/applications/"${i}".desktop
#done
#echo "Autostarting setup ..."
cat << EOF > /etc/xdg/autostart/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
Exec=konsole /usr/bin/setup
Icon=system-software-install
EOF
}

View file

@ -81,7 +81,7 @@ _download_latest() {
for i in ${BINS}; do for i in ${BINS}; do
[[ -e "${_BIN}/${i}" ]] && wget -q "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false" -O "${_BIN}/${i}" [[ -e "${_BIN}/${i}" ]] && wget -q "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false" -O "${_BIN}/${i}"
done done
LIBS="common.sh container.sh release.sh iso.sh update-installer.sh" LIBS="common.sh container.sh release.sh iso.sh update-installer.sh xfce.sh kde.sh"
for i in ${LIBS}; do for i in ${LIBS}; do
wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}" wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}"
done done
@ -287,14 +287,14 @@ _cleanup_cache() {
done done
} }
_prepare_xfce() { _prepare_x() {
echo "Removing firmware files ..." echo "Removing firmware files ..."
rm -rf /usr/lib/firmware rm -rf /usr/lib/firmware
# fix libs first, then install packages from defaults # fix libs first, then install packages from defaults
_XORG="${_FULL_PACKAGES} ${_X_PACKAGES}" _XORG="${_X_PACKAGES} ${1}"
# saving RAM by calling always cleanup hook and installing each package alone # saving RAM by calling always cleanup hook and installing each package alone
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
echo "Running pacman to install packages: ${_FULL_PACKAGES} ${_X_PACKAGES} ..." echo "Running pacman to install packages: ${_XORG} ..."
_INSTALL_SOURCE="file:///var/cache/pacman/pkg" _INSTALL_SOURCE="file:///var/cache/pacman/pkg"
_create_pacman_conf _create_pacman_conf
#shellcheck disable=SC2086 #shellcheck disable=SC2086
@ -317,7 +317,7 @@ _prepare_xfce() {
#shellcheck disable=SC2086 #shellcheck disable=SC2086
pacman -Syu ${_IGNORE} --noconfirm >/dev/null 2>&1 || exit 1 pacman -Syu ${_IGNORE} --noconfirm >/dev/null 2>&1 || exit 1
_cleanup_install _cleanup_install
echo "Running pacman to install packages: ${_FULL_PACKAGES} ${_X_PACKAGES} ..." echo "Running pacman to install packages: ${_XORG} ..."
for i in ${_XORG}; do for i in ${_XORG}; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
pacman -S ${i} --noconfirm >/dev/null 2>&1 || exit 1 pacman -S ${i} --noconfirm >/dev/null 2>&1 || exit 1
@ -335,244 +335,9 @@ _prepare_xfce() {
rm -rf /usr/share/{locale,i18n} rm -rf /usr/share/{locale,i18n}
} }
_configure_xfce() { _autostart_vnc() {
echo "Configuring xfce panel ..." echo "Setting VNC password /etc/tigervnc/passwd to ${_VNC_PW} ..."
cat << EOF >/etc/xdg/xfce4/panel/default.xml echo "${_VNC_PW}" | vncpasswd -f > /etc/tigervnc/passwd
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-panel" version="1.0">
<property name="configver" type="int" value="2"/>
<property name="panels" type="array">
<value type="int" value="1"/>
<value type="int" value="2"/>
<property name="dark-mode" type="bool" value="true"/>
<property name="panel-1" type="empty">
<property name="position" type="string" value="p=6;x=0;y=0"/>
<property name="length" type="uint" value="100"/>
<property name="position-locked" type="bool" value="true"/>
<property name="icon-size" type="uint" value="16"/>
<property name="size" type="uint" value="26"/>
<property name="plugin-ids" type="array">
<value type="int" value="1"/>
<value type="int" value="2"/>
<value type="int" value="3"/>
<value type="int" value="4"/>
<value type="int" value="5"/>
<value type="int" value="6"/>
<value type="int" value="7"/>
<value type="int" value="8"/>
<value type="int" value="9"/>
<value type="int" value="10"/>
<value type="int" value="11"/>
<value type="int" value="12"/>
<value type="int" value="13"/>
<value type="int" value="14"/>
</property>
</property>
<property name="panel-2" type="empty">
<property name="autohide-behavior" type="uint" value="1"/>
<property name="position" type="string" value="p=10;x=0;y=0"/>
<property name="length" type="uint" value="1"/>
<property name="position-locked" type="bool" value="true"/>
<property name="size" type="uint" value="48"/>
<property name="plugin-ids" type="array">
<value type="int" value="15"/>
<value type="int" value="16"/>
<value type="int" value="17"/>
<value type="int" value="18"/>
<value type="int" value="19"/>
<value type="int" value="20"/>
<value type="int" value="21"/>
<value type="int" value="22"/>
</property>
</property>
</property>
<property name="plugins" type="empty">
<property name="plugin-1" type="string" value="applicationsmenu"/>
<property name="plugin-2" type="string" value="tasklist">
<property name="grouping" type="uint" value="1"/>
</property>
<property name="plugin-3" type="string" value="separator">
<property name="expand" type="bool" value="true"/>
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-4" type="string" value="pager"/>
<property name="plugin-5" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-6" type="string" value="systray">
<property name="square-icons" type="bool" value="true"/>
</property>
<property name="plugin-8" type="string" value="pulseaudio">
<property name="enable-keyboard-shortcuts" type="bool" value="true"/>
<property name="show-notifications" type="bool" value="true"/>
</property>
<property name="plugin-9" type="string" value="power-manager-plugin"/>
<property name="plugin-10" type="string" value="notification-plugin"/>
<property name="plugin-11" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-12" type="string" value="clock"/>
<property name="plugin-13" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-14" type="string" value="actions"/>
<property name="plugin-15" type="string" value="showdesktop"/>
<property name="plugin-16" type="string" value="separator"/>
<property name="plugin-17" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-terminal-emulator.desktop"/>
</property>
</property>
<property name="plugin-18" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-file-manager.desktop"/>
</property>
</property>
<property name="plugin-19" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-web-browser.desktop"/>
</property>
</property>
<property name="plugin-20" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="gparted.desktop"/>
</property>
</property>
<property name="plugin-21" type="string" value="separator"/>
<property name="plugin-22" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="archboot.desktop"/>
</property>
</property>
</property>
</channel>
EOF
echo "Setting breeze as default icons..."
sed -i -e 's#<property name="IconThemeName" type="string" value="Adwaita"/>#<property name="IconThemeName" type="string" value="breeze"/>#g' \
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
echo "Setting archboot background image ..."
cat << EOF >/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-desktop" version="1.0">
<property name="backdrop" type="empty">
<property name="screen0" type="empty">
<property name="monitor0" type="empty">
<property name="image-path" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-single-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="image-show" type="bool" value="true"/>
<property name="image-style" type="int" value="0"/>
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorVNC-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorHDMI1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
</property>
</property>
</channel>
EOF
echo "Replacing appfinder launcher with gparted ..."
sed -i -e 's#xfce4-appfinder#gparted#g' /etc/xdg/xfce4/panel/default.xml
echo "Replacing directory menu launcher with setup ..."
sed -i -e 's#directorymenu#archboot#g' /etc/xdg/xfce4/panel/default.xml
echo "Setting chromium as default browser ..."
sed -i -e 's#firefox#chromium#g' /etc/xdg/xfce4/helpers.rc
echo "Adding chromium flags to /etc/chromium-flags.conf ..."
cat << EOF >/etc/chromium-flags.conf
--no-sandbox
--test-type
--incognito
wiki.archlinux.org/title/Archboot
EOF
echo "Replacing menu structure ..."
cat << EOF >/etc/xdg/menus/xfce-applications.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>Xfce</Name>
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<Include>
<Category>X-Xfce-Toplevel</Category>
</Include>
<Layout>
<Filename>archboot.desktop</Filename>
<Filename>gparted.desktop</Filename>
<Filename>xfce4-run.desktop</Filename>
<Separator/>
<Filename>xfce4-terminal-emulator.desktop</Filename>
<Filename>xfce4-file-manager.desktop</Filename>
<Filename>xfce4-web-browser.desktop</Filename>
<Separator/>
<Menuname>Settings</Menuname>
<Separator/>
<Merge type="all"/>
<Separator/>
<Filename>xfce4-session-logout.desktop</Filename>
</Layout>
<Menu>
<Name>Settings</Name>
<Directory>xfce-settings.directory</Directory>
<Include>
<Category>Settings</Category>
</Include>
<Layout>
<Filename>xfce-settings-manager.desktop</Filename>
<Separator/>
<Merge type="all"/>
</Layout>
<Menu>
<Name>Screensavers</Name>
<Directory>xfce-screensavers.directory</Directory>
<Include>
<Category>Screensaver</Category>
</Include>
</Menu>
</Menu>
<DefaultMergeDirs/>
</Menu>
EOF
echo "Adding gparted to xfce top level menu ..."
sed -i -e 's#Categories=.*#Categories=X-Xfce-Toplevel;#g' /usr/share/applications/gparted.desktop
echo "Hiding ${_HIDE_MENU} menu entries ..."
for i in ${_HIDE_MENU}; do
echo 'NoDisplay=true' >> /usr/share/applications/"${i}".desktop
done
echo "Autostarting setup ..."
cat << EOF > /etc/xdg/autostart/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
Exec=xfce4-terminal -x /usr/bin/setup
Icon=system-software-install
Categories=X-Xfce-Toplevel;
EOF
cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/archboot.desktop cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/archboot.desktop
echo "Autostarting tigervnc ..." echo "Autostarting tigervnc ..."
cat << EOF > /etc/xdg/autostart/tigervnc.desktop cat << EOF > /etc/xdg/autostart/tigervnc.desktop

258
usr/lib/archboot/xfce.sh Normal file
View file

@ -0,0 +1,258 @@
#!/bin/bash
# created by Tobias Powalowski <tpowa@archlinux.org>
_install_xfce() {
if ! [[ -e /usr/bin/startxfce4 ]]; then
echo -e "\033[1mStep 3/5:\033[0m Installing XFCE desktop now ..."
echo " This will need some time ..."
_prepare_x _XFCE_PACKAGES >/dev/tty7 2>&1
echo -e "\033[1mStep 4/5:\033[0m Configuring XFCE desktop ..."
_configure_xfce >/dev/tty7 2>&1
fi
}
_start_xcfce() {
echo -e "Launching XFCE now, logging is done on \033[1m/dev/tty8\033[0m ..."
startxfce4 >/dev/tty8 2>&1
echo -e "To relaunch XFCE desktop use: \033[92mstartxfce4\033[0m"
}
_configure_xfce() {
echo "Configuring xfce panel ..."
cat << EOF >/etc/xdg/xfce4/panel/default.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-panel" version="1.0">
<property name="configver" type="int" value="2"/>
<property name="panels" type="array">
<value type="int" value="1"/>
<value type="int" value="2"/>
<property name="dark-mode" type="bool" value="true"/>
<property name="panel-1" type="empty">
<property name="position" type="string" value="p=6;x=0;y=0"/>
<property name="length" type="uint" value="100"/>
<property name="position-locked" type="bool" value="true"/>
<property name="icon-size" type="uint" value="16"/>
<property name="size" type="uint" value="26"/>
<property name="plugin-ids" type="array">
<value type="int" value="1"/>
<value type="int" value="2"/>
<value type="int" value="3"/>
<value type="int" value="4"/>
<value type="int" value="5"/>
<value type="int" value="6"/>
<value type="int" value="7"/>
<value type="int" value="8"/>
<value type="int" value="9"/>
<value type="int" value="10"/>
<value type="int" value="11"/>
<value type="int" value="12"/>
<value type="int" value="13"/>
<value type="int" value="14"/>
</property>
</property>
<property name="panel-2" type="empty">
<property name="autohide-behavior" type="uint" value="1"/>
<property name="position" type="string" value="p=10;x=0;y=0"/>
<property name="length" type="uint" value="1"/>
<property name="position-locked" type="bool" value="true"/>
<property name="size" type="uint" value="48"/>
<property name="plugin-ids" type="array">
<value type="int" value="15"/>
<value type="int" value="16"/>
<value type="int" value="17"/>
<value type="int" value="18"/>
<value type="int" value="19"/>
<value type="int" value="20"/>
<value type="int" value="21"/>
<value type="int" value="22"/>
</property>
</property>
</property>
<property name="plugins" type="empty">
<property name="plugin-1" type="string" value="applicationsmenu"/>
<property name="plugin-2" type="string" value="tasklist">
<property name="grouping" type="uint" value="1"/>
</property>
<property name="plugin-3" type="string" value="separator">
<property name="expand" type="bool" value="true"/>
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-4" type="string" value="pager"/>
<property name="plugin-5" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-6" type="string" value="systray">
<property name="square-icons" type="bool" value="true"/>
</property>
<property name="plugin-8" type="string" value="pulseaudio">
<property name="enable-keyboard-shortcuts" type="bool" value="true"/>
<property name="show-notifications" type="bool" value="true"/>
</property>
<property name="plugin-9" type="string" value="power-manager-plugin"/>
<property name="plugin-10" type="string" value="notification-plugin"/>
<property name="plugin-11" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-12" type="string" value="clock"/>
<property name="plugin-13" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-14" type="string" value="actions"/>
<property name="plugin-15" type="string" value="showdesktop"/>
<property name="plugin-16" type="string" value="separator"/>
<property name="plugin-17" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-terminal-emulator.desktop"/>
</property>
</property>
<property name="plugin-18" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-file-manager.desktop"/>
</property>
</property>
<property name="plugin-19" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-web-browser.desktop"/>
</property>
</property>
<property name="plugin-20" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="gparted.desktop"/>
</property>
</property>
<property name="plugin-21" type="string" value="separator"/>
<property name="plugin-22" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="archboot.desktop"/>
</property>
</property>
</property>
</channel>
EOF
echo "Setting breeze as default icons..."
sed -i -e 's#<property name="IconThemeName" type="string" value="Adwaita"/>#<property name="IconThemeName" type="string" value="breeze"/>#g' \
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
echo "Setting archboot background image ..."
cat << EOF >/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-desktop" version="1.0">
<property name="backdrop" type="empty">
<property name="screen0" type="empty">
<property name="monitor0" type="empty">
<property name="image-path" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-single-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="image-show" type="bool" value="true"/>
<property name="image-style" type="int" value="0"/>
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorVNC-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorHDMI1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
</property>
</property>
</channel>
EOF
echo "Replacing appfinder launcher with gparted ..."
sed -i -e 's#xfce4-appfinder#gparted#g' /etc/xdg/xfce4/panel/default.xml
echo "Replacing directory menu launcher with setup ..."
sed -i -e 's#directorymenu#archboot#g' /etc/xdg/xfce4/panel/default.xml
echo "Setting chromium as default browser ..."
sed -i -e 's#firefox#chromium#g' /etc/xdg/xfce4/helpers.rc
echo "Adding chromium flags to /etc/chromium-flags.conf ..."
cat << EOF >/etc/chromium-flags.conf
--no-sandbox
--test-type
--incognito
wiki.archlinux.org/title/Archboot
EOF
echo "Replacing menu structure ..."
cat << EOF >/etc/xdg/menus/xfce-applications.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>Xfce</Name>
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<Include>
<Category>X-Xfce-Toplevel</Category>
</Include>
<Layout>
<Filename>archboot.desktop</Filename>
<Filename>gparted.desktop</Filename>
<Filename>xfce4-run.desktop</Filename>
<Separator/>
<Filename>xfce4-terminal-emulator.desktop</Filename>
<Filename>xfce4-file-manager.desktop</Filename>
<Filename>xfce4-web-browser.desktop</Filename>
<Separator/>
<Menuname>Settings</Menuname>
<Separator/>
<Merge type="all"/>
<Separator/>
<Filename>xfce4-session-logout.desktop</Filename>
</Layout>
<Menu>
<Name>Settings</Name>
<Directory>xfce-settings.directory</Directory>
<Include>
<Category>Settings</Category>
</Include>
<Layout>
<Filename>xfce-settings-manager.desktop</Filename>
<Separator/>
<Merge type="all"/>
</Layout>
<Menu>
<Name>Screensavers</Name>
<Directory>xfce-screensavers.directory</Directory>
<Include>
<Category>Screensaver</Category>
</Include>
</Menu>
</Menu>
<DefaultMergeDirs/>
</Menu>
EOF
echo "Adding gparted to xfce top level menu ..."
sed -i -e 's#Categories=.*#Categories=X-Xfce-Toplevel;#g' /usr/share/applications/gparted.desktop
echo "Hiding ${_HIDE_MENU} menu entries ..."
for i in ${_HIDE_MENU}; do
echo 'NoDisplay=true' >> /usr/share/applications/"${i}".desktop
done
echo "Autostarting setup ..."
cat << EOF > /etc/xdg/autostart/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
Exec=xfce4-terminal -x /usr/bin/setup
Icon=system-software-install
Categories=X-Xfce-Toplevel;
EOF
}