commit 54eff69143e540758de47ff5762dd89a8f391a8d Spenser Truex <truex@equwal.com> 2021-01-09 13:50:04 -0800 Initial commit.
.gitignore | 1 + Makefile | 32 ++++++++++++++++++++++++++++++++ README | 26 ++++++++++++++++++++++++++ bin/bm | 9 +++++++++ bin/bmclip | 2 ++ config.mk | 5 +++++ 6 files changed, 75 insertions(+)
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cdb722e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tags.* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ecb3ac0 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +include config.mk + +all: + + +dist: + @echo creating dist tarball + @mkdir -p sbm-${VERSION} + @cp -R LICENSE Makefile config.mk bin sbm-${VERSION} + @tar -cf sbm-${VERSION}.tar sbm-${VERSION} + @gzip sbm-${VERSION}.tar + @rm -rf sbm-${VERSION} + +install: + @echo installing scripts to ${DESTDIR}${PREFIX} + @mkdir -p ${DESTDIR}${PREFIX} + @cd bin + for i in bin/*; \ + do \ + cp $$i ${DESTDIR}${PREFIX}/bin; \ + chmod 755 ${DESTDIR}${PREFIX}/$$i; \ + done; true + +uninstall: + @echo removing scripts + @cd bin + for i in ./*; \ + do \ + rm -f ${DESTDIR}${PREFIX}/bin/$$i; \ + done; true + + diff --git a/README b/README new file mode 100644 index 0000000..dd85d68 --- /dev/null +++ b/README @@ -0,0 +1,26 @@ +Manage bookmarks with dmenu and a basic file. + +For example: + +https://equwal.com Spenser Truex's website. + +And interact with this file using the dmenu script. + +== Scripts == +bm search & copy, add, or edit a bookmark. +== Install == +Requirements: xclip, dmenu, make +1) Export the $BOOKMARKS variable containing the location of the bookmarks. +~/.bashrc + export BOOKMARKS="~/.config/bookmarks" +2) make install + +== Usage == +Execute + +search-term is an extended regex for grep.\n\nBookmark lines are Tab Separated Values\n" +URL<tab>description\n" + +== Tip == +The bookmarks can be converted from the web browser formats using +netscape-bookmark-converter at https://github.com/jhh/netscape-bookmark-converter diff --git a/bin/bm b/bin/bm new file mode 100755 index 0000000..c90d6b5 --- /dev/null +++ b/bin/bm @@ -0,0 +1,9 @@ +#!/bin/sh + +help () { + exit 1 +} + +[ "$1" = "--help" ] || [ "$1" = "-h" ] && help + +sort -t2 "$BOOKMARKS" | dmenu -f -l 9 -p "bookmark:" | cut -f 1 diff --git a/bin/bmclip b/bin/bmclip new file mode 100755 index 0000000..a4235f9 --- /dev/null +++ b/bin/bmclip @@ -0,0 +1,2 @@ +#!/bin/sh +bm "$BOOKMARKS" | xclip -i -selection clipboard diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..c664fc4 --- /dev/null +++ b/config.mk @@ -0,0 +1,5 @@ +VERSION=0.1 +SHELL = /bin/sh + +PREFIX=/usr/local +MANPREFIX=${PREFIX}/share/man