From 56e690b86116dce0676127d2495077b984c0dec9 Mon Sep 17 00:00:00 2001 From: Martin Mose Facondini Date: Mon, 13 Oct 2025 02:13:45 +0200 Subject: [PATCH] feat: enable vim keys for btop (#1581) * feat: enable vim keys for btop * feat: add migration for btop vim keys * Cleanup --------- Co-authored-by: David Heinemeier Hansson --- config/btop/btop.conf | 2 +- migrations/1757535736.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 migrations/1757535736.sh diff --git a/config/btop/btop.conf b/config/btop/btop.conf index c510f3e7..c150ea0a 100644 --- a/config/btop/btop.conf +++ b/config/btop/btop.conf @@ -22,7 +22,7 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul #* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. -vim_keys = False +vim_keys = True #* Rounded corners on boxes, is ignored if TTY mode is ON. rounded_corners = True diff --git a/migrations/1757535736.sh b/migrations/1757535736.sh new file mode 100755 index 00000000..25fcd190 --- /dev/null +++ b/migrations/1757535736.sh @@ -0,0 +1,9 @@ +echo "Enabling vim keys in btop" + +CONFIG_FILE=~/.config/btop/btop.conf + +if [[ -f $CONFIG_FILE ]]; then + if grep -q "^vim_keys = " "$CONFIG_FILE"; then + sed -i 's/^vim_keys = False/vim_keys = True/' "$CONFIG_FILE" + fi +fi