mirror of
https://github.com/ben-grande/qusal.git
synced 2024-12-12 01:14:23 -05:00
5722a25779
Useful when Dom0 has the non-default username, less useful for DomUs. Fixes: https://github.com/ben-grande/qusal/issues/43
48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
{#
|
|
SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
#}
|
|
|
|
{% if grains['nodename'] == 'dom0' -%}
|
|
|
|
{%- import slsdotpath ~ "/gui-user.jinja" as gui_user -%}
|
|
|
|
include:
|
|
- utils.tools.common.update
|
|
|
|
"{{ slsdotpath }}-screenshot-installed":
|
|
pkg.installed:
|
|
- require:
|
|
- sls: utils.tools.common.update
|
|
- install_recommends: False
|
|
- skip_suggestions: True
|
|
- pkgs:
|
|
- zenity
|
|
- scrot
|
|
|
|
"{{ slsdotpath }}-screenshot-script":
|
|
file.managed:
|
|
- name: /usr/local/bin/qvm-screenshot
|
|
- source: salt://{{ slsdotpath }}/files/bin/qvm-screenshot
|
|
- mode: "0755"
|
|
- user: root
|
|
- group: root
|
|
- makedirs: True
|
|
- require:
|
|
- pkg: "{{ slsdotpath }}-screenshot-installed"
|
|
|
|
## TODO: KDE shortcuts
|
|
"{{ slsdotpath }}-screenshot-keyboard-shortcuts-xfce":
|
|
cmd.run:
|
|
- name: |
|
|
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/{{ gui_user.gui_user_id }}/bus"
|
|
export DBUS_SESSION_BUS_ADDRESS
|
|
xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/Print" -n -s "qvm-screenshot --fullscreen"
|
|
xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Alt>Print" -n -s "qvm-screenshot --region"
|
|
- runas: {{ gui_user.gui_user }}
|
|
- require:
|
|
- file: "{{ slsdotpath }}-screenshot-script"
|
|
|
|
{% endif -%}
|