From dc96f62f9e1a3f53c2602b1c41b73bad388061d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 26 Dec 2014 12:18:17 +0100 Subject: [PATCH] add support for Linux .desktop files --- .gitmodules | 3 +++ grammars.yml | 2 ++ lib/linguist/languages.yml | 8 ++++++++ samples/desktop/example.desktop | 21 +++++++++++++++++++++ vendor/grammars/desktop.tmbundle | 1 + 5 files changed, 35 insertions(+) create mode 100644 samples/desktop/example.desktop create mode 160000 vendor/grammars/desktop.tmbundle diff --git a/.gitmodules b/.gitmodules index e35c1366..5e3ddc4b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -343,6 +343,9 @@ [submodule "vendor/grammars/ini.tmbundle"] path = vendor/grammars/ini.tmbundle url = https://github.com/textmate/ini.tmbundle +[submodule "vendor/grammars/desktop.tmbundle"] + path = vendor/grammars/desktop.tmbundle + url = https://github.com/Mailaender/desktop.tmbundle.git [submodule "vendor/grammars/io.tmbundle"] path = vendor/grammars/io.tmbundle url = https://github.com/textmate/io.tmbundle diff --git a/grammars.yml b/grammars.yml index ebbea52c..ca9988b0 100644 --- a/grammars.yml +++ b/grammars.yml @@ -160,6 +160,8 @@ vendor/grammars/dart-sublime-bundle: - source.dart - source.pubspec - text.dart-doccomments +vendor/grammars/desktop.tmbundle: +- source.desktop vendor/grammars/diff.tmbundle: - source.diff vendor/grammars/dylan.tmbundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 7890be55..aa37e7d5 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3249,6 +3249,14 @@ Zimpl: tm_scope: none ace_mode: text +desktop: + type: data + extensions: + - .desktop + - .desktop.in + tm_scope: source.desktop + ace_mode: text + eC: type: programming search_term: ec diff --git a/samples/desktop/example.desktop b/samples/desktop/example.desktop new file mode 100644 index 00000000..81221d99 --- /dev/null +++ b/samples/desktop/example.desktop @@ -0,0 +1,21 @@ +# http://standards.freedesktop.org/desktop-entry-spec/latest/apa.html + +[Desktop Entry] +Version=1.0 +Type=Application +Name=Foo Viewer +Comment=The best viewer for Foo objects available! +TryExec=fooview +Exec=fooview %F +Icon=fooview +MimeType=image/x-foo; +Actions=Gallery;Create; + +[Desktop Action Gallery] +Exec=fooview --gallery +Name=Browse Gallery + +[Desktop Action Create] +Exec=fooview --create-new +Name=Create a new Foo! +Icon=fooview-new \ No newline at end of file diff --git a/vendor/grammars/desktop.tmbundle b/vendor/grammars/desktop.tmbundle new file mode 160000 index 00000000..34f9b8ab --- /dev/null +++ b/vendor/grammars/desktop.tmbundle @@ -0,0 +1 @@ +Subproject commit 34f9b8ab985ff7d981661f632eeff6d6c080cea8