Skip to content

Commit fe3ecf9

Browse files
authored
Merge pull request #20 from Midek/master
fix delete + add more keybinds
2 parents 5e13ed3 + 7f6891a commit fe3ecf9

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Diff for: buku_run

+10-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ _rofi () {
88
switch_view="Alt+Tab"
99
new_bookmark="Alt+n"
1010
actions="Alt+a"
11+
edit="Alt+e"
12+
delete="Alt+d"
1113

1214
# colors
1315
help_color="#334433"
@@ -42,9 +44,9 @@ main () {
4244
Use <span color='${help_color}'>${switch_view}</span> to switch View. <span color='${help_color}'>${actions}</span> for actions"
4345
if [[ $mode == "bookmarks" ]]; then
4446
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')
45-
menu=$(echo "${content}" | _rofi -p '> ' -filter "${filter}" -mesg "${HELP}" -kb-custom-1 "${new_bookmark}" -kb-custom-2 "${switch_view}" -kb-custom-3 "${actions}")
47+
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}")
4648
elif [[ $mode == "tags" ]]; then
47-
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}")
49+
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}")
4850
fi
4951
val=$?
5052
if [[ $val -eq 1 ]]; then
@@ -53,6 +55,10 @@ Use <span color='${help_color}'>${switch_view}</span> to switch View. <span colo
5355
optionsMenu
5456
elif [[ $val -eq 10 ]]; then
5557
addMark
58+
elif [[ $val -eq 14 ]]; then
59+
deleteMenu
60+
elif [[ $val -eq 13 ]]; then
61+
editMenu
5662
elif [[ $val -eq 11 ]]; then
5763
if [[ $mode == "bookmarks" ]]; then
5864
export mode="tags"
@@ -137,7 +143,7 @@ deleteMenu () {
137143
exit
138144
elif [[ $val -eq 0 ]]; then
139145
if [[ $delask == "1. Yes" ]]; then
140-
buku -d ${id}
146+
buku -d ${id} --tacit
141147
mode=bookmarks main
142148
elif [[ $delask == "2. No" ]]; then
143149
optionsMenu
@@ -149,7 +155,7 @@ editMenu () {
149155
bookmark=$(echo "${menu}" | awk '{ print $2 }')
150156
id=$(echo "${menu}" | awk '{ print $1 }')
151157
tags=$(echo "${menu}" | awk '{ print substr($0, index($0,$3)) }' | sed 's/NOTAG//g')
152-
content=$(echo -e "url: $bookmark\ntags: $tags")
158+
content=$(echo -e "1. url: $bookmark\n2. tags: $tags")
153159
editmenu=$(echo -e "< Return\n---\n${content}" | _rofi -p '> ')
154160
val=$?
155161
if [[ $val -eq 1 ]]; then

Diff for: config.buku

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ _rofi () {
88
switch_view="Alt+Tab"
99
new_bookmark="Alt+n"
1010
actions="Alt+a"
11+
edit="Alt+e"
12+
delete="Alt+d"
1113

1214
# colors
1315
help_color="#2d7ed8"

0 commit comments

Comments
 (0)