From 0b1f94508454788b6ae151dbbe1243520f83dc0a Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Tue, 23 Jun 2026 23:27:19 -0500 Subject: Squashed commit of the following: removed urlview ps1 change removed urlview. replaced with urlview.sh i3blocks bar changes --- env/.local/bin/scripts/urlview.sh | 20 ++++++++++++++++++++ env/.local/bin/system/url-handler.sh | 23 ----------------------- 2 files changed, 20 insertions(+), 23 deletions(-) create mode 100755 env/.local/bin/scripts/urlview.sh delete mode 100755 env/.local/bin/system/url-handler.sh (limited to 'env/.local/bin') diff --git a/env/.local/bin/scripts/urlview.sh b/env/.local/bin/scripts/urlview.sh new file mode 100755 index 0000000..c4c38d7 --- /dev/null +++ b/env/.local/bin/scripts/urlview.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +url="$(grep -o -e 'http://[^"]*' -e 'https://[^"]*' <&0 | fzf)" + +choices="\ +clipboard +browser/xdg-open" + +choice=$(echo "$choices" | fzf) +choice=$(echo "$choice" | sed -e 's/browser\/xdg-open/xdg-open/') + +if [ "$choice" = "clipboard" ]; then + if [ -z "$WAYLAND_DISPLAY" ]; then + printf -- "%s" "$url" | xclip -selection clipboard + else + printf -- "%s" "$url" | wl-copy + fi +else + $choice "$url" & disown +fi diff --git a/env/.local/bin/system/url-handler.sh b/env/.local/bin/system/url-handler.sh deleted file mode 100755 index 5d0e893..0000000 --- a/env/.local/bin/system/url-handler.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -url=$@ -prompt_message="Open with:" - -echo "$url" - -choices=" -clipboard -browser/xdg-open -" - -choice=$(echo "$choices" | sed /^$/d | rofi -dmenu "$prompt_message") -choice=$(echo "$choice" | sed -e 's/browser\/xdg-open/xdg-open/') - -if [ "$choice" = "clipboard" ]; then - if [ -z "$WAYLAND_DISPLAY" ]; then - printf -- "%s" "$url" | xclip -selection clipboard - else - printf -- "%s" "$url" | wl-copy - fi -else - $choice "$url" & disown -fi -- cgit v1.3