Comandos 'copiado consertar' e 'copiado ajuda'
Pacote / verificar (push) Canceled after 0s
Pacote / trivy (push) Canceled after 0s
Pacote / pacote (push) Canceled after 0s
Pacote / release (push) Canceled after 0s

- consertar: recria/recarrega o atalho Win+V e inicia o app se estiver parado
- instalar.sh e desinstalar.sh passam a usar os comandos do próprio app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Opus 5.5 committed 2026-10-03 09:46:53 -03:00
1 parent 16affedd2b
commit 6e45d64ee0
4 files changed
+125 -50

No files matched your search

+3 -25
View File
@@ -2,7 +2,6 @@
# Instala (ou atualiza) o Copiado a partir do pacote publicado no GitHub
set -e
URL="https://github.com/lucasrguerra/copiado/releases/latest/download"
BASE=org.cinnamon.desktop.keybindings
TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
@@ -34,31 +33,10 @@ if [ -f "$HOME/.local/share/clipboard-winv/historico.json" ]; then
rm -rf "$HOME/.local/share/clipboard-winv"
fi
echo "==> Criando atalho Win+V..."
LISTA=$(gsettings get $BASE custom-list)
ID=""
for i in $(python3 -c "import ast,sys; print(' '.join(ast.literal_eval(sys.argv[1].replace('@as ',''))))" "$LISTA"); do
B=$(gsettings get "$BASE.custom-keybinding:/org/cinnamon/desktop/keybindings/custom-keybindings/$i/" binding)
[ "$B" = "['<Super>v']" ] && ID=$i && break
done
if [ -z "$ID" ]; then
for i in $(seq 0 99); do
echo "$LISTA" | grep -q "'custom$i'" || { ID="custom$i"; break; }
done
LISTA=$(python3 -c "import ast,sys; l=ast.literal_eval(sys.argv[1].replace('@as ','')); l.append('$ID'); print(l)" "$LISTA")
fi
SCHEMA="$BASE.custom-keybinding:/org/cinnamon/desktop/keybindings/custom-keybindings/$ID/"
gsettings set "$SCHEMA" name "Copiado"
gsettings set "$SCHEMA" command "copiado show"
gsettings set "$SCHEMA" binding "['<Super>v']"
# só agora registra a lista (e força o Cinnamon a recarregar os atalhos)
gsettings set $BASE custom-list "[]"
echo "==> Criando atalho Win+V e iniciando..."
pkill -f "/usr/bin/copiado" 2>/dev/null || true
sleep 0.5
gsettings set $BASE custom-list "$LISTA"
echo "==> Iniciando..."
pkill -x copiado 2>/dev/null || pkill -f "/usr/bin/copiado" 2>/dev/null || true
setsid copiado >/dev/null 2>&1 &
copiado consertar >/dev/null
echo
echo "Pronto! Versão instalada: $(dpkg-query -W -f='${Version}' copiado). Aperte Win+V."