Skip to content

Commit 6c9c962

Browse files
[kill] Interface v2.0
1 parent bce5ce8 commit 6c9c962

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

kill/__init__.py

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
from albert import *
77

8-
md_iid = '1.0'
9-
md_version = "1.2"
8+
md_iid = '2.0'
9+
md_version = "1.3"
1010
md_name = "Kill Process"
1111
md_description = "Kill processes"
1212
md_license = "BSD-3"
@@ -15,23 +15,14 @@
1515
md_credits = "Original idea by Benedict Dudel & Manuel Schneider"
1616

1717

18-
class Plugin(TriggerQueryHandler):
19-
icon_path = "xdg:process-stop"
20-
21-
def id(self):
22-
return md_id
23-
24-
def name(self):
25-
return md_name
26-
27-
def description(self):
28-
return md_description
29-
30-
def initialize(self):
31-
pass
32-
33-
def defaultTrigger(self):
34-
return "kill "
18+
class Plugin(PluginInstance, TriggerQueryHandler):
19+
def __init__(self):
20+
TriggerQueryHandler.__init__(self,
21+
id=md_id,
22+
name=md_name,
23+
description=md_description,
24+
defaultTrigger='kill ')
25+
PluginInstance.__init__(self, extensions=[self])
3526

3627
def handleTriggerQuery(self, query):
3728
if not query.isValid:
@@ -53,9 +44,9 @@ def handleTriggerQuery(self, query):
5344
.replace("\0", " ")
5445
)
5546
results.append(
56-
Item(
47+
StandardItem(
5748
id="kill",
58-
icon=[self.icon_path],
49+
iconUrls=["xdg:process-stop"],
5950
text=proc_command,
6051
subtext=proc_cmdline,
6152
actions=[

0 commit comments

Comments
 (0)