Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
veldenb committed Nov 26, 2023
0 parents commit cdff9ca
Show file tree
Hide file tree
Showing 8 changed files with 772 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.idea/
/__pycache__
/python/
675 changes: 675 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Kodi plugin for launching Steam
A very simple plugin for launching Steam.
17 changes: 17 additions & 0 deletions addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import xbmcaddon
import xbmcgui
from subprocess import PIPE, run

# # Configure addon
addon = xbmcaddon.Addon()
executable = addon.getSettingString('command_to_execute')

if executable:
result = run([executable], stdout=PIPE, stderr=PIPE, universal_newlines=True)

# Check if command was successful
if result.returncode != 0:
dialog = xbmcgui.Dialog()
dialog.ok(addon.getLocalizedString(30004), result.stdout + result.stderr)
else:
addon.openSettings()
20 changes: 20 additions & 0 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.program.steam-launcher" name="Steam" version="1.0.0" provider-name="veldenb">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<extension point="xbmc.python.script" library="addon.py">
<provides>executable</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary>Simple Steam launcher</summary>
<description>This addon is a simple launcher that can launch Steam.</description>
<platform>all</platform>
<license>GPL-3.0-or-later</license>
<website>https://github.com/veldenb/plugin.program.steam-launcher</website>
<source>https://github.com/veldenb/plugin.program.steam-launcher</source>
<assets>
<icon>resources/icon.png</icon>
</assets>
</extension>
</addon>
Binary file added resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Kodi Media Center language file
# Addon Name: steam-launcher
# Addon id: plugin.program.steam-launcher
# Addon Provider: veldenb
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: veldenb\n"
"Language: en_GB\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language-Team: English, United Kingdom\n"

#
# Settings
#

msgctxt "#30000"
msgid "Executable"
msgstr "Executable"

msgctxt "#30001"
msgid "Command"
msgstr "Command"

msgctxt "#30002"
msgid "Command to execute"
msgstr "Command to execute"

msgctxt "#30003"
msgid "Set the command to execute"
msgstr "Set the command to execute"

msgctxt "#30004"
msgid "Error executing command"
msgstr "Error executing command"
21 changes: 21 additions & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" ?>
<settings version="1">
<section id="plugin.program.steam-launcher">
<category id="executable" label="30000">
<group id="command" label="30001">
<setting id="command_to_execute" type="path" label="30002" help="30003">
<level>0</level>
<default/>
<constraints>
<writable>false</writable>
<masking>executable</masking>
<allowempty>true</allowempty>
</constraints>
<control type="button" format="file">
<heading>30002</heading>
</control>
</setting>
</group>
</category>
</section>
</settings>

0 comments on commit cdff9ca

Please sign in to comment.