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"
O que é o THP na configuração de RAM do Linux e quando desabilitá-lo
Comparação entre os escalonadores BFQ e MQ-Deadline (acesso a disco) no Arch e Debian
Conciliando o uso da ZRAM e SWAP em disco na sua máquina
Servidor de Backup com Ubuntu Server 24.04 LTS, RAID e Duplicati (Dell PowerEdge T420)
Hardware antigo no Arch Linux e outras distribuições
Aprenda a proteger sua rede Wi-Fi!
Deixando o Plasma6 mais fluido no Linux
Como unir duas coleções de ROMs preservando as versões traduzidas (sem duplicatas)
Gerar menu automaticamente no luxbox (3)
Isso acontece com vcs também? (8)
Problema com audio apos upgrade (10)