mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-27 10:31:31 +00:00
Generate X monitor section is no more required
This commit is contained in:
parent
1270b2e209
commit
55a825a7c0
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1 @@
|
||||||
nix/local.nix
|
nix/local.nix
|
||||||
nix/monitor.nix
|
|
|
@ -42,14 +42,6 @@ You need to **relogin** if you install virt-manager (libvirt) first time.
|
||||||
|
|
||||||
$ go get -u code.dumpstack.io/tools/appvm
|
$ go get -u code.dumpstack.io/tools/appvm
|
||||||
|
|
||||||
## Generate resolution
|
|
||||||
|
|
||||||
By default uses 1920x1080. If you need to regenerate `appvm/nix/monitor.nix`:
|
|
||||||
|
|
||||||
$ $GOPATH/src/code.dumpstack.io/tools/appvm/generate-resolution.sh 3840 2160 > $GOPATH/src/code.dumpstack.io/tools/appvm/nix/monitor.nix
|
|
||||||
|
|
||||||
Autodetection is a bash-spaghetti, so you need to check results. BTW it's just a X.org monitor section.
|
|
||||||
|
|
||||||
## Run application
|
## Run application
|
||||||
|
|
||||||
$ appvm start chromium --verbose
|
$ appvm start chromium --verbose
|
||||||
|
|
10
appvm.go
10
appvm.go
|
@ -125,8 +125,8 @@ func list(l *libvirt.Libvirt) {
|
||||||
|
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
if f.Name() != "base.nix" &&
|
if f.Name() != "base.nix" &&
|
||||||
f.Name() != "local.nix" && f.Name() != "monitor.nix" &&
|
f.Name() != "local.nix" &&
|
||||||
f.Name() != "local.nix.template" && f.Name() != "monitor.nix.template" {
|
f.Name() != "local.nix.template" {
|
||||||
fmt.Println("\t", f.Name()[0:len(f.Name())-4])
|
fmt.Println("\t", f.Name()[0:len(f.Name())-4])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,12 +161,6 @@ func prepareTemplates(appvmPath string) (err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err = os.Stat(appvmPath + "/nix/monitor.nix"); os.IsNotExist(err) {
|
|
||||||
err = copyFile(appvmPath+"/nix/monitor.nix.template", appvmPath+"/nix/monitor.nix")
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
#!/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 "}"
|
|
|
@ -1,7 +1,6 @@
|
||||||
{pkgs, ...}:
|
{pkgs, ...}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
<nix/monitor.nix>
|
|
||||||
<nix/local.nix>
|
<nix/local.nix>
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
services.xserver.monitorSection = ''
|
|
||||||
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
|
|
||||||
Option "PreferredMode" "1920x1080_60.00"
|
|
||||||
'';
|
|
||||||
}
|
|
Loading…
Reference in a new issue