From 1b2b72e813484523a603862e1faad02bd0e9518e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Sat, 30 May 2026 15:45:22 +0200 Subject: [PATCH] argen: add key for fuzzel and select/swap window by index --- argen/.config/argen/init | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/argen/.config/argen/init b/argen/.config/argen/init index e1329b4..ae7e183 100755 --- a/argen/.config/argen/init +++ b/argen/.config/argen/init @@ -11,6 +11,7 @@ argenctl binding set normal Super Return sh "kitty --single-instance --instance- # Reload config argenctl binding set normal Super+Shift R exec "$0" +argenctl binding set normal Super P exec fuzzel argenctl binding set normal Super+Shift L exec waylock argenctl binding set normal Super+Shift T sh "lupan-set-theme toggle" @@ -115,5 +116,30 @@ argenctl mode declare passthrough argenctl binding set normal Super Grave mode enter passthrough argenctl binding set passthrough Super Grave mode enter normal +# Select/swap window by index +for num in 1 2 3 4 5 6 7 8 9; do + idx=$((num - 1)) + argenctl binding set normal Super $num sh " + argenctl window focus \$(argenctl context list --json | jq -r '.[] | select(.current) | .windows | .[$idx]') + " + argenctl binding set normal Super+Shift $num sh " + context_id=\$(argenctl context list --json | jq -r '.[] | select(.current) | .id') + length=\$(argenctl context list --json | jq -r '.[] | select(.current) | .windows | length') + focused_window=\$(argenctl context list --json | jq -r '.[] | select(.current) | .focused_window') + dest_window=\$(argenctl context list --json | jq -r '.[] | select(.current) | .windows | .[$idx]') + focused_output_id=\$(argenctl window list --json | jq -r \".[] | select(.id == \\\"\$focused_window\\\") | .contexts[] | select(.id = \$context_id) | .output_id\") + dest_output_id=\$(argenctl window list --json | jq -r \".[] | select(.id == \\\"\$dest_window\\\") | .contexts[] | select(.id = \$context_id) | .output_id\") + if [ -n \"\$focused_output_id\" -a \"\$focused_output_id\" = \"\$dest_output_id\" ]; then + for i in \$(seq \$length); do + if [ \"\$focused_window\" = \"\$dest_window\" ]; then + break + fi + argenctl window swap next + dest_window=\$(argenctl context list --json | jq -r '.[] | select(.current) | .windows | .[$idx]') + done + fi + " +done + # Rules argenctl rule add float --app-id "my-app"