Explorar el Código

Some dbus settings to enable mesh notifications

Bob Mottram hace 8 años
padre
commit
97d93ab7d0
Se han modificado 2 ficheros con 12 adiciones y 1 borrados
  1. 6
    0
      src/freedombone-image-customise
  2. 6
    1
      src/zeronetavahi

+ 6
- 0
src/freedombone-image-customise Ver fichero

586
     echo 'dconf write /org/mate/caja/desktop/volumes-visible false' >> $START_DESKTOP
586
     echo 'dconf write /org/mate/caja/desktop/volumes-visible false' >> $START_DESKTOP
587
     echo 'dconf write /org/mate/desktop/media-handling/automount-open false' >> $START_DESKTOP
587
     echo 'dconf write /org/mate/desktop/media-handling/automount-open false' >> $START_DESKTOP
588
     echo 'dconf write /org/mate/desktop/screensaver/lock-enabled false' >> $START_DESKTOP
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
     chmod +x $START_DESKTOP
593
     chmod +x $START_DESKTOP
590
 
594
 
591
     START_DESKTOP2=$rootdir/home/$MY_USERNAME/.config/autostart/mesh-start.desktop
595
     START_DESKTOP2=$rootdir/home/$MY_USERNAME/.config/autostart/mesh-start.desktop
646
     # to provide notifications
650
     # to provide notifications
647
     chroot "$rootdir" apt-get -y install libnotify-bin
651
     chroot "$rootdir" apt-get -y install libnotify-bin
648
 
652
 
653
+    # some dbus stuff to enable notifications
654
+
649
     if [[ $VARIANT != "usb" ]]; then
655
     if [[ $VARIANT != "usb" ]]; then
650
         # log in automatically
656
         # log in automatically
651
         chroot "$rootdir" apt-get -y install nodm xinit
657
         chroot "$rootdir" apt-get -y install nodm xinit

+ 6
- 1
src/zeronetavahi Ver fichero

132
                     # get the nick of the user
132
                     # get the nick of the user
133
                     toxuser="$(echo "$line" | awk -F ' ' '{print $1}')"
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
                     break
141
                     break
137
                 fi
142
                 fi
138
             fi
143
             fi