From 60052659b98832c78c902e4f27ecee2663d8e913 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 6 May 2026 08:30:49 +0200 Subject: Added scripts --- scripts/open-url | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/open-url (limited to 'scripts/open-url') diff --git a/scripts/open-url b/scripts/open-url new file mode 100755 index 0000000..bd1b1a1 --- /dev/null +++ b/scripts/open-url @@ -0,0 +1,28 @@ +#!/bin/sh + +# Open link in preferred application +# Requires: mail-compose, spawn, xsel (optional) + +browser=${BROWSER:-firefox} +imageviewer=${IMAGEVIEWER:-nsxiv} + +[ -z "$1" ] && exit 0 + +# Optional: copy url to clipboard +echo "$@" | xsel -ib + +case "$@" in + mailto:*) + mail-compose "$@" + ;; + *.jpg | *.jpeg | *.png) + spawn "$imageviewer" "$@" + ;; + *.gif) + spawn "$imageviewer" "$@" + ;; + *) + spawn "$browser" "$@" + ;; +esac + -- cgit v1.3