mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-12-25 12:29:48 +00:00
17 lines
461 B
Bash
Executable File
17 lines
461 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [[ "$1" == "" || "$2" == "" ]]; then
|
|
echo -e "Usage:\t$0 X Y"
|
|
exit 1
|
|
fi
|
|
|
|
MONITOR_SIZE="$(xrandr | grep mm | head -n 1 | awk '{ print $(NF-2) " " $(NF) }' | sed 's/mm//g')"
|
|
CVT="$(cvt ${1} ${2} | grep Modeline)"
|
|
echo "{"
|
|
echo " services.xserver.monitorSection = ''"
|
|
echo " " ${CVT}
|
|
echo " " Option '"PreferredMode"' $(echo ${CVT} | awk '{ print $2 }')
|
|
echo " " DisplaySize ${MONITOR_SIZE} # In millimeters
|
|
echo " '';"
|
|
echo "}"
|