swetoast / steamlink-launcher

Steamlink launcher for OSMC
GNU General Public License v2.0
155 stars 19 forks source link

PATH not correct when launching steamlink #9

Closed slouken closed 4 years ago

slouken commented 4 years ago

Launching Steam Link for the first time fails because the path isn't set correctly, /sbin and /usr/sbin are not in the path, so package installation fails.

swetoast commented 4 years ago
$ which steamlink
/usr/bin/steamlink

so we need a variable in that cause my steamlink is at this location

slouken commented 4 years ago

This is a duplicate of this bug, and presumably his fix will work: https://github.com/swetoast/steamlink-launcher/issues/7

swetoast commented 4 years ago

yepp but yours makes sense :P ill get around to fixing it so it looks up where steamlink is located aand then launches it and ill fix the other issue with missing group

slouken commented 4 years ago

The problem is not that steamlink isn't found, it's that steamlink's package installation fails, because /sbin and /usr/sbin aren't in the path. Package installation fails with the error message listed in the other bug, and steamlink Qt initialization fails with missing libraries.

I think sudo - osmc is the right fix.

swetoast commented 4 years ago

updated the launcher its on version 19 for kodi however its easily changed by modifying the line

https://github.com/swetoast/steamlink-launcher/blob/master/plugin.program.steamlink/addon.xml#L4

to kodi 18.5 dont remember exactly what version that was but it should be in the old plugin xml file

let me know if the fixed ive added works

slouken commented 4 years ago

Here's a version that works for me, including downloading and installing Steam Link: ` """Steamlink Launcher for OSMC""" import os import xbmc import xbmcgui import xbmcaddon

plugin = "steamlink" author = "toast" url = "https://github.com/swetoast/steamlink-launcher/" __git_url = "https://github.com/swetoast/steamlink-launcher/" credits = "toast" version__ = "0.0.5"

dialog = xbmcgui.Dialog() addon = xbmcaddon.Addon(id='plugin.program.steamlink')

def main(): """Main operations of this plugin.""" create_files() output = os.popen("sh /tmp/steamlink-launcher.sh").read() dialog.ok("Starting Steamlink", output)

print output

def create_files(): """Creates bash files to be used for this plugin.""" with open('/tmp/steamlink-launcher.sh', 'w') as outfile: outfile.write('#!/bin/bash\n' 'sudo openvt -c 7 -s -f clear\n' 'if [ ! -f /usr/bin/steamlink ]; then curl -o /tmp/steamlink.deb -#Of http://media.steampowered.com/steamlink/rpi/steamlink.deb; sudo dpkg -i /tmp/steamlink.deb; rm -f /tmp/steamlink.deb; fi\n' 'sudo su - osmc -c "sh /tmp/steamlink-watchdog.sh &" &\n' 'sudo su - osmc -c "nohup openvt -c 7 -f -s steamlink >/dev/null 2>&1 &" &\n' 'sudo openvt -c 7 -s -f clear\n' 'sudo su -c "systemctl stop mediacenter &" &\n' 'exit') outfile.close() with open('/tmp/steamlink-watchdog.sh', 'w') as outfile: outfile.write('#!/bin/bash\n' 'if [ "$HYPERIONFIX" = 1 ]; then if [ "$(pgrep hyperion)" ]; ' 'then sudo service hyperion stop; fi; fi\n' 'sleep 8\n' 'if [ "$HYPERIONFIX" = 1 ]; then if [ ! "$(pgrep hyperion)" ]; then ' 'sudo service hyperion start; fi; fi\n' 'while true; do VAR1="$(pgrep steamlink)"; if [ ! "$VAR1" ]; then\n' 'sudo openvt -c 7 -s -f clear; sudo su -c ' '"sudo systemctl restart mediacenter &" &\n' 'exit\n' 'fi\n' 'done\n' 'exit') outfile.close() main() `

swetoast commented 4 years ago

mind doing a pr ? kinda rushed today

slouken commented 4 years ago

Sure, sorry, that was messy. I'll do it properly.

slouken commented 4 years ago

Here you go! https://github.com/swetoast/steamlink-launcher/pull/11 I also made it so Steam Link is downloaded and installed if needed.

swetoast commented 4 years ago

tnx will review after work thinking of using the tar.gz instead of the deb package this gives me greater control on where steamlink is installed so this launcher can work on both *elec and osmc installs but its a good first start towards that path