mirror of
https://github.com/ben-grande/qusal.git
synced 2025-04-10 18:09:24 -04:00
feat: add monitor resize helper
This commit is contained in:
parent
599f044d58
commit
07e2321290
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
|
||||
#}
|
||||
@ -44,4 +44,13 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
- group: root
|
||||
- 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 -%}
|
||||
|
Loading…
x
Reference in New Issue
Block a user