From f17a4e976a360ca3aa26bb8201676b22787fdba5 Mon Sep 17 00:00:00 2001 From: Gilles Soulier Date: Sat, 16 May 2026 06:02:27 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20install.sh=20=E2=80=94=20touche=20c=20p?= =?UTF-8?q?our=20copier=20la=20liste=20dans=20le=20presse-papier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajoute un copy_script qui génère la liste visible (champs cachés et codes ANSI supprimés) et la copie via wl-copy (Wayland), xclip ou xsel en fallback. Légende et aide F1 mises à jour. Co-Authored-By: Claude Sonnet 4.6 --- install.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index b4c5b4c..f6ec1f8 100755 --- a/install.sh +++ b/install.sh @@ -420,6 +420,7 @@ run_menu() { local list_script="/tmp/skills_list_$$.sh" local fns_file="/tmp/skills_fns_$$.sh" local preview_script="/tmp/skills_preview_$$.sh" + local copy_script="/tmp/skills_copy_$$.sh" # Exporter fonctions et données dans un fichier source partagé { @@ -581,6 +582,25 @@ PREVIEW_EOF sed -i "s|FNSFILE|$fns_file|" "$preview_script" chmod +x "$preview_script" + # Script de copie presse-papier (touche c) + cat > "$copy_script" << 'COPY_EOF' +#!/usr/bin/env bash +list_script="LISTFILE" +# Génère la liste, supprime le champ caché (avant le 1er tab) et les codes ANSI +content=$(bash "$list_script" | sed 's/^[^\t]*\t//' | sed 's/\x1b\[[0-9;]*[mGKHF]//g') +if command -v wl-copy &>/dev/null; then + printf '%s' "$content" | wl-copy +elif command -v xclip &>/dev/null; then + printf '%s' "$content" | xclip -selection clipboard +elif command -v xsel &>/dev/null; then + printf '%s' "$content" | xsel --clipboard --input +else + exit 1 +fi +COPY_EOF + sed -i "s|LISTFILE|$list_script|" "$copy_script" + chmod +x "$copy_script" + # Fichier d'aide F1 local help_file="/tmp/skills_help_$$.txt" cat > "$help_file" << HELP_EOF @@ -611,6 +631,7 @@ $(echo -e "${GRV_BLUE}RACCOURCIS CLAVIER${RESET}") $(echo -e "${GRV_GREEN}SPACE${RESET}") Changer l'action du skill sélectionné $(echo -e "${GRV_GREEN}TAB${RESET}") Plier / déplier la catégorie $(echo -e "${GRV_GREEN}v${RESET}") Afficher / masquer le contenu du skill (preview) + $(echo -e "${GRV_GREEN}c${RESET}") Copier la liste affichée dans le presse-papier $(echo -e "${GRV_GREEN}F1${RESET}") Afficher / fermer cette aide $(echo -e "${GRV_BLUE}ARBRE DES CATÉGORIES${RESET}") @@ -630,7 +651,7 @@ $(echo -e "${GRV_GRAY}Dépôt : https://gitea.maison43.duckdns.org/gilles/mes_sk HELP_EOF local legend - legend=$(echo -e "${GRV_GRAY}État: ${GRV_GREEN}✓ ${GRV_YELLOW}↑ ${GRV_AQUA}+ Action: ${GRV_GREEN}●L ${GRV_BLUE}●G ${GRV_GRAY}○ SPACE=action TAB=plier v=voir F1=aide ENTER=ok ESC=quitter${RESET}") + legend=$(echo -e "${GRV_GRAY}État: ${GRV_GREEN}✓ ${GRV_YELLOW}↑ ${GRV_AQUA}+ Action: ${GRV_GREEN}●L ${GRV_BLUE}●G ${GRV_GRAY}○ SPACE=action TAB=plier v=voir c=copier F1=aide ENTER=ok ESC=quitter${RESET}") fzf \ --ansi \ @@ -644,10 +665,11 @@ HELP_EOF --bind="space:execute-silent(bash $space_script {1})+reload(bash $list_script)+pos({n})" \ --bind="tab:execute-silent(bash $tab_script {1})+reload(bash $list_script)" \ --bind="v:toggle-preview" \ + --bind="c:execute-silent(bash $copy_script)" \ --bind="f1:execute(less -R $help_file)" \ < <(bash "$list_script") > /dev/null || true - rm -f "$space_script" "$tab_script" "$list_script" "$fns_file" "$preview_script" "$help_file" + rm -f "$space_script" "$tab_script" "$list_script" "$fns_file" "$preview_script" "$copy_script" "$help_file" } # ── Installation ──────────────────────────────────────────────────