Restructuring the repo
This commit is contained in:
parent
21e3cf65e6
commit
3d67598c27
45 changed files with 368 additions and 77 deletions
17
misc/dbus-find
Executable file
17
misc/dbus-find
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue