Fix systemd user unit names in scripts

This commit is contained in:
2020-12-11 20:05:55 +01:00
parent 6ede93b0e9
commit 2dc1b6387e
3 changed files with 18 additions and 5 deletions

View File

@@ -11,12 +11,12 @@ log() {
case "$1" in case "$1" in
enable) enable)
log "Enabling dunst" log "Enabling dunst"
systemctl --user --no-block kill --signal SIGUSR2 dunst_user systemctl --user --no-block kill --signal SIGUSR2 user:dunst
;; ;;
disable) disable)
log "Disabling dunst" log "Disabling dunst"
systemctl --user --no-block kill --signal SIGUSR1 dunst_user systemctl --user --no-block kill --signal SIGUSR1 user:dunst
;; ;;
*) *)
>&2 printf 'Unknown command\n' >&2 printf 'Unknown command\n'

View File

@@ -10,14 +10,14 @@ is_on() {
switch_on() { switch_on() {
touch "${_status_file}" touch "${_status_file}"
dunstctl disable & dunstctl disable &
systemctl --user --no-block stop redshift_user systemctl --user --no-block stop user:redshift
systemctl --user --no-block stop spotify systemctl --user --no-block stop user:spotify
} }
switch_off() { switch_off() {
rm -f "${_status_file}" rm -f "${_status_file}"
dunstctl enable & dunstctl enable &
"$_autostart" redshift_user spotify "$_autostart" redshift spotify
} }

View File

@@ -66,6 +66,19 @@
become: true become: true
become_user: root become_user: root
- name: disable and mask systemd user units
systemd:
name: "{{ item }}"
enabled: false
masked: true
scope: user
with_items:
- gpg-agent.service
- gpg-agent.socket
- gpg-agent-browser.socket
- gpg-agent-ssh.socket
tags: [test]
- name: create directory for getty autologin - name: create directory for getty autologin
file: file:
state: directory state: directory