[Linux] Launch-Script for laptops with external monitor

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
Post Reply
mupf
Posts: 3
Joined: 20 Sep 2017, 17:53
Github profile: https://github.com/mupfelofen-de

[Linux] Launch-Script for laptops with external monitor

Post by mupf » 21 Sep 2017, 11:03

Hello,
just another script I wrote for myself. It's very convenient if you're playing on a laptop with external monitor.
It's pretty much self explanatory but if you have any questions, feel free to ask.

Requirements: crudini and xdotool.

Code: Select all

#! /bin/bash

character="Allamu_Giladren"
resx=1366
resy=768
extresx=1220
extresy=685

if xrandr | grep "HDMI1 connected" > /dev/null; then
                crudini --set ~/.config/openmw/settings.cfg "Video" "fullscreen" false
                crudini --set ~/.config/openmw/settings.cfg "Video" "Screen" 1
                crudini --set ~/.config/openmw/settings.cfg "Video" "resolution x" $extresx
                crudini --set ~/.config/openmw/settings.cfg "Video" "resolution y" $extresy
                xdotool mousemove $((resx + extresx / 2)) $((extresy / 2))
else
        crudini --set ~/.config/openmw/settings.cfg "Video" "fullscreen" true
        crudini --set ~/.config/openmw/settings.cfg "Video" "Screen" 0
        crudini --set ~/.config/openmw/settings.cfg "Video" "resolution x" $resx
        crudini --set ~/.config/openmw/settings.cfg "Video" "resolution y" $resy
        xdotool mousemove $((resx / 2)) $((resy / 2))
fi

openmw \
                --skip-menu \
                --load-savegame ~/.local/share/openmw/saves/$character/Quicksave.omwsave

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest