diff options
author | John Ankarström <john@ankarstrom.se> | 2021-06-07 20:00:48 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-06-07 20:00:48 +0200 |
commit | faee6e1809594f8f1243002e75f2cb611ac22877 (patch) | |
tree | 08d1254fa1e19513d437ecdb8ac1e9eb76767c63 /home/john/.dillo/bm | |
parent | e20cc1ee157fd287a0d409d7ae7ea7323444b4ac (diff) | |
download | lbsd-faee6e1809594f8f1243002e75f2cb611ac22877.tar.gz |
Dillo: Add 'bm' script
bm automatically re-arranges new bookmarks.
Diffstat (limited to 'home/john/.dillo/bm')
-rwxr-xr-x | home/john/.dillo/bm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/home/john/.dillo/bm b/home/john/.dillo/bm new file mode 100755 index 0000000..cc26f23 --- /dev/null +++ b/home/john/.dillo/bm @@ -0,0 +1,27 @@ +#!/bin/sh + +# bm -- re-arrange dillo bookmarks + +awk -F: ' + /^s0 / { + sub(/^s0 /, "") + new[i++] = $0 + next + } + { + print + } + /^:/ { + sub(/^ */, "", $3) + section[$3] = $2 + } + END { + if(section["Archive"]==""){ + print "error: section Archive not found" > "/dev/stderr" + exit 1 + } + for(j = 0; j<i; j++) + print section["Archive"] " " new[j] + } +' ~/.dillo/bm.txt > ~/.dillo/bm.tmp && +mv ~/.dillo/bm.tmp ~/.dillo/bm.txt |