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"
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)
Visualizar câmeras IP ONVIF no Linux sem necessidade de instalar aplicativos
Converter os repositórios Debian para o novo formato com as chaves
Instalando Spotify no Debian 13
Realizar overclock no Miyoo Mini (plus ou normal)
linux mint reconhece microfone de lapela como fone de ouvido sem micro... (5)
E aí? O Warsaw já está funcionando no Debian 13? (2)
Dúvidas sobre a originalidade de conteúdos online (12)