Restructuring the repo

This commit is contained in:
Alexander Gehrke 2020-04-02 10:38:36 +02:00
parent 21e3cf65e6
commit 3d67598c27
45 changed files with 368 additions and 77 deletions

17
misc/dbus-find Executable file
View file

@ -0,0 +1,17 @@
#!/bin/zsh
if [[ $1 == "-u" ]]; then
USER=$2
SUDO="sudo -u $USER"
shift 2
else
SUDO=
fi
export "$({for i in $(pgrep -u $USER dbus-daemon); grep -z DBUS_SESSION_BUS_ADDRESS /proc/$i/environ} | head -n 1)"
if [[ -z $DBUS_SESSION_BUS_ADDRESS ]]; then
echo "No DBUS found"
exit 1
else
exec $=SUDO "$@"
fi