summaryrefslogtreecommitdiff
path: root/bm
diff options
context:
space:
mode:
authoryuzu-eva <cafebabe@disroot.org>2025-05-08 14:01:37 +0200
committeryuzu-eva <cafebabe@disroot.org>2025-05-08 14:01:37 +0200
commitef7c1605a027b52bbff1b01ea693b60f53fa3a71 (patch)
tree1089334258aefbd459d18cf6968e78f1194739b0 /bm
initial commit
Diffstat (limited to 'bm')
-rwxr-xr-xbm21
1 files changed, 21 insertions, 0 deletions
diff --git a/bm b/bm
new file mode 100755
index 0000000..3679cef
--- /dev/null
+++ b/bm
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+bookmark=$(grep -v '^#' $HOME/.config/bookmarks | dmenu -i -l 30 | cut -d' ' -f1)
+
+if [ ! -z "$bookmark" ]; then
+ while getopts ":oy" option; do
+ case $option in
+ o) # open link in browser
+ firefox "$bookmark"
+ ;;
+ y) # yank link to clipboard
+ echo $bookmark | xclip -sel c
+ ;;
+ \?) # invalid option
+ echo "Error: Invalid option -$OPTARG" >&2
+ exit 1
+ ;;
+ esac
+ done
+fi
+