diff --git a/lib/armbian-configng/config.ng.jobs.json b/lib/armbian-configng/config.ng.jobs.json index 45ecb1b13..e619bb00b 100644 --- a/lib/armbian-configng/config.ng.jobs.json +++ b/lib/armbian-configng/config.ng.jobs.json @@ -574,67 +574,237 @@ "sub": [ { "id": "Desktops", - "description": "Install Desktop Environments", + "description": "Desktop Environments", "sub": [ { - "id": "SW02", - "description": "Install XFCE desktop", - "command": [ - "install_de \"xfce\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" + "id": "DE01", + "description": "XFCE desktop", + "sub": [ + { + "id": "DE02", + "description": "XFCE desktop Install", + "command": [ + "manage_desktops 'xfce' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/xfce.desktop ]" + }, + { + "id": "DE03", + "description": "Uninstall", + "command": [ + "manage_desktops 'xfce' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ]" + }, + { + "id": "DE04", + "description": "Enable autologin", + "command": [ + "manage_desktops 'xfce' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "DE05", + "description": "Disable autologin", + "command": [ + "manage_desktops 'xfce' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] }, { - "id": "SW03", - "description": "Install Gnome desktop", - "command": [ - "install_de \"gnome\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" + "id": "DE10", + "description": "Gnome desktop", + "sub": [ + { + "id": "DE11", + "description": "XFCE desktop Install", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE12", + "description": "Uninstall", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE13", + "description": "Enable autologin", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "DE14", + "description": "Disable autologin", + "command": [ + "install_de \"xfce\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] }, { - "id": "SW04", - "description": "Install i3-wm desktop", - "command": [ - "install_de \"i3-wm\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" + "id": "DE20", + "description": "i3-wm desktop", + "sub": [ + { + "id": "DE21", + "description": "XFCE desktop Install", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE22", + "description": "Uninstall", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE23", + "description": "Enable autologin", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "DE24", + "description": "Disable autologin", + "command": [ + "install_de \"xfce\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] }, { - "id": "SW05", - "description": "Install Cinnamon desktop", - "command": [ - "install_de \"cinnamon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" + "id": "DE30", + "description": "Cinnamon desktop", + "sub": [ + { + "id": "DE31", + "description": "XFCE desktop Install", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE32", + "description": "Uninstall", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE33", + "description": "Enable autologin", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "DE34", + "description": "Disable autologin", + "command": [ + "install_de \"xfce\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] }, { - "id": "SW06", - "description": "Install kde-neon desktop", - "command": [ - "install_de \"kde-neon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" + "id": "DE40", + "description": "Kde-neon desktop", + "sub": [ + { + "id": "DE41", + "description": "XFCE desktop Install", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE42", + "description": "Uninstall", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "DE43", + "description": "Enable autologin", + "command": [ + "install_de \"gnome\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "DE44", + "description": "Disable autologin", + "command": [ + "install_de \"xfce\"" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] } ] }, diff --git a/lib/armbian-configng/config.ng.system.sh b/lib/armbian-configng/config.ng.system.sh index ec51c2dfd..37348cf00 100644 --- a/lib/armbian-configng/config.ng.system.sh +++ b/lib/armbian-configng/config.ng.system.sh @@ -97,36 +97,44 @@ module_options+=( # # Install desktop # -function install_de() { +function manage_desktops() { + + local desktop=$1 + local command=$2 # get user who executed this script if [ $SUDO_USER ]; then local user=$SUDO_USER; else local user=$(whoami); fi - #debconf-apt-progress -- - apt-get update - #debconf-apt-progress -- - apt-get -o Dpkg::Options::="--force-confold" -y --install-recommends install armbian-${DISTROID}-desktop-$1 # armbian-bsp-desktop-${BOARD}-${BRANCH} - - # clean apt cache - apt-get -y clean - - # add user to groups - for additionalgroup in sudo netdev audio video dialout plugdev input bluetooth systemd-journal ssh; do - usermod -aG ${additionalgroup} ${user} 2> /dev/null - done - - # Recreating Synaptic search index - update-apt-xapian-index -u - - # set up profile sync daemon on desktop systems - which psd > /dev/null 2>&1 - if [[ $? -eq 0 && -z $(grep overlay-helper /etc/sudoers) ]]; then - echo "${user} ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper" >> /etc/sudoers - touch /home/${user}/.activate_psd - fi - - # update skel - update_skel + case "$command" in + install) + apt_install_wrapper apt-get -o Dpkg::Options::="--force-confold" -y --install-recommends install armbian-${DISTROID}-desktop-${desktop} + # add user to groups + for additionalgroup in sudo netdev audio video dialout plugdev input bluetooth systemd-journal ssh; do + usermod -aG ${additionalgroup} ${user} 2> /dev/null + done + # Recreating Synaptic search index + update-apt-xapian-index -u + + # set up profile sync daemon on desktop systems + which psd > /dev/null 2>&1 + if [[ $? -eq 0 && -z $(grep overlay-helper /etc/sudoers) ]]; then + echo "${user} ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper" >> /etc/sudoers + touch /home/${user}/.activate_psd + fi + # update skel + update_skel + ;; + uninstall) + apt_install_wrapper apt-get -o Dpkg::Options::="--force-confold" -y --install-recommends purge armbian-${DISTROID}-desktop-$1 xfce4-session slick-greeter lightdm + apt_install_wrapper apt-get -y autoremove + ;; + auto) + : + ;; + manual) + : + ;; + esac # desktops has different default login managers case "$1" in diff --git a/tests/SW02.conf b/tests/SW02.conf new file mode 100644 index 000000000..b3791ce57 --- /dev/null +++ b/tests/SW02.conf @@ -0,0 +1,2 @@ +ENABLED=true +CONDITION="[ -f /usr/share/xsessions/xfce.desktop ]" diff --git a/tests/SW03.conf b/tests/SW03.conf new file mode 100644 index 000000000..4b8a9090b --- /dev/null +++ b/tests/SW03.conf @@ -0,0 +1,2 @@ +ENABLED=true +CONDITION="[ -f /usr/share/xsessions/gnome.desktop ]" diff --git a/tests/SW04.conf b/tests/SW04.conf new file mode 100644 index 000000000..d8ff80367 --- /dev/null +++ b/tests/SW04.conf @@ -0,0 +1,2 @@ +ENABLED=true +CONDITION="[ -f /usr/share/xsessions/i3.desktop ]" diff --git a/tests/SW05.conf b/tests/SW05.conf new file mode 100644 index 000000000..890259d47 --- /dev/null +++ b/tests/SW05.conf @@ -0,0 +1,2 @@ +ENABLED=true +CONDITION="[ -f /usr/share/xsessions/cinnamon.desktop ]" diff --git a/tests/SW06.conf b/tests/SW06.conf new file mode 100644 index 000000000..b3791ce57 --- /dev/null +++ b/tests/SW06.conf @@ -0,0 +1,2 @@ +ENABLED=true +CONDITION="[ -f /usr/share/xsessions/xfce.desktop ]"