Commit b4e0bc66 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Adding BT and LIRC to toggle to armbian-config

parent 51e0ed84
...@@ -24,6 +24,34 @@ function jobs () ...@@ -24,6 +24,34 @@ function jobs ()
softy softy
;; ;;
# Remove BT
#
"Remove BT" )
debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools
check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman
debconf-apt-progress -- apt -y -qq autoremove
;;
# Enabling BT
#
"Bluetooth" )
debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools
check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman
;;
# Removing IR
#
"Remove IR" )
debconf-apt-progress -- apt-get -y remove lirc
debconf-apt-progress -- apt -y -qq autoremove
;;
# Enabling IR
#
"IR" )
debconf-apt-progress -- apt-get -y --no-install-recommends install lirc
;;
# Sharing USB ports # Sharing USB ports
# #
...@@ -385,7 +413,7 @@ function jobs () ...@@ -385,7 +413,7 @@ function jobs ()
# Connect to Bluetooth # Connect to Bluetooth
# #
"Bluetooth" ) "Discover" )
dialog --backtitle "$BACKTITLE" --title " Bluetooth " --msgbox "\nMake sure your Bluetooth devices are discoverable!" 7 54 dialog --backtitle "$BACKTITLE" --title " Bluetooth " --msgbox "\nMake sure your Bluetooth devices are discoverable!" 7 54
connect_bt_interface connect_bt_interface
;; ;;
......
...@@ -25,6 +25,19 @@ dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nLoading Armbi ...@@ -25,6 +25,19 @@ dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nLoading Armbi
sleep 1 sleep 1
check_if_installed (){
#------------------------------------------------------------------------------------------------------------------------------------------
# check dpkg status of $1 -- currently only 'not installed at all' case catched
#------------------------------------------------------------------------------------------------------------------------------------------
local DPKG_Status="$(dpkg -s "$1" 2>/dev/null | awk -F": " '/^Status/ {print $2}')"
if [[ "X${DPKG_Status}" = "X" || "${DPKG_Status}" = *deinstall* ]]; then
return 1
else
return 0
fi
}
#-----------------------------------------------------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------------------------------------------------#
# check all possible wireless modes # check all possible wireless modes
# #
...@@ -556,7 +569,7 @@ while true; do ...@@ -556,7 +569,7 @@ while true; do
fi fi
if [[ -n $(service bluetooth status | grep -w active | grep -w running) ]]; then if [[ -n $(service bluetooth status | grep -w active | grep -w running) ]]; then
[[ $(hcitool dev | sed '1d') != "" ]] && LIST+=( "Bluetooth" "Connect Bluetooth devices" ) [[ $(hcitool dev | sed '1d') != "" ]] && LIST+=( "Discover" "Discover and connect Bluetooth devices" )
fi fi
LIST+=( "Advanced" "Edit /etc/network/interfaces" ) LIST+=( "Advanced" "Edit /etc/network/interfaces" )
...@@ -679,6 +692,11 @@ while true; do ...@@ -679,6 +692,11 @@ while true; do
[[ -f /usr/bin/softy ]] && LIST+=( "Softy" "3rd party applications installer" ) [[ -f /usr/bin/softy ]] && LIST+=( "Softy" "3rd party applications installer" )
[[ -f /usr/bin/h3consumption && "$LINUXFAMILY" = "sun8i" && "$BRANCH" = "default" ]] && \ [[ -f /usr/bin/h3consumption && "$LINUXFAMILY" = "sun8i" && "$BRANCH" = "default" ]] && \
LIST+=( "Consumption" "Control board consumption" ) LIST+=( "Consumption" "Control board consumption" )
check_if_installed bluetooth && LIST+=( "Remove BT" "Remove Bluetooth support" ) || LIST+=( "Bluetooth" "Install Bluetooth support" )
check_if_installed lirc && LIST+=( "Remove IR" "Remove IR support" ) || LIST+=( "IR" "Install IR support" )
[[ -f /usr/bin/armbianmonitor ]] && LIST+=( "Monitor" "Simple CLI board monitoring" ) [[ -f /usr/bin/armbianmonitor ]] && LIST+=( "Monitor" "Simple CLI board monitoring" )
[[ -f /usr/bin/armbianmonitor ]] && LIST+=( "Diagnostics" "Send diagnostics" ) [[ -f /usr/bin/armbianmonitor ]] && LIST+=( "Diagnostics" "Send diagnostics" )
[[ -f /usr/bin/bin2fex && "$LINUXFAMILY" = sun*i && "$BRANCH" = "default" ]] && LIST+=( "Fexedit" "Board (fex) settings editor" ) [[ -f /usr/bin/bin2fex && "$LINUXFAMILY" = sun*i && "$BRANCH" = "default" ]] && LIST+=( "Fexedit" "Board (fex) settings editor" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment