commit b39612b0f1cb79ca0d8d9add091b673d19fe0460 map588 <map588@pitt.edu> 2026-09-20 21:25:00 -0400 Remove bmks The README already announced its removal. It could not run: it calls help, copy, add, edit and plumb, none of which it defines. What it was meant to do (list, delete, open) is now part of bm.
bmks | 118 ------------------------------------------------------------------- 1 file changed, 118 deletions(-)
diff --git a/bmks b/bmks deleted file mode 100755 index a0c3cc4..0000000 --- a/bmks +++ /dev/null @@ -1,118 +0,0 @@ -#! /bin/bash - -# set prefered launcher -PREFERED_LAUNCHER=dmenu -# set path where urls will be stored -URL_FILE_PATH=$HOME/.local/share/bookmarks -# name of file urls will be stored in -URL_FILE_NAME=urls - -show_usage() { - printf "bmks: unix bookmark management that sucks less - -usage: - -bmks [displayprog] command - -cli commands: -bmks help - show this help message -bmks add <url> - add a new bookmark -bmks del - remove a bookmark -bmks plumb - call plumber on a bookmark -bmks ls - show all bookmarks - -display program commands: -Example: bmks dmenu copy - -bmks [displayprog] copy - copy a bookmark -bmks [displayprog] edit - edit a bookmark -bmks [displayprog] add - add a bookmark -bmks [displayprog] del - remove a bookmark -bmks [displayprog] plumb - plumb (xdg) a bookmark -bmks [displayprog] ls - show all bookmarks - -bmks dmenu, bmks fzf - Deprecated no-args commands. Displays bookmarks with dmenu or fzf. - - -Configuration is done by directly editing the script. Two launchers are available (dmenu and fzf). You can specify which one to use by adding to the PREFERED_LAUNCHER variable directly in the script. Both will display a menu that will allow you to choose a bookmark and open it in your default browser. - -If you would prefer to have your bookmarks stored in alternate location there are also variables that can be changed for that. The default is /home/user/.bmks/urls\n -Call without an argument to be prompted with dmenu." - -#from my bm implementation -- use this -#copy () { -# sort -t2 "$BOOKMARKS" | dmenu -i -l $DMENULINES -p "bookmark:" | cut -f 1 -d ' ' | xclip -i -selection clipboard -} - -promptflag () { - action="$(printf 'copy\nadd\nedit' | dmenu -l 3 -p 'action:')" - [ "$action" = "copy" ] && copy - [ "$action" = "edit" ] && edit - [ "$action" = "add" ] && add - [ "$action" = "plumb" ] && plumb -} -[ "$1" = '-h' ] || [ "$1" = '--help' ] && help -[ "$1" = '-c' ] || [ "$1" = '--copy' ] && copy -[ "$1" = '-a' ] || [ "$1" = '--add' ] && add -[ "$1" = '-e' ] || [ "$1" = '--edit' ] && edit -[ "$1" = '-e' ] || [ "$1" = '--plumb' ] && plumb -[ -z "$1" ] && promptflag - - -bmks_add() { - [ -z "$url" ] && printf "Error: url must be provided\n\n" && show_usage && exit 0 - printf "Description: " - read description - [ -z "$description" ] && echo "$url" >> $URL_FILE_PATH/$URL_FILE_NAME - [ -n "$description" ] && echo "$description - $url" >> $URL_FILE_PATH/$URL_FILE_NAME -} - -bmks_ls() { - bmks_check - cat $URL_FILE_PATH/$URL_FILE_NAME | sort -} - -bmks_del() { - bmks_check - case $PREFERED_LAUNCHER in - dmenu) sed -i "/$(cat $URL_FILE_PATH/$URL_FILE_NAME | sort | dmenu -l $(cat $URL_FILE_PATH/$URL_FILE_NAME | wc -l))/d" $URL_FILE_PATH/$URL_FILE_NAME ;; - fzf) sed -i "/$(cat $URL_FILE_PATH/$URL_FILE_NAME | sort | fzf)/d" $URL_FILE_PATH/$URL_FILE_NAME ;; - esac -} - -bmks_display() { - bmks_check - case $PREFERED_LAUNCHER in - dmenu) cat $URL_FILE_PATH/$URL_FILE_NAME | sort | dmenu -l $(cat $URL_FILE_PATH/$URL_FILE_NAME | wc -l) | awk '{print $(NF)}' | xargs -I '{}' $BROWSER {} ;; - fzf) cat $URL_FILE_PATH/$URL_FILE_NAME | sort | fzf | awk '{print $(NF)}' | xargs -I '{}' $BROWSER {} ;; - esac -} - -bmks_check() { - [ ! -s $URL_FILE_PATH/$URL_FILE_NAME ] && printf "Error: No bookmarks found to display. Try adding some!\n\n" && show_usage && exit 0 -} - -[ ! -d $URL_FILE_PATH ] && mkdir $URL_FILE_PATH -[ ! -f $URL_FILE_PATH/$URL_FILE_NAME ] && touch $URL_FILE_PATH/$URL_FILE_NAME - -case "$1" in - "help") show_usage ;; - "add") url=$2; bmks_add ;; - "del") bmks_del ;; - "ls") bmks_ls ;; - "dmenu") PREFERED_LAUNCHER=$1; bmks_display ;; - "fzf") PREFERED_LAUNCHER=$1; bmks_display ;; - *) bmks_display ;; -esac