dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 7ce8ac79c3210f1d4aa01189f29d3a3f08dacae3
parent 78191a4521330d651725e9873fba24ba8ead5ac2
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri,  4 Oct 2019 11:24:11 +0200

Add clipboard flags to linkhandler, add maimfull helper script

Diffstat:
M.local/bin/linkhandler | 16++++++++++++----
A.local/bin/maimfull | 2++
2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler @@ -18,7 +18,7 @@ handle_url() { action="comic" ;; *) action="$(printf "open\nopen (tbb)\nxclip\nbookmark\ncurl\nhtml to pdf\nsci-hub\nadd bibref\nmpv\nxdg-open\nyoutube-dl\nyoutube-dl-music" | \ - dmenu -i -p "action:")";; + dmenu -i -p "$1")";; esac case "$action" in @@ -64,7 +64,15 @@ handle_url() { if [ $# -lt 1 ]; then handle_url "$(cat)" else - for url in "$@"; do - handle_url "$url" - done + if [ "$1" = "-c" ]; then + if [ $# -eq 2 ] && [ "$2" = "clipboard" ]; then + handle_url "$(xclip -o -selection clipboard)" + else + handle_url "$(xclip -o)" + fi + else + for url in "$@"; do + handle_url "$url" + done + fi fi diff --git a/.local/bin/maimfull b/.local/bin/maimfull @@ -0,0 +1,2 @@ +#!/bin/sh +maim ~/tmp/pic-full-$(date '+%y%m%d-%H%M-%S')