2024-03-15 06:03:00 -04:00
|
|
|
{#
|
|
|
|
SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
#}
|
|
|
|
|
|
|
|
{% if grains['nodename'] == 'dom0' -%}
|
|
|
|
|
2024-04-30 10:04:40 -04:00
|
|
|
{%- import slsdotpath ~ "/gui-user.jinja" as gui_user -%}
|
|
|
|
|
2024-03-18 11:29:01 -04:00
|
|
|
include:
|
|
|
|
- utils.tools.common.update
|
2024-03-15 06:03:00 -04:00
|
|
|
|
|
|
|
"{{ slsdotpath }}-screenshot-installed":
|
|
|
|
pkg.installed:
|
|
|
|
- require:
|
2024-03-18 11:29:01 -04:00
|
|
|
- sls: utils.tools.common.update
|
2024-03-15 06:03:00 -04:00
|
|
|
- install_recommends: False
|
|
|
|
- skip_suggestions: True
|
|
|
|
- pkgs:
|
|
|
|
- zenity
|
2024-05-24 16:56:32 -04:00
|
|
|
- maim
|
2024-03-15 06:03:00 -04:00
|
|
|
|
|
|
|
"{{ 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: |
|
2024-04-30 10:04:40 -04:00
|
|
|
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/{{ gui_user.gui_user_id }}/bus"
|
2024-03-15 06:03:00 -04:00
|
|
|
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"
|
2024-04-30 10:04:40 -04:00
|
|
|
- runas: {{ gui_user.gui_user }}
|
2024-03-15 06:03:00 -04:00
|
|
|
- require:
|
|
|
|
- file: "{{ slsdotpath }}-screenshot-script"
|
|
|
|
|
|
|
|
{% endif -%}
|