Allow per-user environment
This commit is contained in:
@@ -12,6 +12,8 @@ users:
|
|||||||
mail: hannes.koerber@tradebyte.com
|
mail: hannes.koerber@tradebyte.com
|
||||||
git_gpg_sign: false
|
git_gpg_sign: false
|
||||||
gpg_agent: false
|
gpg_agent: false
|
||||||
|
environment:
|
||||||
|
MACHINE_HAS_NEXTCLOUD: "false"
|
||||||
- name: hannes-private
|
- name: hannes-private
|
||||||
group: tpp
|
group: tpp
|
||||||
vt: 2
|
vt: 2
|
||||||
@@ -20,6 +22,8 @@ users:
|
|||||||
gpg_agent: true
|
gpg_agent: true
|
||||||
gpg_keys:
|
gpg_keys:
|
||||||
master_key: "0xB5C002530C6A2053"
|
master_key: "0xB5C002530C6A2053"
|
||||||
|
environment:
|
||||||
|
MACHINE_HAS_NEXTCLOUD: "true"
|
||||||
|
|
||||||
screen:
|
screen:
|
||||||
1: DP-1-1
|
1: DP-1-1
|
||||||
@@ -45,6 +49,5 @@ workspace:
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
MACHINE_HAS_KEEPASSX: "true"
|
MACHINE_HAS_KEEPASSX: "true"
|
||||||
MACHINE_HAS_NEXTCLOUD: "false"
|
|
||||||
MACHINE_HAS_RESTIC_BACKUP: "true"
|
MACHINE_HAS_RESTIC_BACKUP: "true"
|
||||||
MACHINE_HAS_SPOTIFY: "true"
|
MACHINE_HAS_SPOTIFY: "true"
|
||||||
|
|||||||
25
bin/dunstctl
Executable file
25
bin/dunstctl
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
_logfile="$LOGDIR/dunstctl.log"
|
||||||
|
|
||||||
|
log() {
|
||||||
|
printf '[%s] %s\n' "$(date -uIseconds)" "$*" >> "$_logfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
enable)
|
||||||
|
log "Enabling dunst"
|
||||||
|
systemctl --user --no-block kill --signal SIGUSR2 dunst_user
|
||||||
|
|
||||||
|
;;
|
||||||
|
disable)
|
||||||
|
log "Disabling dunst"
|
||||||
|
systemctl --user --no-block kill --signal SIGUSR1 dunst_user
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
>&2 printf 'Unknown command\n'
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
@@ -47,11 +47,11 @@ reset_screen() {
|
|||||||
lock_and_screen_off() {
|
lock_and_screen_off() {
|
||||||
lock &
|
lock &
|
||||||
_pid=$!
|
_pid=$!
|
||||||
systemctl --user --no-block kill --signal SIGUSR1 dunst_user
|
dunstctl disable
|
||||||
screen_off
|
screen_off
|
||||||
xset dpms 0 0 5
|
xset dpms 0 0 5
|
||||||
wait $_pid
|
wait $_pid
|
||||||
systemctl --user --no-block kill --signal SIGUSR2 dunst_user
|
dunstctl enable
|
||||||
reset_screen
|
reset_screen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ is_on() {
|
|||||||
|
|
||||||
switch_on() {
|
switch_on() {
|
||||||
touch "${_status_file}"
|
touch "${_status_file}"
|
||||||
systemctl --user --no-block kill --signal SIGUSR1 dunst_user
|
dunstctl disable &
|
||||||
systemctl --user --no-block stop redshift_user
|
systemctl --user --no-block stop redshift_user
|
||||||
systemctl --user --no-block stop spotify
|
systemctl --user --no-block stop spotify
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_off() {
|
switch_off() {
|
||||||
rm -f "${_status_file}"
|
rm -f "${_status_file}"
|
||||||
systemctl --user --no-block kill --signal SIGUSR2 dunst_user
|
dunstctl enable &
|
||||||
"$_autostart" redshift_user spotify
|
"$_autostart" redshift_user spotify
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ export ACPI_LID_NAME=LID
|
|||||||
|
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
||||||
{% for k, v in machine.environment.items() %}
|
{% set env = machine.environment | combine(user.environment) %}
|
||||||
|
{% for k, v in env.items() %}
|
||||||
export {{ k }}="{{ v }}"
|
export {{ k }}="{{ v }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user