From f45ebcdba8e5a81aa8ee704894eb018003bb5fbc Mon Sep 17 00:00:00 2001 From: Schlomo Schapiro Date: Sat, 16 Feb 2019 20:57:27 +0100 Subject: [PATCH] Use Chrome policy to disable translate old way doesn't work any more --- Makefile | 3 ++- kiosk-browser.json | 3 +++ xsession.sh | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 kiosk-browser.json diff --git a/Makefile b/Makefile index 378ed19..88ba74f 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ release: commit-release deb changelog=$$(git log $$comparison --oneline --no-merges --reverse); \ github-release schlomo/$(PACKAGE) v$(VERSION) "$$(git rev-parse --abbrev-ref HEAD)" "**Changelog**
$$changelog" 'out/*.deb'; \ git pull - dput ppa:sschapiro/ubuntu/ppa/xenial out/$(PACKAGE)_*_source.changes + dput ppa:sschapiro/ubuntu/ppa/bionic out/$(PACKAGE)_*_source.changes test: ./runtests.sh @@ -36,6 +36,7 @@ install: install -m 0644 sudoers -D $(DESTDIR)/etc/sudoers.d/$(PACKAGE) install -m 0644 XOsview -D -t $(DESTDIR)/usr/lib/X11/app-defaults install -m 0755 xsession.sh -D -t $(DESTDIR)/usr/share/$(PACKAGE) + install -m 0644 kiosk-browser.json -D -t $(DESTDIR)/etc/chromium-browser/policies/recommended clean: rm -Rf debian/$(PACKAGE) debian/*debhelper* debian/*substvars debian/files out/* diff --git a/kiosk-browser.json b/kiosk-browser.json new file mode 100644 index 0000000..1ebb9c0 --- /dev/null +++ b/kiosk-browser.json @@ -0,0 +1,3 @@ +{ + "TranslateEnabled": false +} diff --git a/xsession.sh b/xsession.sh index 968c33d..706daa2 100755 --- a/xsession.sh +++ b/xsession.sh @@ -54,7 +54,7 @@ done perl -e '$/ = undef; $d=<>; $d =~ m/.*(lease \{.*?\})$/s ; print $1' $(ps ax | grep dhclient | sed -ne "s/.* \(\/[^ ]\+\.lease[s]\?\).*/\1/p") <<<"" echo echo "This message will self-destruct in 60 seconds" -} | osd_cat --pos bottom --align left --colour green --outline 2 --font 10x20 --lines 50 --delay 60 & +} | sed -e 's/●/ /g' | osd_cat --offset 10 --indent 10 --colour green --outline 2 --font 10x20 --lines 50 --delay 60 & disown -a # forget about running osd_cat, it will terminate itself anyway @@ -202,7 +202,7 @@ while sleep 5 & wait $!; do wait $! xdotool search --class uzbl-$c windowmove --sync $port_x 0 else - $CHROME --user-data-dir=$BROWSER_PROFILE_DIR "${KIOSK_BROWSER_OPTIONS[@]}" --use-fake-ui-for-media-stream --disable-translate --no-first-run --start-fullscreen --app="$URL" & + $CHROME --user-data-dir=$BROWSER_PROFILE_DIR "${KIOSK_BROWSER_OPTIONS[@]}" --use-fake-ui-for-media-stream --no-first-run --start-fullscreen --app="$URL" & PID=$! # move new window to the current screen. We identify the window by the --user-data-dir option which appears in the window class name :-)