aboutsummaryrefslogtreecommitdiff
path: root/env/.local/bin/scripts
diff options
context:
space:
mode:
authoriceyrazor <iceyrazor@mailfence.com>2026-06-23 23:27:19 -0500
committericeyrazor <iceyrazor@mailfence.com>2026-06-23 23:27:19 -0500
commit0b1f94508454788b6ae151dbbe1243520f83dc0a (patch)
tree77c1e6df2de3ca0bfb78a5b0ed9072c57871f99c /env/.local/bin/scripts
parent8ca7fdf7650a07c9d2aa276c5d5ae5a7698c401c (diff)
Squashed commit of the following: removed urlview
ps1 change removed urlview. replaced with urlview.sh i3blocks bar changes
Diffstat (limited to 'env/.local/bin/scripts')
-rwxr-xr-xenv/.local/bin/scripts/urlview.sh20
1 files changed, 20 insertions, 0 deletions
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