浏览代码

Some dbus settings to enable mesh notifications

Bob Mottram 8 年前
父节点
当前提交
97d93ab7d0
共有 2 个文件被更改,包括 12 次插入1 次删除
  1. 6
    0
      src/freedombone-image-customise
  2. 6
    1
      src/zeronetavahi

+ 6
- 0
src/freedombone-image-customise 查看文件

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

+ 6
- 1
src/zeronetavahi 查看文件

@@ -132,7 +132,12 @@ function detect_new_tox_users {
132 132
                     # get the nick of the user
133 133
                     toxuser="$(echo "$line" | awk -F ' ' '{print $1}')"
134 134
 
135
-                    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
135
+                    if [ -r "/home/$MESH_USERNAME/.dbus/Xdbus" ]; then
136
+                        . "/home/$MESH_USERNAME/.dbus/Xdbus"
137
+                    fi
138
+                    export DISPLAY=:0.0
139
+                    export XAUTHORITY=/home/$MESH_USERNAME/.Xauthority
140
+                    sudo -u MESH_USERNAME /usr/bin/notify-send $"$toxuser" $"has joined the mesh" --icon=dialog-information
136 141
                     break
137 142
                 fi
138 143
             fi