Skip to content

Commit 2ff37a4

Browse files
author
Artur Krajewski
committed
custom keybinds for edit and delete
1 parent e9893e9 commit 2ff37a4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

buku_run

+8-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="#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+
deleteMark
60+
elif [[ $val -eq 13 ]]; then
61+
editMenu
5662
elif [[ $val -eq 11 ]]; then
5763
if [[ $mode == "bookmarks" ]]; then
5864
export mode="tags"

0 commit comments

Comments
 (0)