Skip to content

Commit

Permalink
Fix service stop on Ubuntu 12.04 and match Chromium with PID instead …
Browse files Browse the repository at this point in the history
…of class name
  • Loading branch information
schlomo committed Feb 13, 2015
1 parent c5a698f commit 1e7d3b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: kiosk-browser
Version: 49
Version: 50
Priority: optional
Section: web
Architecture: all
Expand Down
5 changes: 4 additions & 1 deletion src/usr/share/kiosk-browser/openbox-rc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ openbox configuration for kiosk-browser

<openbox_config xmlns="http://openbox.org/3.4/rc"
xmlns:xi="http://www.w3.org/2001/XInclude">
<desktops>
<number>1</number>
</desktops>

<applications>
<application name="*">
Expand All @@ -19,7 +22,7 @@ openbox configuration for kiosk-browser
<skip_taskbar>yes</skip_taskbar>
</application>

<application class="Chromium">
<application class="*omium*">
<maximized>true</maximized>
</application>

Expand Down
8 changes: 6 additions & 2 deletions src/usr/share/kiosk-browser/xsession.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function exittrap {
rm -Rf $HOME
) </dev/null &
}
trap exittrap EXIT # kill subprocesses on exit
trap exittrap TERM EXIT # kill subprocesses on exit

# Wait 30 seconds for network by checking for default route
(( end_time=SECONDS+30 ))
Expand Down Expand Up @@ -154,6 +154,9 @@ UZBL_CONFIG="set show_status=0
set geometry=maximized"

while true; do
# exit if no display given, use xwininfo to test for running X server
xwininfo -root &>/dev/null || exit 0

# if KIOSK_BROWSER_PORTS is set, assume that it specifies multiple screens connected.
for (( c=0 ; c<${#KIOSK_BROWSER_PORTS[@]} ; c++ )) ; do
port=$(xrandr_find_port "${KIOSK_BROWSER_PORTS[c]}")
Expand All @@ -177,11 +180,12 @@ while true; do
xdotool search --class uzbl-$c windowmove --sync $port_x 0
else
$CHROME --user-data-dir=$BROWSER_PROFILE_DIR "${KIOSK_BROWSER_OPTIONS[@]}" --disable-translate --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 :-)

starttime=$SECONDS
while ! xdotool search --classname $BROWSER_PROFILE_DIR windowmove --sync $port_x 0 ; do
while ! xdotool search --onlyvisible --pid $PID --name any windowmove --sync $port_x 0 ; do
if (( SECONDS-starttime > 30 )) ; then
break
fi
Expand Down

0 comments on commit 1e7d3b2

Please sign in to comment.