Some dbus settings to enable mesh notifications

This commit is contained in:
Bob Mottram 2016-08-05 09:25:01 +01:00
parent 98afac9c4a
commit 97d93ab7d0
2 changed files with 12 additions and 1 deletions

View File

@ -586,6 +586,10 @@ function mesh_client_startup_applications {
echo 'dconf write /org/mate/caja/desktop/volumes-visible false' >> $START_DESKTOP
echo 'dconf write /org/mate/desktop/media-handling/automount-open false' >> $START_DESKTOP
echo 'dconf write /org/mate/desktop/screensaver/lock-enabled false' >> $START_DESKTOP
echo "touch /home/$MY_USERNAME/.dbus/Xdbus" >> $START_DESKTOP
echo "chmod 600 /home/$MY_USERNAME/.dbus/Xdbus" >> $START_DESKTOP
echo "env | grep DBUS_SESSION_BUS_ADDRESS > /home/$MY_USERNAME/.dbus/Xdbus" >> $START_DESKTOP
echo "echo 'export DBUS_SESSION_BUS_ADDRESS' >> /home/$MY_USERNAME/.dbus/Xdbus" >> $START_DESKTOP
chmod +x $START_DESKTOP
START_DESKTOP2=$rootdir/home/$MY_USERNAME/.config/autostart/mesh-start.desktop
@ -646,6 +650,8 @@ function configure_user_interface {
# to provide notifications
chroot "$rootdir" apt-get -y install libnotify-bin
# some dbus stuff to enable notifications
if [[ $VARIANT != "usb" ]]; then
# log in automatically
chroot "$rootdir" apt-get -y install nodm xinit

View File

@ -132,7 +132,12 @@ function detect_new_tox_users {
# get the nick of the user
toxuser="$(echo "$line" | awk -F ' ' '{print $1}')"
export DISPLAY=:0.0 && export XAUTHORITY=/home/$MESH_USERNAME/.Xauthority && sudo -u MESH_USERNAME /usr/bin/notify-send $"$toxuser" $"has joined the mesh" --icon=dialog-information
if [ -r "/home/$MESH_USERNAME/.dbus/Xdbus" ]; then
. "/home/$MESH_USERNAME/.dbus/Xdbus"
fi
export DISPLAY=:0.0
export XAUTHORITY=/home/$MESH_USERNAME/.Xauthority
sudo -u MESH_USERNAME /usr/bin/notify-send $"$toxuser" $"has joined the mesh" --icon=dialog-information
break
fi
fi