aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/linkhandler
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-09-18 00:13:07 +0300
committerYaroslav <contact@yaroslavps.com>2020-09-18 00:13:07 +0300
commit840f1e3bdd34b0b4b8d1d199ef6e97b6f1a1951d (patch)
treefd091847979e0ac5d05de15c4f2d9d82c088a4d6 /dotfiles/.local/bin/linkhandler
parente5a7e88b25b88f9aa55bbce105467c81472a6aba (diff)
downloadswayrice-840f1e3bdd34b0b4b8d1d199ef6e97b6f1a1951d.tar.gz
swayrice-840f1e3bdd34b0b4b8d1d199ef6e97b6f1a1951d.zip
Use solely mimeo to handle default files/links
Diffstat (limited to 'dotfiles/.local/bin/linkhandler')
-rwxr-xr-xdotfiles/.local/bin/linkhandler23
1 files changed, 0 insertions, 23 deletions
diff --git a/dotfiles/.local/bin/linkhandler b/dotfiles/.local/bin/linkhandler
deleted file mode 100755
index 338750d..0000000
--- a/dotfiles/.local/bin/linkhandler
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Feed script a url or file location.
-# If an image, it will view in sxiv,
-# if a video or gif, it will view in mpv
-# if a music file or pdf, it will download,
-# otherwise it opens link in browser.
-
-# If no url given opens browser.
-[ -z "$1" ] && { "$BROWSER"; exit; }
-
-case "$1" in
- *mkv|*webm|*mp4|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*)
- setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;;
- *png|*jpg|*jpe|*jpeg|*gif)
- curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;;
- *mp3|*flac|*opus|*mp3?source*)
- setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;;
- *://*|*.*)
- setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;;
- *) # If it's not a url, perform a search using duckduckgo
- setsid "$BROWSER" "https://duckduckgo.com/?q=$1&t=ffab&atb=v1-1" >/dev/null 2>&1 & ;;
-esac