mirror of
https://github.com/ben-grande/qusal.git
synced 2025-09-20 20:44:35 -04:00
feat: add monitor resize helper
This commit is contained in:
parent
599f044d58
commit
07e2321290
2 changed files with 35 additions and 1 deletions
25
salt/dom0/files/bin/qubes-gui-resolution
Executable file
25
salt/dom0/files/bin/qubes-gui-resolution
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# SPDX-FileCopyrightText: 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# https://www.qubes-os.org/doc/gui-configuration/#video-ram-adjustment-for-high-resolution-displays
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if ! command -v xrandr >/dev/null; then
|
||||||
|
print '%s\n' "missing program: xrandr" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
gui_mem="$(xrandr --listactivemonitors |
|
||||||
|
awk -F'[ /x]' '/^\s+[0-9]+/{if($4>max) max=$4; sum+=$6}
|
||||||
|
END {print max*sum*4/1024}')"
|
||||||
|
|
||||||
|
if test "${gui_mem}" = "0"; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
qvm-features dom0 gui-videoram-min "${gui_mem}"
|
||||||
|
qvm-features dom0 gui-videoram-overhead 0
|
|
@ -1,5 +1,5 @@
|
||||||
{#
|
{#
|
||||||
SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
SPDX-FileCopyrightText: 2024 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||||
|
|
||||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
#}
|
#}
|
||||||
|
@ -44,4 +44,13 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
- group: root
|
- group: root
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
"{{ slsdotpath }}-qubes-gui-resolution-helper":
|
||||||
|
file.managed:
|
||||||
|
- name: /usr/local/bin/qubes-gui-resolution
|
||||||
|
- source: salt://{{ slsdotpath }}/files/bin/qubes-gui-resolution
|
||||||
|
- mode: "0755"
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- makedirs: True
|
||||||
|
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue