From 292f756d4463c8596d1f0b70bf2f455484c33670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 10 Dec 2020 19:18:24 +0300 Subject: Open ebooks from the web with zathura --- dotfiles/.config/mimeo/associations.txt | 4 ++++ dotfiles/.local/bin/bookurl | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100755 dotfiles/.local/bin/bookurl diff --git a/dotfiles/.config/mimeo/associations.txt b/dotfiles/.config/mimeo/associations.txt index 5b3f604..9e5f577 100644 --- a/dotfiles/.config/mimeo/associations.txt +++ b/dotfiles/.config/mimeo/associations.txt @@ -13,6 +13,10 @@ imgurl %U ^https?://.*\.gif ^https?://.*\.bmp +bookurl %U + ^https?://.*\.pdf + ^https?://.*\.djvu + libreoffice %F \.doc \.docx diff --git a/dotfiles/.local/bin/bookurl b/dotfiles/.local/bin/bookurl new file mode 100755 index 0000000..c97b039 --- /dev/null +++ b/dotfiles/.local/bin/bookurl @@ -0,0 +1,7 @@ +#!/bin/sh + +[ -z "$1" ] && exit + +setsid curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && zathura "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & + + -- cgit v1.2.3