Skip to content

Commit e820b96

Browse files
authored
Refactor applications, add desktop execution (#66)
* Refactor applications, add desktop execution * Bugfixing
1 parent e41c594 commit e820b96

2 files changed

Lines changed: 267 additions & 36 deletions

File tree

lib/armbian-configng/config.ng.jobs.json

Lines changed: 208 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -466,38 +466,6 @@
466466
"doc_link": "",
467467
"src_reference": "",
468468
"author": ""
469-
},
470-
{
471-
"id": "N17",
472-
"description": "Announce system in the network (Avahi)",
473-
"prompt": "This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?",
474-
"command": [
475-
"check_if_installed avahi-daemon",
476-
"debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns",
477-
"cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/",
478-
"cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/",
479-
"service avahi-daemon restart"
480-
],
481-
"status": "Active",
482-
"doc_link": "",
483-
"src_reference": "",
484-
"author": "",
485-
"condition": "! check_if_installed avahi-daemon"
486-
},
487-
{
488-
"id": "N18",
489-
"description": "Disable system announce in the network (Avahi)",
490-
"prompt": "This operation will purge avahi-daemon\nDo you wish to continue?",
491-
"command": [
492-
"check_if_installed avahi-daemon",
493-
"systemctl stop avahi-daemon avahi-daemon.socket",
494-
"debconf-apt-progress -- apt-get -y purge avahi-daemon"
495-
],
496-
"status": "Active",
497-
"doc_link": "",
498-
"src_reference": "",
499-
"author": "",
500-
"condition": "check_if_installed avahi-daemon"
501469
}
502470
]
503471
},
@@ -559,7 +527,211 @@
559527
"description": "Run/Install 3rd party applications",
560528
"sub": [
561529
{
562-
"id": "I00",
530+
"id": "SW01",
531+
"description": "Desktop Environments",
532+
"sub": [
533+
{
534+
"id": "SW02",
535+
"description": "Install XFCE desktop",
536+
"command": [ "install_de \"xfce\""],
537+
"status": "Active",
538+
"doc_link": "",
539+
"src_reference": "",
540+
"author": "",
541+
"condition": ""
542+
},
543+
{
544+
"id": "SW03",
545+
"description": "Install Gnome desktop",
546+
"command": [ "install_de \"gnome\""],
547+
"status": "Active",
548+
"doc_link": "",
549+
"src_reference": "",
550+
"author": "",
551+
"condition": ""
552+
},
553+
{
554+
"id": "SW04",
555+
"description": "Install i3-wm desktop",
556+
"command": [ "install_de \"i3-wm\""],
557+
"status": "Active",
558+
"doc_link": "",
559+
"src_reference": "",
560+
"author": "",
561+
"condition": ""
562+
},
563+
{
564+
"id": "SW05",
565+
"description": "Install Cinnamon desktop",
566+
"command": [ "install_de \"cinnamon\""],
567+
"status": "Active",
568+
"doc_link": "",
569+
"src_reference": "",
570+
"author": "",
571+
"condition": ""
572+
},
573+
{
574+
"id": "SW06",
575+
"description": "Install kde-neon desktop",
576+
"command": [ "install_de \"kde-neon\""],
577+
"status": "Active",
578+
"doc_link": "",
579+
"src_reference": "",
580+
"author": "",
581+
"condition": ""
582+
}
583+
]
584+
},
585+
{
586+
"id": "SW07",
587+
"description": "Network tools",
588+
"sub": [
589+
{
590+
"id": "SW08",
591+
"description": "Install realtime console network usage monitor (nload)",
592+
"command": [
593+
"get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input",
594+
"debconf-apt-progress -- apt-get -y install nload"
595+
],
596+
"status": "Active",
597+
"doc_link": "",
598+
"src_reference": "",
599+
"author": "",
600+
"condition": "! check_if_installed nload"
601+
},
602+
{
603+
"id": "SW09",
604+
"description": "Remove realtime console network usage monitor (nload)",
605+
"command": [
606+
"get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input",
607+
"debconf-apt-progress -- apt-get -y purge nload"
608+
],
609+
"status": "Active",
610+
"doc_link": "",
611+
"src_reference": "",
612+
"author": "",
613+
"condition": "check_if_installed nload"
614+
},
615+
{
616+
"id": "SW10",
617+
"description": "Install bandwidth measuring tool (iperf3)",
618+
"command": [
619+
"get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input",
620+
"debconf-apt-progress -- apt-get -y install iperf3"
621+
],
622+
"status": "Active",
623+
"doc_link": "",
624+
"src_reference": "",
625+
"author": "",
626+
"condition": "! check_if_installed iperf3"
627+
},
628+
{
629+
"id": "SW11",
630+
"description": "Remove bandwidth measuring tool (iperf3)",
631+
"command": [
632+
"get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input",
633+
"debconf-apt-progress -- apt-get -y purge iperf3"
634+
],
635+
"status": "Active",
636+
"doc_link": "",
637+
"src_reference": "",
638+
"author": "",
639+
"condition": "check_if_installed iperf3"
640+
},
641+
{
642+
"id": "SW12",
643+
"description": "Install IP LAN monitor (iptraf-ng)",
644+
"command": [
645+
"get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input",
646+
"debconf-apt-progress -- apt-get -y install iptraf-ng"
647+
],
648+
"status": "Active",
649+
"doc_link": "",
650+
"src_reference": "",
651+
"author": "",
652+
"condition": "! check_if_installed iptraf-ng"
653+
},
654+
{
655+
"id": "SW13",
656+
"description": "Remove IP LAN monitor (iptraf-ng)",
657+
"command": [
658+
"get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input",
659+
"debconf-apt-progress -- apt-get -y purge iptraf-ng"
660+
],
661+
"status": "Active",
662+
"doc_link": "",
663+
"src_reference": "",
664+
"author": "",
665+
"condition": "check_if_installed iptraf-ng"
666+
},
667+
{
668+
"id": "SW14",
669+
"description": "Install hostname broadcast via mDNS (avahi-daemon)",
670+
"command": [
671+
"get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input",
672+
"check_if_installed avahi-daemon",
673+
"debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns",
674+
"cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/",
675+
"cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/",
676+
"service avahi-daemon restart"
677+
],
678+
"status": "Active",
679+
"doc_link": "",
680+
"src_reference": "",
681+
"author": "",
682+
"condition": "! check_if_installed avahi-daemon"
683+
},
684+
{
685+
"id": "SW15",
686+
"description": "Remove hostname broadcast via mDNS (avahi-daemon)",
687+
"command": [
688+
"get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input",
689+
"check_if_installed avahi-daemon",
690+
"systemctl stop avahi-daemon avahi-daemon.socket",
691+
"debconf-apt-progress -- apt-get -y purge avahi-daemon"
692+
],
693+
"status": "Active",
694+
"doc_link": "",
695+
"src_reference": "",
696+
"author": "",
697+
"condition": "check_if_installed avahi-daemon"
698+
}
699+
]
700+
},
701+
{
702+
"id": "SW16",
703+
"description": "Development",
704+
"sub": [
705+
{
706+
"id": "SW17",
707+
"description": "Install tools for cloning and managing repositories (git)",
708+
"command": [
709+
"get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input",
710+
"debconf-apt-progress -- apt-get -y install git"
711+
],
712+
"status": "Active",
713+
"doc_link": "",
714+
"src_reference": "",
715+
"author": "",
716+
"condition": "! check_if_installed git"
717+
},
718+
{
719+
"id": "SW18",
720+
"description": "Remove tools for cloning and managing repositories (git)",
721+
"command": [
722+
"get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input",
723+
"debconf-apt-progress -- apt-get -y purge git"
724+
],
725+
"status": "Active",
726+
"doc_link": "",
727+
"src_reference": "",
728+
"author": "",
729+
"condition": "check_if_installed git"
730+
}
731+
]
732+
},
733+
{
734+
"id": "SW19",
563735
"description": "Update Application Repository",
564736
"prompt": "This will update the apt repository\nWould you like to continue?",
565737
"command": [ "debconf-apt-progress -- apt update" ],
@@ -569,16 +741,16 @@
569741
"author": ""
570742
},
571743
{
572-
"id": "I01",
573-
"description": "System benchmaking and diagnostics",
744+
"id": "SW20",
745+
"description": "SWystem benchmaking and diagnostics",
574746
"command": [
575747
"see_monitoring"
576748
],
577749
"status": "Active",
578750
"doc_link": "",
579751
"src_reference": "",
580752
"author": "",
581-
"condition": "ls /usr/bin/armbianmonitor"
753+
"condition": "[ -f /usr/bin/armbianmonitor ]"
582754

583755
}
584756
]

