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

Changing screen sizes from menu for A20 with legacy kernels

parent 54860f6e
...@@ -143,24 +143,32 @@ function jobs () ...@@ -143,24 +143,32 @@ function jobs ()
# #
"Display" ) "Display" )
# show display modes menu # show display modes menu
get_h3modes if [[ -f /usr/bin/h3disp ]]; then
dialog --title " Display output type " --colors --help-button --help-label "Back" --no-label "DVI" --yes-label "HDMI" \ # h3 boards
--backtitle "$BACKTITLE" --yesno "\nIn case you use an HDMI-to-DVI converter choose DVI!" 7 57 get_h3modes
output_type=$? dialog --title " Display output type " --colors --help-button --help-label "Back" --no-label "DVI" --yes-label "HDMI" \
if [[ $output_type = 0 || $output_type = 1 ]]; then --backtitle "$BACKTITLE" --yesno "\nIn case you use an HDMI-to-DVI converter choose DVI!" 7 57
output_type=$?
if [[ $output_type = 0 ]]; then if [[ $output_type = 0 || $output_type = 1 ]]; then
display_cmd="h3disp -m $SCREEN_RESOLUTION"; if [[ $output_type = 0 ]]; then
else display_cmd="h3disp -m $SCREEN_RESOLUTION";
display_cmd="h3disp -m $SCREEN_RESOLUTION -d"; else
fi display_cmd="h3disp -m $SCREEN_RESOLUTION -d";
fi
dialog --title " Display resolution " --colors --no-label "Back" --backtitle "$BACKTITLE" --yesno \
"\nSetting new screen mode.\n\nExecuting \Z1$display_cmd\Z0 and reboot? " 9 56
if [[ $? = 0 ]]; then
eval $display_cmd > /dev/null
reboot
fi fi
else
# a20 boards
get_a20modes
display_cmd="sed -i \"s/^disp_mode=.*/disp_mode=$SCREEN_RESOLUTION/\" /boot/armbianEnv.txt";
fi
dialog --title " Display resolution " --colors --no-label "Back" --backtitle "$BACKTITLE" --yesno \
"\nSwitching to \Z1$SCREEN_RESOLUTION\Z0 and reboot?" 7 42
if [[ $? = 0 ]]; then
eval $display_cmd > /dev/null
reboot
fi fi
;; ;;
......
...@@ -348,6 +348,33 @@ function aval_kernel () ...@@ -348,6 +348,33 @@ function aval_kernel ()
} }
#-----------------------------------------------------------------------------------------------------------------------------------------#
# select video modes for a10 and a20
#
function get_a20modes ()
{
IFS=$'\r'
GLOBIGNORE='*'
SCREEN_RESOLUTION=("1920x1080p60" "1280x720p60" "1920x1080p50" "1280x1024p60" "1024x768p60" "800x600p60" "640x480p60" "1360x768p60" "1440x900p60" "1680x1050p60")
local LIST=()
for i in "${SCREEN_RESOLUTION[@]}"
do
LIST+=( "${i[0]//[[:blank:]]/}" "" )
done
LIST_LENGHT=$((${#LIST[@]}/2));
#echo $LIST_LENGHT
#exit
if [ "$LIST_LENGHT" -eq 1 ]; then
SCREEN_RESOLUTION=${SCREEN_RESOLUTION[0]}
else
exec 3>&1
SCREEN_RESOLUTION=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
--title "Select video mode" --clear --menu "" $((6+${LIST_LENGHT})) 25 $((1+${LIST_LENGHT})) "${LIST[@]}" 2>&1 1>&3)
exec 3>&-
fi
}
#-----------------------------------------------------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------------------------------------------------#
# select video modes for h3 # select video modes for h3
# #
...@@ -707,7 +734,7 @@ while true; do ...@@ -707,7 +734,7 @@ while true; do
[[ -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" )
if [[ -n $(dpkg -l | grep linux-headers) ]]; then LIST+=( "Headers" "Remove kernel headers" ); else \ if [[ -n $(dpkg -l | grep linux-headers) ]]; then LIST+=( "Headers" "Remove kernel headers" ); else \
LIST+=( "Headers" "Install kernel headers" ); fi LIST+=( "Headers" "Install kernel headers" ); fi
[[ -f /usr/bin/h3disp && "$LINUXFAMILY" = "sun8i" && "$BRANCH" = "default" && \ [[ "$LINUXFAMILY" = sun*i && "$BRANCH" = "default" && \
-n $(bin2fex </boot/script.bin 2>/dev/null | grep -w "hdmi_used = 1") ]] && LIST+=( "Display" "set the display resolution" ) -n $(bin2fex </boot/script.bin 2>/dev/null | grep -w "hdmi_used = 1") ]] && LIST+=( "Display" "set the display resolution" )
# count number of menu items to adjust window sizee # count number of menu items to adjust window sizee
......
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