Add ability to select if you have a screen attached or not. This should solve screen vs headless mode problems with getting the GUI to start.
This commit is contained in:
66
.includes/toggle-screen.sh
Normal file
66
.includes/toggle-screen.sh
Normal file
@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Change between dummy and fbdev driver for X session.
|
||||
|
||||
active_screen() {
|
||||
cat << EOF | sudo "${sudoFlags[@]}" tee /etc/X11/xorg.conf.d/10-screendriver.conf &> /dev/null
|
||||
Section "Device"
|
||||
Identifier "FBdev"
|
||||
Driver "fbdev"
|
||||
EndSection
|
||||
EOF
|
||||
}
|
||||
|
||||
headless() {
|
||||
cat << EOF | sudo "${sudoFlags[@]}" tee /etc/X11/xorg.conf.d/10-screendriver.conf &> /dev/null
|
||||
Section "Monitor"
|
||||
Identifier "dummy_monitor"
|
||||
HorizSync 28.0-80.0
|
||||
VertRefresh 48.0-75.0
|
||||
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "dummy_card"
|
||||
VideoRam 256000
|
||||
Driver "dummy"
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "dummy_screen"
|
||||
Device "dummy_card"
|
||||
Monitor "dummy_monitor"
|
||||
SubSection "Display"
|
||||
EndSubSection
|
||||
EndSection
|
||||
[storm@fenrir ~] $ cat ~/99-headless.conf
|
||||
Section "Monitor"
|
||||
Identifier "dummy_monitor"
|
||||
HorizSync 28.0-80.0
|
||||
VertRefresh 48.0-75.0
|
||||
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "dummy_card"
|
||||
VideoRam 256000
|
||||
Driver "dummy"
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "dummy_screen"
|
||||
Device "dummy_card"
|
||||
Monitor "dummy_monitor"
|
||||
SubSection "Display"
|
||||
EndSubSection
|
||||
EndSection
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
answer=$(yesno "Do you have a physical screen attached?")
|
||||
if [[ "${answer}" == "yes" ]]; then
|
||||
active_screen
|
||||
else
|
||||
headless
|
||||
fi
|
Reference in New Issue
Block a user