فهرست منبع

Merge branch 'master' of https://tree.clementinecomputing.com/clementinecomputing/popufare

clementinecomputing 5 سال پیش
والد
کامیت
18ae842a99
3فایلهای تغییر یافته به همراه23 افزوده شده و 6 حذف شده
  1. 1 2
      busunit/DIUv2/html/js/diu_ui-ORG.js
  2. 17 4
      busunit/scripts/dim
  3. 5 0
      busunit/scripts/start-kiosk.sh

+ 1 - 2
busunit/DIUv2/html/js/diu_ui-ORG.js

@@ -18,8 +18,7 @@
  *
  */
 
-//var _ADDRESS = "localhost";
-var _ADDRESS = "192.168.0.32";
+var _ADDRESS = "localhost";
 var _URL = "http://" + _ADDRESS;
 var _PORT = 60535;
 

+ 17 - 4
busunit/scripts/dim

@@ -18,8 +18,21 @@
 # along with PopuFare.  If not, see <https://www.gnu.org/licenses/>.
 #
 
-unset XAUTHORITY
-xauth add $(xauth list | tail -n1)
-disp=`xauth list | tail -n1 | cut -f1 -d' ' | cut -f2 -d':'`
-/usr/bin/xset -display ":$disp" dpms force off
+infofn="/tmp/kiosk.info"
+
+export DISPLAY=':0'
+export XAUTHORITY='/home/pi/.Xauthority'
+
+if [[ -e "/tmp/kiosk.info" ]] ; then
+
+  disp=`grep DISPLAY $infofn | cut -f2 -d'='`
+  auth=`grep XAUTHORITY $infofn | cut -f2 -d'='`
+
+  export DISPLAY="$disp"
+  export XAUTHORITY="$auth"
+
+fi
+
+/usr/bin/xset dpms force off
+exit 0
 

+ 5 - 0
busunit/scripts/start-kiosk.sh

@@ -42,6 +42,11 @@ xset s off
 xset -dpms
 unclutter -idle 0.05 -root &
 
+rm -f /tmp/kiosk.info
+touch /tmp/kiosk.info
+echo "DISPLAY=$DISPLAY" >> /tmp/kiosk.info
+echo "XAUTHORITY=$XAUTHORITY" >> /tmp/kiosk.info
+
 # start chromium in kiosk mode
 #
 #/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk ./html/index.html