Enviado em 22/02/2025 - 16:57h
Na pasta $HOME/Desktop/back/1 tem dois arquivos .desktop
DIRS=(
"$HOME/Desktop/back/1"
)
DESKTOP_FILES=$(find "${DIRS[@]}" -type f -name "*.desktop")
if [ -z "$DESKTOP_FILES" ]; then
yad --center --text="Nenhum arquivo .desktop encontrado." --width=300 --height=100 --button="OK:0"
exit 1
fi
rm /tmp/arquivo.txt
# Processando arquivos com espaços
while IFS= read -r file; do
# Verifica se a linha contém um arquivo válido
if [ -n "$file" ]; then
NAME=$(grep ^Name= "$file" | cut -d= -f2 | head -n1)
COMMENT=$(grep ^Comment= "$file" | cut -d= -f2 | head -n1)
NODISPLAY=$(grep ^NoDisplay= "$file" | cut -d= -f2 | head -n1)
# Substituir valores vazios por string vazia
[ -z "$NAME" ] && NAME=""
[ -z "$COMMENT" ] && COMMENT=""
[ -z "$NODISPLAY" ] && NODISPLAY="false"
if [ "$NODISPLAY" == "false" ]; then
NODISPLAY="Ativado"
OPCAO="TRUE"
elif [ "$NODISPLAY" == "true" ]; then
NODISPLAY="Desativado"
OPCAO="FALSE"
fi
# Adiciona os dados no arquivo temporário
echo "$OPCAO|$NAME|$COMMENT|$NODISPLAY" >> /tmp/arquivo.txt
fi
done <<< "$DESKTOP_FILES"
yad --center \
--title="Arquivos .desktop" \
--list \
--text='<span foreground="blue" font="14">deseja ativar ou desativar os atalhos</span>' \
--radiolist --multiple --separator="|" \
--column="Selecionar:CHK" --column="Programas" --column="Comentário" --column="Status" \
$(cat /tmp/arquivo.txt) \
--button="Salvar":10 --button="Cancelar":1 \
--width="1200" --height="600"
tux-gpt - Assistente de IA para o Terminal
Instalação e configuração do Chrony
Programa IRPF - Guia de Instalação e Resolução de alguns Problemas
Como instalar no Linux Jogos da Steam só para Windows
Instalando o Team Viewer no Debian Trixie - problema no Policykit
O Que Fazer Após Instalar Ubuntu 25.04
Os empreguim de meu Deus estão cada vez mais tecnológicos (2)
Controle do PS5 no Linux Mint funciona? (1)
Alguém poderia me ajudar a escolher peças pra montar um desktop? (29)