From 528adf4f88186acf2a26cc4a3725ae5e5dd3b1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Wed, 27 Aug 2025 14:14:13 +0200 Subject: [PATCH] feat(bin): tmuxp-config script --- .local/bin/tmuxp-config | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 .local/bin/tmuxp-config diff --git a/.local/bin/tmuxp-config b/.local/bin/tmuxp-config new file mode 100755 index 00000000..cd18de05 --- /dev/null +++ b/.local/bin/tmuxp-config @@ -0,0 +1,19 @@ +#!/bin/bash + +CONFIG_DIR="$XDG_CONFIG_HOME/tmuxp" +TMUXP_CONFIG=".tmuxp.yaml" +CURRENT_DIR="$(pwd)" + +if [ ! -d "$CONFIG_DIR" ]; then + exit 1 +fi + +selected_file=$(tmuxp ls | + fzf --preview "bat $CONFIG_DIR/{}.yaml" \ + --prompt="Select a config file: ") + +if [ -z "$selected_file" ]; then + exit 1 +fi + +cp -i "$CONFIG_DIR/$selected_file.yaml" "$TMUXP_CONFIG" && sed -i "1i start_directory: $CURRENT_DIR\nsession_name: $(basename "$CURRENT_DIR")" "$TMUXP_CONFIG"