summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdmenubookmark12
1 files changed, 4 insertions, 8 deletions
diff --git a/dmenubookmark b/dmenubookmark
index 660272b..b064470 100755
--- a/dmenubookmark
+++ b/dmenubookmark
@@ -1,13 +1,9 @@
#!/bin/sh
+bookmark_file=~/.cache/bookmarks
if [ -z "$1" ]
then
- bookmark_file=~/.cache/bookmarks
- choice=$(gawk -F '§§§' '{print($2)}' $bookmark_file | dmenu -p 'Search for Bookmark' -l 20)
- [ -z "$choice" ] && exit ||
- link=$(echo $choice | xargs -I §€§ grep '§€§' $bookmark_file | gawk -F '§§§' '{print($1)}')
- linkhandler $link
-
+ choice=$(cat $bookmark_file | dmenu -p 'Bookmarks' -l 50 -i | cut -d' ' -f1)
+ [ -z "$choice" ] && exit || xdotool type --delay 0 "$choice"
else
- name=$(echo $1 | dmenu -p 'Description of the Bookmark:') &&
- echo $1§§§$name >> ~/.cache/bookmarks
+ echo "$1" >> $bookmark_file
fi