lib/armbian-configng/config.ng.system.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,65 @@
11
#!/bin/bash
22

33

4+
module_options+=(
5+
["install_de,author"]="Igor Pecovnik"
6+
["install_de,ref_link"]=""
7+
["install_de,feature"]="install_de"
8+
["install_de,desc"]="Install DE"
9+
["install_de,example"]="install_de"
10+
["install_de,status"]="Active"
11+
)
12+
#
13+
# Install desktop
14+
#
15+
function install_de (){
16+
17+
# get user who executed this script
18+
if [ $SUDO_USER ]; then local user=$SUDO_USER; else local user=`whoami`; fi
19+
20+
#debconf-apt-progress --
21+
apt-get update
22+
#debconf-apt-progress --
23+
apt-get -o Dpkg::Options::="--force-confold" -y --install-recommends install armbian-${DISTROID}-desktop-$1 # armbian-bsp-desktop-${BOARD}-${BRANCH}
24+
25+
# clean apt cache
26+
apt-get -y clean
27+
28+
# add user to groups
29+
for additionalgroup in sudo netdev audio video dialout plugdev input bluetooth systemd-journal ssh; do
30+
usermod -aG ${additionalgroup} ${user} 2>/dev/null
31+
done
32+
33+
# set up profile sync daemon on desktop systems
34+
which psd >/dev/null 2>&1
35+
if [[ $? -eq 0 && -z $(grep overlay-helper /etc/sudoers) ]]; then
36+
echo "${user} ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper" >> /etc/sudoers
37+
touch /home/${user}/.activate_psd
38+
fi
39+
40+
# update skel
41+
update_skel
42+
43+
# desktops has different default login managers
44+
case "$1" in
45+
gnome)
46+
# gdm3
47+
;;
48+
*)
49+
# lightdm
50+
mkdir -p /etc/lightdm/lightdm.conf.d
51+
echo "[Seat:*]" > /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
52+
echo "autologin-user=${username}" >> /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
53+
echo "autologin-user-timeout=0" >> /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
54+
echo "user-session=xfce" >> /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
55+
ln -s /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service >/dev/null 2>&1
56+
service lightdm start >/dev/null 2>&1
57+
;;
58+
esac
59+
exit
60+
}
61+
62+
463
module_options+=(
564
["update_skel,author"]="Igor Pecovnik"
665
["update_skel,ref_link"]=""

0 commit comments

Comments
 (0)