summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD21
-rw-r--r--subl3-url-handler16
-rw-r--r--subl3-url-handler.desktop12
-rw-r--r--subl3-url-handler.install9
5 files changed, 74 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..11655053893
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = subl3-url-handler
+ pkgdesc = Open subl:// URLs in Sublime Text 3. Based on https://github.com/jhass/PKGBUILDs/tree/master/sublime-url-handler
+ pkgver = 0.0.1
+ pkgrel = 1
+ url = http://github.com/cerdiogenes/subl3-url-handler
+ install = subl3-url-handler.install
+ arch = any
+ license = MIT
+ depends = desktop-file-utils
+ source = subl3-url-handler
+ source = subl3-url-handler.desktop
+ sha256sums = c89b1e9da3b175fc5d6e7f952d957da116fa3733645e17bccc0fa83f67f0232d
+ sha256sums = aeb867fbd2c10466dcc62f69a66e38100685f78993283e63a56516fc7a7e54d7
+
+pkgname = subl3-url-handler
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..fe573a8d34c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,21 @@
+# Maintainer: Kadu DiĆ³genes <kadu@fnix.com.br>
+
+pkgname=subl3-url-handler
+pkgver=0.0.1
+pkgrel=1
+pkgdesc="Open subl:// in Sublime Text 3. Based on https://github.com/jhass/PKGBUILDs/tree/master/sublime-url-handler"
+url='http://github.com/MrZYX/PKGBUILDs/tree/master/sublime-url-handler'
+arch=('any')
+license=('MIT')
+depends=('desktop-file-utils')
+install=subl3-url-handler.install
+source=($pkgname $pkgname.desktop)
+
+package() {
+ install -Dm755 $pkgname "$pkgdir/usr/bin/$pkgname"
+ RPM_BUILD_ROOT=$pkgdir desktop-file-install $pkgname.desktop
+}
+
+# vim:set ts=2 sw=2 et:
+sha256sums=('c89b1e9da3b175fc5d6e7f952d957da116fa3733645e17bccc0fa83f67f0232d'
+ 'aeb867fbd2c10466dcc62f69a66e38100685f78993283e63a56516fc7a7e54d7')
diff --git a/subl3-url-handler b/subl3-url-handler
new file mode 100644
index 00000000000..e92a06bffb2
--- /dev/null
+++ b/subl3-url-handler
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+# Delete first 23 characters
+request=${1:23}
+
+# Decode URL
+request=$(echo $request | echo -e "$(sed 's/+/ /g; s/%/\\x/g')")
+
+# Replace &line= with :
+request=${request/&line=/:}
+
+# Replace &column= with :
+request=${request/&column=/:}
+
+# Launch Sublime
+subl3 $request
diff --git a/subl3-url-handler.desktop b/subl3-url-handler.desktop
new file mode 100644
index 00000000000..9fc84abe471
--- /dev/null
+++ b/subl3-url-handler.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Sublime Text 3 URL Handler
+Comment=Handle URL Scheme subl://
+Icon=sublime_text
+NoDisplay=true
+Categories=TextEditor;Utility;
+Exec=sub3-url-handler %u
+Terminal=false
+MimeType=x-scheme-handler/txmt;x-scheme-handler/subl;
+X-Desktop-File-Install-Version=0.21
diff --git a/subl3-url-handler.install b/subl3-url-handler.install
new file mode 100644
index 00000000000..3596f7d60d8
--- /dev/null
+++ b/subl3-url-handler.install
@@ -0,0 +1,9 @@
+post_install() {
+ update-desktop-database
+}
+
+post_upgrade() {
+ update-desktop-database
+}
+
+# vim:set ts=2 sw=2 et: