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"
Customizar a Instalação do Linux Debian com Preseed
Atualizando o Passado: Linux no Lenovo G460 em 2025
aaPanel - Um Painel de Hospedagem Gratuito e Poderoso
Um modo leve de ouvir/ver áudio/vídeo da internet em máquinas pererecas
Resolver algumas mensagens de erro do SSH
Instalar módulo de segurança do Banco do Brasil Warsaw do tipo .run
Instalação de Certificados .Cer no Ubuntu 24.04 (0)
O que você está ouvindo agora? [2] (193)
Procrastinação e autossabotagem são problemas muito comuns na sociedad... (8)