Editor de configurações para Tint2
Publicado por Raimundo Alves Portela (última atualização em 28/12/2011)
[ Hits: 5.023 ]
Homepage: http://portelanet.com
Mais um script que usa as novas funcionalidades do Yad 0.16.x
Nesse script fiz um utilitários de configurações para o aplicativo tint2 (http://www.vivaolinux.com.br/dica/Tint2-Painel-leve-para-X).
Assim de uma maneira fácil, através de um script com interface gráfica, qualquer usuário poderá fazer modificações básicas nessa ferramenta usando esse script, tendo como pré-requisito o Yad instalado ;-), veja em: http://www.vivaolinux.com.br/artigo/Apresentando-o-Yad-zenity-melhorado/
Para usar, descompacte:
$ tar -zxvf config_tint2.tar.gz
$ cd config_tint2
E execute-o:
$ ./config_tint2.sh
Depois posto uma dica com mais detalhe sobre o tint2, o novo Yad e esse script.
Obs.: repare que abaixo descrevo diversos arquivos separados por "#-----------------------------------------------------------------------".
Recomendo que baixem o Yad de: http://pkgs.org/download/yad ou usem o PPA descrito em :http://www.webupd8.org/2010/12/yad-zenity-on-steroids-display.html
#!/bin/bash # Editor de configuração para o tint2 # arquivo config_tint2.sh #------------------------------------------------- [ ! -f ~/.config/tint2/tint2rc ] && { yad --title='aviso' \ --text='O arquivo ~/.config/tint2/tint2rc não existe\nTenha o tint2 instalado e inicie-o pelo menos uma vez' --button='Ok' exit 1 } while yad --title='Editor Tint2' --form --width=200 \ --field='Configurar Cores':BTN "./tint2_cores.sh" --field='Configurar Fonte':BTN "./tint2_fonte.sh" --field='Mais configurações':BTN "./tint2_outros.sh" --button='Fechar':1 do : done #----------------------------------------------------------------------- #!/bin/bash # arquivo tint2_cores.sh # cores _troca_cor() { COR_ATUAL=$(egrep "^$1*" ~/.config/tint2/tint2rc | egrep -o '#[A-Fa-f0-9]{3,6}') while NOVA_COR=$( \ yad --title="Trocar cor do $1" --color --init-color="$COR_ATUAL" \ --button='Sair':1 --button='Alterar':0 ) do sed -i "/^$1/s/$COR_ATUAL/ $NOVA_COR/g" ~/.config/tint2/tint2rc # reiniciar o tint2 killall -9 tint2 tint2 & COR_ATUAL=$(egrep "^$1*" ~/.config/tint2/tint2rc | egrep -o '#[A-Fa-f0-9]{3,6}') done } while ITEM=$( yad --title='Editor Tint2' --list --width=220 --height=150 --hide-column=1 --no-headers \ --column='ID' --column='Propriedade' --print-column=1 --separator='' \ 1 'Cor de Fundo' \ 2 'Cor da Fonte Ativa' ) do case "$ITEM" in 1) _troca_cor background_color ;; 2) _troca_cor task_active_font_color ;; esac done #----------------------------------------------------------------------- #!/bin/bash # arquivo tint2_fonte.sh # fonte FONTE_ATUAL=$(egrep "^task_font =" ~/.config/tint2/tint2rc | cut -d'=' -f2) while NOVA_FONTE=$( yad --font --title='Editor Fonte Tint2' --fontname="$FONTE_ATUAL"\ --button='Sair':1 --button='Alterar':0) do sed -i "/^task_font =/s/$FONTE_ATUAL/ $NOVA_FONTE/g" ~/.config/tint2/tint2rc # reiniciar o tint2 killall -9 tint2 tint2 & FONTE_ATUAL=$(egrep "^task_font =" ~/.config/tint2/tint2rc | cut -d'=' -f2) done #----------------------------------------------------------------------- #!/bin/bash # arquivo tint2_outros.sh # configurações diversas do tint2 function _get_configs() { LARGURA_ATUAL=$(egrep "^panel_size =" ~/.config/tint2/tint2rc | cut -d'=' -f2 | cut -d'%' -f1) ALTURA_ATUAL=$(egrep "^panel_size =" ~/.config/tint2/tint2rc | cut -d'=' -f2 | cut -d'%' -f2) TAMANHO_BORDA=$(egrep "^border_width =" ~/.config/tint2/tint2rc | cut -d'=' -f2) AUTO_ESCONDER=$(egrep "^autohide =" ~/.config/tint2/tint2rc | cut -d'=' -f2) ALTURA_ESCONDER=$(egrep "^autohide_height =" ~/.config/tint2/tint2rc | cut -d'=' -f2) [ $AUTO_ESCONDER -eq 0 ] && AUTO_ESCONDER='FALSE' || AUTO_ESCONDER='TRUE' } _get_configs while CONFIGS=$(yad --form --title='Configurar Tint2' --width=400 \ --field='Largura da barra':NUM $LARGURA_ATUAL!30..100 --field='Altura da barra':NUM $ALTURA_ATUAL!20..100 \ --field='Tamanho da borda':NUM $TAMANHO_BORDA!0..10 --field='Auto-esconder':CHK "$AUTO_ESCONDER" \ --field='Altura ao Esconder':NUM $ALTURA_ESCONDER!0..10 --button='Sair':1 --button='Alterar':0) do NOVA_LARGURA=$(echo $CONFIGS | cut -d'|' -f1 | cut -d'.' -f1) NOVA_ALTURA=$(echo $CONFIGS | cut -d'|' -f2 | cut -d'.' -f1) NOVA_TAMANHO_BORDA=$(echo $CONFIGS | cut -d'|' -f3 | cut -d'.' -f1) NOVO_AUTO_ESCONDER=$(echo $CONFIGS | cut -d'|' -f4) NOVA_ALTURA_ESCONDER=$(echo $CONFIGS | cut -d'|' -f5 | cut -d'.' -f1) [ $NOVO_AUTO_ESCONDER == 'FALSE' ] && NOVO_AUTO_ESCONDER=0 || NOVO_AUTO_ESCONDER=1 [ $AUTO_ESCONDER == 'FALSE' ] && AUTO_ESCONDER=0 || AUTO_ESCONDER=1 sed -i "/^panel_size =/s/$LARGURA_ATUAL%/ $NOVA_LARGURA%/g" ~/.config/tint2/tint2rc sed -i "/^panel_size =/s/$ALTURA_ATUAL/ $NOVA_ALTURA/g" ~/.config/tint2/tint2rc sed -i "/^border_width =/s/$TAMANHO_BORDA/ $NOVA_TAMANHO_BORDA/g" ~/.config/tint2/tint2rc sed -i "/^autohide =/s/$AUTO_ESCONDER/ $NOVO_AUTO_ESCONDER/g" ~/.config/tint2/tint2rc sed -i "/^autohide_height =/s/$ALTURA_ESCONDER/ $NOVA_ALTURA_ESCONDER/g" ~/.config/tint2/tint2rc # reiniciar o tint2 killall -9 tint2 tint2 & _get_configs done
POSTFIX AUTOMÁTICO COM MYSQL E IPTABLES - CALCULA O % DE USO DA QUOTA E ATUALIZA BANCO
Pra quem não usa WhatsUp e Nagios mas tem um *inx.
Manipulação de contas de email com o postfix
Firewall Iptables agressivo para desktop
Nenhum comentário foi encontrado.
Como ativar o módulo de cancelamento de ruído no Pipewire
Como escolher o melhor escalonador de CPU para melhorar o desempenho da máquina
Curiosidade sobre DOOM Guy e Isabelle de Animal Crossing
Inicializando servidor Ubuntu na AWS e rodando apache em Container
Otimizando o seu sistema com swappiness
Instalando Brave Browser no Debian 12
Adicionando ícones de status do teclado no system tray do Xfce4
GRUB do Debian 12 não detecta segundo Linux instalado em partição BTRF... (10)
Como instalar software no computador da rede pelo GLPI sem precisar i... (0)
Convertendo valores em bytes maiores que 1YB[DUVIDA] (1)
Instalar ubuntu ao lado do Windows 10, só que em outro SSD (2)