feat: get GUI user with salt modules

This commit is contained in:
Ben Grande 2024-06-28 19:28:49 +02:00
parent 077b21d3a4
commit f903c0e3df
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56

View File

@ -4,6 +4,6 @@ SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% set gui_user = salt['cmd.shell']("getent group qubes | awk -F '[:,]' '{print $4}'") -%}
{% set gui_user_id = salt['cmd.shell']("getent passwd " ~ gui_user ~ " | awk -F ':' '{print $3}'") -%}
{% set gui_user_home = salt['cmd.shell']("getent passwd " ~ gui_user ~ " | awk -F ':' '{print $6}'") -%}
{% set gui_user = salt["group.info"]("qubes").get("members")[0] -%}
{% set gui_user_id = salt["user.info"](gui_user).get("uid") -%}
{% set gui_user_home = salt["user.info"](gui_user).get("home") -%}