Skip to content

Commit e21c9d3

Browse files
committed
v1.0.1
1 parent 9bc5b41 commit e21c9d3

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Kodi addon to execute shell scripts or commands. It displays a menu to select the script that shall be executed. The menu is defined in a text file, that is ":" separated (see example.menu). The menu file can be selected in the addon settings.
44

5-
[Version 1.0.0](https://github.com/wastis/LinuxAddonRepo)
5+
[Version 1.0.1](https://github.com/wastis/LinuxAddonRepo)
66

77
<img src="resources/media/icon.png" alt="drawing" width="200"/>
88

@@ -26,6 +26,12 @@ The flags are comma separated. Currently there are two flags defined
2626
Ping Server:notify,exitcode 0:ping -c 1 192.168.1.1
2727

2828

29+
## Assign Remote Key to Menu Entry
30+
The scripts can be launched with a single keystroke. To execute menu entry 1, add following command to your keyboard.xml.
31+
32+
RunScript(script.shellscript.launcher,1)
33+
34+
2935
2022 wastis
3036

3137

addon.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.shellscript.launcher" name="Shell Script Launcher" version="1.0.0" provider-name="wastis">
2+
<addon id="script.shellscript.launcher" name="Shell Script Launcher" version="1.0.1" provider-name="wastis">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
55
</requires>
@@ -17,7 +17,8 @@
1717
<disclaimer lang="en_GB"></disclaimer>
1818
<disclaimer lang="de_DE"></disclaimer>
1919
<news>
20-
20+
v1.0.1 (2022/10/18)
21+
- support inividual keyboard keys per menu item.
2122
v1.0.0
2223
- removed blocking flag as non blocking it produced zombie processes
2324
- introduced flags notify, exitcode

resources/lib/menu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import xbmcgui
1313
import xbmcaddon
1414
from xbmcgui import ListItem
15-
15+
from log import log
1616
addon = xbmcaddon.Addon()
1717
def tr(lid):
1818
return addon.getLocalizedString(lid)
@@ -72,7 +72,7 @@ def ok_pressed(self):
7272
self.close()
7373

7474
def onAction( self, action ):
75-
#log("action id %s" % action.getId())
75+
log("action id %s" % action.getId())
7676

7777
#OK pressed
7878
if action.getId() in [7, 100]:

resources/lib/runaddon.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#
1111

1212
import os
13+
import sys
1314
import subprocess
1415

1516
import xbmcaddon
@@ -94,19 +95,29 @@ def run_addon():
9495
return
9596

9697
#
97-
# show menu dialog
98+
# check if parameter was given
9899
#
99100

100-
current_skin = xbmc.getSkinDir()
101-
102-
if os.path.exists(os.path.join(cwd,"resources","skins",current_skin)):
103-
skin = current_skin
101+
if len(sys.argv)>1:
102+
selected = int(sys.argv[1])
103+
if selected >= len(menu_items):
104+
log("no script for %d" % selected)
105+
return
104106
else:
105-
skin = "Default"
107+
#
108+
# show menu dialog
109+
#
110+
111+
current_skin = xbmc.getSkinDir()
112+
113+
if os.path.exists(os.path.join(cwd,"resources","skins",current_skin)):
114+
skin = current_skin
115+
else:
116+
skin = "Default"
106117

107-
ui = MenuGui("menu.xml", cwd, skin, "1080i", menu = menu_items, width = 400)
108-
ui.doModal()
109-
selected = ui.selected
118+
ui = MenuGui("menu.xml", cwd, skin, "1080i", menu = menu_items, width = 400)
119+
ui.doModal()
120+
selected = ui.selected
110121

111122
#
112123
# check if back has been pressed

0 commit comments

Comments
 (0)