OSDN Git Service

offer to fix resolution on a virtualmachine
authorpaperbenni <paperbenni@gmail.com>
Tue, 9 Jun 2020 17:46:39 +0000 (19:46 +0200)
committerpaperbenni <paperbenni@gmail.com>
Tue, 9 Jun 2020 17:46:39 +0000 (19:46 +0200)
autostart.sh

index f68592b..7ba4f9b 100755 (executable)
@@ -38,11 +38,6 @@ fi
 if [ -e /usr/share/liveutils ] &>/dev/null; then
        ISLIVE="True"
        echo "live session detected"
-
-       # fix resolution on virtualbox
-       if sudo dmidecode | grep -iq 'virtualbox'; then
-               bash /opt/instantos/menus/dm/tv.sh
-       fi
 fi
 
 # fix small graphical glitch on status bar startup
@@ -125,6 +120,19 @@ if ! [ iconf -i userinstall ]; then
        bash /usr/share/instantutils/userinstall.sh
 fi
 
+# fix resolution on virtual machine
+if ! iconf -i novmfix && cat /proc/cpuinfo | grep -q hypervisor; then
+       if echo "virtual machine detected.
+Would you like to switch to a 1080p resolution?" | imenu -C; then
+               echo "applying virtualbox workaround"
+               /opt/instantos/menus/dm/tv.sh
+       else
+               if ! imenu -c "ask again next session"; then
+                       iconf -i novmfix 1
+               fi
+       fi
+fi
+
 if [ -z "$ISLIVE" ]; then
        echo "not a live session"
        if [ -e /opt/instantos/installtrigger ]; then