Linux X11 changes in helix with Xbmcbuntu?
#1
Hello- i've noticed a change in Xbmcbuntu with the helix release that has broken some of my customizations -I'm looking for exactly what has changed to cause this new behavior.

I previously was using scripts such as this:
Code:
#!/bin/bash
openbox &
$1
wait %2
kill %1
to setup and tear down the required environment for running an external application like a web browser, emulator, terminal window, or the like via advanced launcher.

this shell script is passed the command to run, it runs the openbox window manager to manage focus, then when the command exits it kills openbox.

however, with the new helix release, something else seems to be happening as Kodi resists openbox and does not relinquish control of focus to openbox, and it now stays on the foreground, and you cannot alt-tab between the other application and kodi.

obviously, something has changed in the underlying configuration, but i'm not sure what.

this has broken a commonly used workaround, and therefore some addons like chrome launcher.

anyone shed some light on what has changed, so i can adapt my installation?
Reply
#2
SDL was dropped in favor of plain X11 windowing.
You should do it the other way round btw, just always start openbox and kodi on top of it.
Reply
#3
(2015-01-01, 22:45)wsnipex Wrote: SDL was dropped in favor of plain X11 windowing.
You should do it the other way round btw, just always start openbox and kodi on top of it.

interesting. where would be the most appropriate place to invoke openbox in the xbmcbuntu startup scripts?
Reply
#4
you should have a openbox session in the lightdm login window. Check the wrench icon top right. You need to exit kodi to get back to the login window.
Reply
#5
I start fluxbox or openbox by an upstart script. Kodi is launched by the autostart facilities of the WM.

EDIT: oh, question was about Xbmcbuntu.
Reply
#6
(2015-01-02, 09:21)wsnipex Wrote: you should have a openbox session in the lightdm login window. Check the wrench icon top right. You need to exit kodi to get back to the login window.

yes, that is a way to run openbox... but not really a solution.

I used kodi as a front end to this machine, and launch external applications via rom collection browser and advanced launcher. things liek a quick and easy terminal window, a file manager, Hulu desktop for linux, etc.

without a window manager to manage focus these don't really work that well, either not grabbing focus or not getting gamepad control, or launching not fullscreen and only using the top left 1/4 of the display with xbmc visible underneath it.

having to log out so i can log back in so i can launch this extrnal app isn't really a solution, as if i wanted to have to do that i'd just go into the full xbmcbuntu desktop and not launch them from xbmc.

i don't want to back out of XBMC anytime i want to do something beyond it, i use XBMC as a front-end for anything this machine does.

i have a kluge that is working now, what i have done:

edit /usr/bin/kodi-standalone and add this line,

Code:
openbox &

right after the

Code:
#  http://www.gnu.org/copyleft/gpl.html

line, so the full script reads:

Code:
#!/bin/sh

#      Copyright (C) 2009-2013 Team XBMC
#      http://xbmc.org
#
#  This Program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This Program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with XBMC; see the file COPYING.  If not, write to
#  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#  http://www.gnu.org/copyleft/gpl.html

openbox &

APP=Kodi
prefix="/usr"
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
bin_name=kodi
APP="${bindir}/${bin_name} --standalone $@"

PULSE_START="$(which start-pulseaudio-x11)"
if [ -n "$PULSE_START" ]; then
  $PULSE_START
else
  PULSE_SESSION="$(which pulse-session)"
  if [ -n "$PULSE_SESSION" ]; then
    XBMC="$PULSE_SESSION $XBMC"
  fi
fi

LOOP=1
CRASHCOUNT=0
LASTSUCCESSFULSTART=$(date +%s)

while [ $(( $LOOP )) = "1" ]
do
  $APP
  RET=$?
  NOW=$(date +%s)
  if [ $(( ($RET >= 64 && $RET <=66) || $RET == 0 )) = "1" ]; then # clean exit
    LOOP=0
  else # crash
    DIFF=$((NOW-LASTSUCCESSFULSTART))
    if [ $(($DIFF > 60 )) = "1" ]; then # Not on startup, ignore
      LASTSUCESSFULSTART=$NOW
      CRASHCOUNT=0
    else # at startup, look sharp
      CRASHCOUNT=$((CRASHCOUNT+1))
      if [ $(($CRASHCOUNT >= 3)) = "1" ]; then # Too many, bail out
        LOOP=0
        echo "${APP} has exited uncleanly 3 times in the last ${DIFF} seconds."
        echo "Something is probably wrong"
      fi
    fi
  fi
done

it's not as clean and as contained as the old fix of firing u p window manager when i fire up an external app and more likely to break with an XBMC update but it seems to be working for now. thoughts?
Reply
#7
as we both already said. Start openbox via lightdm and use a standard autostart for openbox to launch kodi. That way you always have a WM and kodi running at the same time and can switch to other X apps.
Reply
#8
(2015-01-02, 21:49)wsnipex Wrote: as we both already said. Start openbox via lightdm and use a standard autostart for openbox to launch kodi. That way you always have a WM and kodi running at the same time and can switch to other X apps.

I tried this solution and it works fine except that exiting Kodi won't terminate the XSession anymore.

I use Kodi as my main front end for my remote controlled HTPC. I want an easy way to get back to lightdm if I wish to quit Kodi (for example, if I want to launch the Lubuntu Session). Therefore I prefer a launch script that starts openbox/kodi just as rob has described.

I set up my own script that runs/configures openbox and then launches kodi-standalone.
This way, my tweaks won't be lost at the next kodi update. Then I created my own XSession that runs this script.

/usr/bin/kodi-session:
Code:
#!/bin/sh
# start openbox
openbox &

# disable screen blanking
xset s off;xset -dpms

# draw solid black background
hsetroot -solid "#000000"

# start kodi
kodi-standalone

/usr/share/xsessions/kodi-openbox.desktop:
Code:
[Desktop Entry]
Name=Kodi with Openbox
Comment=This session will start Kodi Media Center
Exec=kodi-session
TryExec=kodi-session
Type=Application
Reply
#9
Why don't you just run kodi on top of lxde? While your solution works, it seems unnecessarily complicated.
Reply
#10
(2015-01-06, 10:39)wsnipex Wrote: Why don't you just run kodi on top of lxde? While your solution works, it seems unnecessarily complicated.

Dumb noob question, but how do you do this?
Reply
#11
This is a guide for steam on xbmcbuntu using open box, you can pick out the bits not relevant to steam

http://forum.kodi.tv/showthread.php?tid=...pid1919154
Reply
#12
(2015-01-01, 22:45)wsnipex Wrote: SDL was dropped in favor of plain X11 windowing.
You should do it the other way round btw, just always start openbox and kodi on top of it.

oh, that may explain why i sometimes have suddently the X11 process running at >30% cpu load, everything is very sluggish and i see graphics distortions if kodi switches in window mode.

happend about three times now. kodi was ideling while i was at work and when i came back home i was wondering why everything feels so sluggish when kodi was in window mode etc.
Reply
#13
No need to reinvent the wheel people. Just use blackbox.
Reply

Logout Mark Read Team Forum Stats Members Help
X11 changes in helix with Xbmcbuntu?0