summaryrefslogtreecommitdiff
path: root/alacritty/open_url.sh
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2023-01-06 17:46:19 +0100
committerReiner Herrmann <reiner@reiner-h.de>2023-01-06 17:46:19 +0100
commitbe6d4f8848a00fdf1189fdcea8b388c08893756d (patch)
tree78460afa8c41463bd2c11fcebeab91797b054632 /alacritty/open_url.sh
parentc2cc205b9ba9406ef7d71fd148961e21ec417bba (diff)
alacritty: add config and script for opening urls
Diffstat (limited to 'alacritty/open_url.sh')
-rwxr-xr-xalacritty/open_url.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/alacritty/open_url.sh b/alacritty/open_url.sh
new file mode 100755
index 0000000..f4b658c
--- /dev/null
+++ b/alacritty/open_url.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# open Debian bugs in browser
+bugnr=$(echo "$1" | perl -lne 'print $1 if /^(?:Closes: |#)(1?\d{6})$/')
+[ -z "$bugnr" ] && bugnr=$(echo "$1" | perl -lne 'print $1 if /^(1?\d{6})\@bugs\.debian\.org$/')
+[ -z "$bugnr" ] && exit 1
+
+exec x-www-browser "https://bugs.debian.org/$bugnr"