mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
Added support for pixel doubling using xrandr on x86.
This commit is contained in:
parent
9500dc0377
commit
7461512d3d
47
raspi-config
47
raspi-config
@ -288,12 +288,20 @@ do_overscan() {
|
||||
}
|
||||
|
||||
get_pixdub() {
|
||||
if is_pi ; then
|
||||
FBW=$(get_config_var framebuffer_width $CONFIG)
|
||||
if [ $FBW -eq 0 ]; then
|
||||
echo 1
|
||||
else
|
||||
echo 0
|
||||
fi
|
||||
else
|
||||
if [ -e /etc/profile.d/pd.sh ] ; then
|
||||
echo 0
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
is_number() {
|
||||
@ -316,6 +324,7 @@ do_pixdub() {
|
||||
else
|
||||
RET=$1
|
||||
fi
|
||||
if is_pi ; then
|
||||
if [ $RET -eq 0 ] ; then
|
||||
XVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f3 -d' ')
|
||||
YVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f5 -d' ')
|
||||
@ -339,6 +348,23 @@ do_pixdub() {
|
||||
else
|
||||
return $RET
|
||||
fi
|
||||
else
|
||||
if [ -e /etc/profile.d/pd.sh ] ; then
|
||||
rm /etc/profile.d/pd.sh
|
||||
fi
|
||||
if [ $RET -eq 0 ] ; then
|
||||
DEV=$(xrandr | grep -w connected | cut -f1 -d' ')
|
||||
for item in $DEV
|
||||
do
|
||||
echo xrandr --output $item --scale 0.5x0.5 >> /etc/profile.d/pd.sh
|
||||
done
|
||||
STATUS=enabled
|
||||
elif [ $RET -eq 1 ]; then
|
||||
STATUS=disabled
|
||||
else
|
||||
return $RET
|
||||
fi
|
||||
fi
|
||||
if [ $RET -eq $CURRENT ]; then
|
||||
ASK_TO_REBOOT=1
|
||||
fi
|
||||
@ -1653,9 +1679,6 @@ do_internationalisation_menu() {
|
||||
}
|
||||
|
||||
do_interface_menu() {
|
||||
if ! is_pi ; then
|
||||
do_ssh
|
||||
else
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||
"P1 Camera" "Enable/Disable connection to the Raspberry Pi Camera" \
|
||||
"P2 SSH" "Enable/Disable remote command line access to your Pi using SSH" \
|
||||
@ -1682,7 +1705,6 @@ do_interface_menu() {
|
||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
do_advanced_menu() {
|
||||
@ -1783,10 +1805,11 @@ if [ "$INTERACTIVE" = True ]; then
|
||||
else
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \
|
||||
"1 Change User Password" "Change password for the current user" \
|
||||
"2 Hostname" "Set the visible name for this PC on a network" \
|
||||
"2 Network Options" "Configure network settings" \
|
||||
"3 Boot Options" "Configure options for start-up" \
|
||||
"4 Localisation Options" "Set up language and regional settings to match your location" \
|
||||
"5 SSH" "Enable/Disable remote command line access to your PC using SSH" \
|
||||
"6 Pixel Doubling" "Enable/Disable 2x2 pixel mapping" \
|
||||
"8 Update" "Update this tool to the latest version" \
|
||||
"9 About raspi-config" "Information about this configuration tool" \
|
||||
3>&1 1>&2 2>&3)
|
||||
@ -1795,6 +1818,7 @@ if [ "$INTERACTIVE" = True ]; then
|
||||
if [ $RET -eq 1 ]; then
|
||||
do_finish
|
||||
elif [ $RET -eq 0 ]; then
|
||||
if is_pi ; then
|
||||
case "$FUN" in
|
||||
1\ *) do_change_pass ;;
|
||||
2\ *) do_network_menu ;;
|
||||
@ -1807,6 +1831,19 @@ if [ "$INTERACTIVE" = True ]; then
|
||||
9\ *) do_about ;;
|
||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||
else
|
||||
case "$FUN" in
|
||||
1\ *) do_change_pass ;;
|
||||
2\ *) do_network_menu ;;
|
||||
3\ *) do_boot_menu ;;
|
||||
4\ *) do_internationalisation_menu ;;
|
||||
5\ *) do_ssh ;;
|
||||
6\ *) do_pixdub ;;
|
||||
8\ *) do_update ;;
|
||||
9\ *) do_about ;;
|
||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user