From 6d0ad93751a3584788d066802a4b59fa8f7cab1b Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Mon, 6 Jun 2022 20:58:12 +0200 Subject: [PATCH] Give linkhandler option to read from clipboard --- .local/bin/linkhandler | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index fa74caf..a1c6394 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -6,6 +6,11 @@ # if a music file or pdf, it will download, # otherwise it opens link in browser. +# If -c passed, read from clipboard +while getopts 'c' o; do case "${o}" in + c) set "$(xclip -o)";; +esac done + # If no url given. Opens browser. For using script as $BROWSER. [ -z "$1" ] && { "$BROWSER"; exit; }