Skip to content

Commit

Permalink
Refactor applications, add desktop execution (#66)
Browse files Browse the repository at this point in the history
* Refactor applications, add desktop execution

* Bugfixing
  • Loading branch information
igorpecovnik authored Sep 12, 2024
1 parent e41c594 commit e820b96
Show file tree
Hide file tree
Showing 2 changed files with 267 additions and 36 deletions.
244 changes: 208 additions & 36 deletions lib/armbian-configng/config.ng.jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,38 +466,6 @@
"doc_link": "",
"src_reference": "",
"author": ""
},
{
"id": "N17",
"description": "Announce system in the network (Avahi)",
"prompt": "This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?",
"command": [
"check_if_installed avahi-daemon",
"debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns",
"cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/",
"cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/",
"service avahi-daemon restart"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "! check_if_installed avahi-daemon"
},
{
"id": "N18",
"description": "Disable system announce in the network (Avahi)",
"prompt": "This operation will purge avahi-daemon\nDo you wish to continue?",
"command": [
"check_if_installed avahi-daemon",
"systemctl stop avahi-daemon avahi-daemon.socket",
"debconf-apt-progress -- apt-get -y purge avahi-daemon"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "check_if_installed avahi-daemon"
}
]
},
Expand Down Expand Up @@ -559,7 +527,211 @@
"description": "Run/Install 3rd party applications",
"sub": [
{
"id": "I00",
"id": "SW01",
"description": "Desktop Environments",
"sub": [
{
"id": "SW02",
"description": "Install XFCE desktop",
"command": [ "install_de \"xfce\""],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": ""
},
{
"id": "SW03",
"description": "Install Gnome desktop",
"command": [ "install_de \"gnome\""],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": ""
},
{
"id": "SW04",
"description": "Install i3-wm desktop",
"command": [ "install_de \"i3-wm\""],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": ""
},
{
"id": "SW05",
"description": "Install Cinnamon desktop",
"command": [ "install_de \"cinnamon\""],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": ""
},
{
"id": "SW06",
"description": "Install kde-neon desktop",
"command": [ "install_de \"kde-neon\""],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": ""
}
]
},
{
"id": "SW07",
"description": "Network tools",
"sub": [
{
"id": "SW08",
"description": "Install realtime console network usage monitor (nload)",
"command": [
"get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y install nload"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "! check_if_installed nload"
},
{
"id": "SW09",
"description": "Remove realtime console network usage monitor (nload)",
"command": [
"get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y purge nload"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "check_if_installed nload"
},
{
"id": "SW10",
"description": "Install bandwidth measuring tool (iperf3)",
"command": [
"get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y install iperf3"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "! check_if_installed iperf3"
},
{
"id": "SW11",
"description": "Remove bandwidth measuring tool (iperf3)",
"command": [
"get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y purge iperf3"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "check_if_installed iperf3"
},
{
"id": "SW12",
"description": "Install IP LAN monitor (iptraf-ng)",
"command": [
"get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y install iptraf-ng"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "! check_if_installed iptraf-ng"
},
{
"id": "SW13",
"description": "Remove IP LAN monitor (iptraf-ng)",
"command": [
"get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y purge iptraf-ng"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "check_if_installed iptraf-ng"
},
{
"id": "SW14",
"description": "Install hostname broadcast via mDNS (avahi-daemon)",
"command": [
"get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input",
"check_if_installed avahi-daemon",
"debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns",
"cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/",
"cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/",
"service avahi-daemon restart"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "! check_if_installed avahi-daemon"
},
{
"id": "SW15",
"description": "Remove hostname broadcast via mDNS (avahi-daemon)",
"command": [
"get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input",
"check_if_installed avahi-daemon",
"systemctl stop avahi-daemon avahi-daemon.socket",
"debconf-apt-progress -- apt-get -y purge avahi-daemon"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "check_if_installed avahi-daemon"
}
]
},
{
"id": "SW16",
"description": "Development",
"sub": [
{
"id": "SW17",
"description": "Install tools for cloning and managing repositories (git)",
"command": [
"get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y install git"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "! check_if_installed git"
},
{
"id": "SW18",
"description": "Remove tools for cloning and managing repositories (git)",
"command": [
"get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input",
"debconf-apt-progress -- apt-get -y purge git"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "check_if_installed git"
}
]
},
{
"id": "SW19",
"description": "Update Application Repository",
"prompt": "This will update the apt repository\nWould you like to continue?",
"command": [ "debconf-apt-progress -- apt update" ],
Expand All @@ -569,16 +741,16 @@
"author": ""
},
{
"id": "I01",
"description": "System benchmaking and diagnostics",
"id": "SW20",
"description": "SWystem benchmaking and diagnostics",
"command": [
"see_monitoring"
],
"status": "Active",
"doc_link": "",
"src_reference": "",
"author": "",
"condition": "ls /usr/bin/armbianmonitor"
"condition": "[ -f /usr/bin/armbianmonitor ]"

}
]
Expand Down
59 changes: 59 additions & 0 deletions lib/armbian-configng/config.ng.system.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
#!/bin/bash


module_options+=(
["install_de,author"]="Igor Pecovnik"
["install_de,ref_link"]=""
["install_de,feature"]="install_de"
["install_de,desc"]="Install DE"
["install_de,example"]="install_de"
["install_de,status"]="Active"
)
#
# Install desktop
#
function install_de (){

# 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

# 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

# desktops has different default login managers
case "$1" in
gnome)
# gdm3
;;
*)
# lightdm
mkdir -p /etc/lightdm/lightdm.conf.d
echo "[Seat:*]" > /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
echo "autologin-user=${username}" >> /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
echo "autologin-user-timeout=0" >> /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
echo "user-session=xfce" >> /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
ln -s /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service >/dev/null 2>&1
service lightdm start >/dev/null 2>&1
;;
esac
exit
}


module_options+=(
["update_skel,author"]="Igor Pecovnik"
["update_skel,ref_link"]=""
Expand Down

0 comments on commit e820b96

Please sign in to comment.