aboutsummaryrefslogtreecommitdiffstats
path: root/examples/launchers
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-04 14:40:34 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-04 14:40:34 +0200
commit0d65a9c9faca8f06dc70c577e7ddb42fba5359fd (patch)
tree89473b4253c9f9630f1601dd891026b0119e02e1 /examples/launchers
parentm (diff)
downloadxpybar-0d65a9c9faca8f06dc70c577e7ddb42fba5359fd.tar.gz
xpybar-0d65a9c9faca8f06dc70c577e7ddb42fba5359fd.tar.bz2
xpybar-0d65a9c9faca8f06dc70c577e7ddb42fba5359fd.tar.xz
.desktop file support
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples/launchers')
-rw-r--r--examples/launchers15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/launchers b/examples/launchers
index fdb358a..86bd54f 100644
--- a/examples/launchers
+++ b/examples/launchers
@@ -24,6 +24,8 @@ import sys
import time
from plugins.image import Image
+from plugins.application import Application
+
OUTPUT, HEIGHT, YPOS, TOP = 0, 24, 24, True
@@ -65,14 +67,21 @@ class LauncherSet:
bar.invalidate()
+def desktop(file):
+ application = Application(file)
+ icon = application.get_setting('Icon')
+ command = Application.strip_placeholders(application.get_setting('Exec'))
+ return (icon, 'sh', '-c', command)
+
+
launchers = [ [ ('accessories-calculator', 'mate-calc')
, ('accessories-character-map', 'mucharmap')
, ('scanner', 'simple-scan')
, ('meld', 'meld')
]
, [ ('dia', 'dia')
- , ('inkscape', 'inkscape')
- , ('gimp', 'gimp')
+ , desktop ('inkscape')
+ , desktop ('gimp')
, ('calligrakrita', 'krita')
, ('blender', 'blender')
, ('/usr/share/pixmaps/openscad.png', 'openscad')
@@ -139,5 +148,5 @@ def unhandled_event(e):
elif button == SCROLL_DOWN: launchers[x].scroll_down()
-# TODO support for droping files onto the launchers to open with those files would be nice
+# TODO support for dropping files onto the launchers to open with those files would be nice