From 7342d3d5c563d593fae107363d8c5a5371e8f440 Mon Sep 17 00:00:00 2001 From: nikolaus Date: Mon, 16 Jan 2023 15:09:03 +0100 Subject: Simplifying the Bookmark-Script. --- dmenubookmark | 12 ++++-------- 1 file 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 -- cgit v1.2.1