summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-system/lh_notify-send
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2022-12-22 21:26:40 (GMT)
committerBritney Fransen <brfransen@gmail.com>2022-12-22 21:26:40 (GMT)
commit89ea4d27868636f27241dbcd23dda9b4d73592f7 (patch)
tree5707bb2174325c906a532a0088c53b63c8b91e51 /linhes/linhes-system/lh_notify-send
parentd71a8c4bf9661ab7e25c85dacede49375b624fa7 (diff)
downloadlinhes_pkgbuild-89ea4d27868636f27241dbcd23dda9b4d73592f7.zip
linhes_pkgbuild-89ea4d27868636f27241dbcd23dda9b4d73592f7.tar.gz
linhes_pkgbuild-89ea4d27868636f27241dbcd23dda9b4d73592f7.tar.bz2
linhes-system: add_storage.py: remove old LH8 installer things
Diffstat (limited to 'linhes/linhes-system/lh_notify-send')
-rwxr-xr-xlinhes/linhes-system/lh_notify-send12
1 files changed, 12 insertions, 0 deletions
diff --git a/linhes/linhes-system/lh_notify-send b/linhes/linhes-system/lh_notify-send
new file mode 100755
index 0000000..dd98ede
--- /dev/null
+++ b/linhes/linhes-system/lh_notify-send
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+#Detect the name of the display in use
+display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)"
+
+#Detect the user using such display
+user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1)
+
+#Detect the id of the user
+uid=$(id -u $user)
+
+sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send "$@"