Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
c61d71a3
Commit
c61d71a3
authored
May 09, 2018
by
Igor Pecovnik
Browse files
Desktop checking into separate function
parent
869ac57e
Changes
2
Show whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
c61d71a3
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
# Functions:
# Functions:
# main
# main
# check_desktop
# exceptions
# exceptions
# check_if_installed
# check_if_installed
# is_package_manager_running
# is_package_manager_running
...
@@ -43,11 +44,7 @@ function main(){
...
@@ -43,11 +44,7 @@ function main(){
OVERLAYDIR
=
"/boot/dtb/overlay"
;
OVERLAYDIR
=
"/boot/dtb/overlay"
;
[[
"
$LINUXFAMILY
"
==
"sunxi64"
]]
&&
OVERLAYDIR
=
"/boot/dtb/allwinner/overlay"
;
[[
"
$LINUXFAMILY
"
==
"sunxi64"
]]
&&
OVERLAYDIR
=
"/boot/dtb/allwinner/overlay"
;
# detect desktop
# detect desktop
DISPLAY_MANAGER
=
""
;
DESKTOP_INSTALLED
=
""
check_desktop
check_if_installed nodm
&&
DESKTOP_INSTALLED
=
"nodm"
;
check_if_installed lightdm
&&
DESKTOP_INSTALLED
=
"lightdm"
;
[[
-n
$(
service lightdm status 2> /dev/null |
grep
-w
active
)
]]
&&
DISPLAY_MANAGER
=
"lightdm"
[[
-n
$(
service nodm status 2> /dev/null |
grep
-w
active
)
]]
&&
DISPLAY_MANAGER
=
"nodm"
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Loading Armbian configuration utility ... "
5 45
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Loading Armbian configuration utility ... "
5 45
sleep
1
sleep
1
...
@@ -56,6 +53,19 @@ function main(){
...
@@ -56,6 +53,19 @@ function main(){
#
# read desktop parameters
#
function
check_desktop
()
{
DISPLAY_MANAGER
=
""
;
DESKTOP_INSTALLED
=
""
check_if_installed nodm
&&
DESKTOP_INSTALLED
=
"nodm"
;
check_if_installed lightdm
&&
DESKTOP_INSTALLED
=
"lightdm"
;
[[
-n
$(
service lightdm status 2> /dev/null |
grep
-w
active
)
]]
&&
DISPLAY_MANAGER
=
"lightdm"
[[
-n
$(
service nodm status 2> /dev/null |
grep
-w
active
)
]]
&&
DISPLAY_MANAGER
=
"nodm"
}
#
#
# naming exceptions for packages
# naming exceptions for packages
#
#
...
...
debian-config-submenu
View file @
c61d71a3
...
@@ -26,6 +26,9 @@ while true; do
...
@@ -26,6 +26,9 @@ while true; do
DIALOG_CANCEL
=
1
DIALOG_CANCEL
=
1
DIALOG_ESC
=
255
DIALOG_ESC
=
255
# detect desktop
check_desktop
# check update status of BSP packages
# check update status of BSP packages
local
mark
=
$(
apt-mark showhold |
grep
-w
"
$BOARD
"
)
local
mark
=
$(
apt-mark showhold |
grep
-w
"
$BOARD
"
)
...
@@ -73,6 +76,9 @@ while true; do
...
@@ -73,6 +76,9 @@ while true; do
# desktop
# desktop
if
[[
-n
$DISPLAY_MANAGER
]]
;
then
if
[[
-n
$DISPLAY_MANAGER
]]
;
then
LIST+
=(
"Desktop"
"Disable desktop"
)
LIST+
=(
"Desktop"
"Disable desktop"
)
if
!
check_if_installed mpv
;
then
LIST+
=(
"Default"
"Install desktop with browser and extras"
)
fi
[[
$DISPLAY_MANAGER
==
'nodm'
]]
&&
LIST+
=(
"Lightdm"
"Switch to standard login manager"
)
[[
$DISPLAY_MANAGER
==
'nodm'
]]
&&
LIST+
=(
"Lightdm"
"Switch to standard login manager"
)
[[
$DISPLAY_MANAGER
==
'lightdm'
]]
&&
LIST+
=(
"Nodm"
"Switch to simple auto login manager"
)
[[
$DISPLAY_MANAGER
==
'lightdm'
]]
&&
LIST+
=(
"Nodm"
"Switch to simple auto login manager"
)
else
else
...
@@ -286,6 +292,9 @@ function submenu_software ()
...
@@ -286,6 +292,9 @@ function submenu_software ()
{
{
while
true
;
do
while
true
;
do
# detect desktop
check_desktop
LIST
=()
LIST
=()
[[
-f
/usr/bin/softy
||
-f
softy
]]
&&
LIST+
=(
"Softy"
"3rd party applications installer"
)
[[
-f
/usr/bin/softy
||
-f
softy
]]
&&
LIST+
=(
"Softy"
"3rd party applications installer"
)
[[
-f
/usr/bin/h3consumption
&&
"
$LINUXFAMILY
"
=
"sun8i"
&&
"
$BRANCH
"
=
"default"
]]
&&
\
[[
-f
/usr/bin/h3consumption
&&
"
$LINUXFAMILY
"
=
"sun8i"
&&
"
$BRANCH
"
=
"default"
]]
&&
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment