diff --git a/buku_run b/buku_run index f0bf25a..1b5607a 100755 --- a/buku_run +++ b/buku_run @@ -10,6 +10,11 @@ new_bookmark="Alt+n" actions="Alt+a" edit="Alt+e" delete="Alt+d" +copyurl="Alt+l" + +#libnotify messages +notifysend='true' +reverselist='false' # colors help_color="#334433" @@ -43,10 +48,14 @@ main () { HELP="Welcome to Buku. Use ${new_bookmark} to add a new Bookmark Use ${switch_view} to switch View. ${actions} for actions" if [[ $mode == "bookmarks" ]]; then - content=$(buku -p -f 2 | awk 'NF == 2 { $0 = $0 "NOTAG" }; { $2 = substr($2,0,80); print $1"\t"$2"\t"$3,$4,$5 }' | column -t -s $'\t') - menu=$(echo "${content}" | _rofi -p '> ' -filter "${filter}" -mesg "${HELP}" -kb-custom-1 "${new_bookmark}" -kb-custom-2 "${switch_view}" -kb-custom-3 "${actions}" -kb-custom-4 "${edit}" -kb-custom-5 "${delete}") + if [[ $reverselist == "true" ]] ; then + content=$(buku -p -f 2 | grep -v 'waiting for input'| sort -V -r | awk 'NF == 2 { $0 = $0 "NOTAG" }; { $2 = substr($2,0,80); print $1"\t"$2"\t"$3,$4,$5 }' | column -t -s $'\t') + else + content=$(buku -p -f 2 | grep -v 'waiting for input'| awk 'NF == 2 { $0 = $0 "NOTAG" }; { $2 = substr($2,0,80); print $1"\t"$2"\t"$3,$4,$5 }' | column -t -s $'\t') + fi + menu=$(echo "${content}" | _rofi -p '> ' -filter "${filter}" -mesg "${HELP}" -kb-custom-1 "${new_bookmark}" -kb-custom-2 "${switch_view}" -kb-custom-3 "${actions}" -kb-custom-4 "${edit}" -kb-custom-5 "${delete}" -kb-custom-6 "${copyurl}") elif [[ $mode == "tags" ]]; then - menu=$(buku --np --st | awk '{$NF=""; print $0}' | cut -d ' ' -f2- | _rofi -p '> ' -mesg "${HELP}" -kb-custom-1 "${new_bookmark}" -kb-custom-2 "${switch_view}" -kb-custom-3 "${actions}" -kb-custom-4 "${edit}" -kb-custom-5 "${delete}") + menu=$(buku --np --st | awk '{$NF=""; print $0}' | cut -d ' ' -f2- | _rofi -p '> ' -mesg "${HELP}" -kb-custom-1 "${new_bookmark}" -kb-custom-2 "${switch_view}" -kb-custom-3 "${actions}" -kb-custom-4 "${edit}" -kb-custom-5 "${delete}" -kb-custom-6 "${copyurl}") fi val=$? if [[ $val -eq 1 ]]; then @@ -59,6 +68,12 @@ Use ${switch_view} to switch View. ${switch_view} to switch View.