From 0d65a9c9faca8f06dc70c577e7ddb42fba5359fd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 4 Apr 2015 14:40:34 +0200 Subject: .desktop file support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/launchers | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'examples') 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 -- cgit v1.2.3-70-g09d2