vibed improved gc
This commit is contained in:
parent
a79ca6a399
commit
9cb871275a
5 changed files with 208 additions and 4 deletions
23
util/system_notify.sh
Normal file
23
util/system_notify.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
set -o pipefail
|
||||
|
||||
target_user="${SYSTEM_NOTIFY_USER:-alisceon}"
|
||||
urgency="${1:-normal}"
|
||||
title="${2:-System task}"
|
||||
body="${3:-}"
|
||||
|
||||
uid="$(id -u "$target_user" 2>/dev/null || true)"
|
||||
[ -n "$uid" ] || exit 0
|
||||
|
||||
runtime_dir="/run/user/$uid"
|
||||
bus="$runtime_dir/bus"
|
||||
[ -S "$bus" ] || exit 0
|
||||
|
||||
runuser -u "$target_user" -- env \
|
||||
XDG_RUNTIME_DIR="$runtime_dir" \
|
||||
DBUS_SESSION_BUS_ADDRESS="unix:path=$bus" \
|
||||
notify-send \
|
||||
--app-name="NixOS maintenance" \
|
||||
--urgency="$urgency" \
|
||||
"$title" \
|
||||
"$body" \
|
||||
|| exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue