From ee02a7647b3924862ff52d56d5df58527bd345ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84min=20Baumeler?= Date: Sun, 15 Jun 2025 21:57:03 +0200 Subject: [PATCH] improvement: add q action --- README.md | 1 + src/main.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 475c0cd..73034ad 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ Here is the list of all available keybindings: | Key | Action | | --- | ------ | +| `q` | quit | | `enter` | open day | | `j` | down | | `k` | up | diff --git a/src/main.sh b/src/main.sh index c3780ed..9eb570a 100755 --- a/src/main.sh +++ b/src/main.sh @@ -1142,6 +1142,7 @@ while true; do --preview="$0 --preview-week {}" \ --bind="load:pos($DISPLAY_POS)" \ --expect="ctrl-n,ctrl-g,ctrl-t" \ + --bind="q:abort" \ --bind="j:down" \ --bind="k:up" \ --bind="l:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \ @@ -1154,9 +1155,9 @@ while true; do --bind="alt-h:unbind(load)+reload:$0 --reload-week {2} '-1 year'" \ --bind="ctrl-r:rebind(load)+reload($0 --reload-week today)+show-preview" \ --bind="ctrl-s:execute($SYNC_CMD ; printf 'Press to continue.'; read -r tmp)" \ - --bind="/:show-input+unbind(j)+unbind(k)+unbind(l)+unbind(h)+unbind(ctrl-l)+unbind(ctrl-h)+unbind(alt-l)+unbind(alt-h)+unbind(load)+hide-preview+reload:$0 --reload-all" \ - --bind="backward-eof:hide-input+rebind(j)+rebind(k)+rebind(l)+rebind(h)+rebind(ctrl-l)+rebind(ctrl-h)+rebind(alt-l)+rebind(alt-h)+rebind(load)+show-preview+reload:$0 --reload-week today" \ - --bind="esc:clear-query+hide-input+rebind(j)+rebind(k)+rebind(l)+rebind(h)+rebind(ctrl-l)+rebind(ctrl-h)+rebind(alt-l)+rebind(alt-h)+rebind(load)+show-preview+reload:$0 --reload-week today" + --bind="/:show-input+unbind(q)+unbind(j)+unbind(k)+unbind(l)+unbind(h)+unbind(ctrl-l)+unbind(ctrl-h)+unbind(alt-l)+unbind(alt-h)+unbind(load)+hide-preview+reload:$0 --reload-all" \ + --bind="backward-eof:hide-input+rebind(q)+rebind(j)+rebind(k)+rebind(l)+rebind(h)+rebind(ctrl-l)+rebind(ctrl-h)+rebind(alt-l)+rebind(alt-h)+rebind(load)+show-preview+reload:$0 --reload-week today" \ + --bind="esc:clear-query+hide-input+rebind(q)+rebind(j)+rebind(k)+rebind(l)+rebind(h)+rebind(ctrl-l)+rebind(ctrl-h)+rebind(alt-l)+rebind(alt-h)+rebind(load)+show-preview+reload:$0 --reload-week today" ) key=$(echo "$selection" | head -1)