Enviar gráficos 3D pela janela de chat no Kopete
Publicado por Júlio Hoffimann Mendes (última atualização em 10/08/2010)
[ Hits: 5.058 ]
O script permite enviar gráficos 3D para um contato do Kopete especificado. Para maiores informações, consulte a versão 2D aqui no VOL.
Assim como naquela versão, os comandos do Gnuplot foram escritos no próprio script para facilitar alterações e evitar arquivos de configuração desnecessários numa aplicação tão simples. Perceba que alguns desses comandos estão comentados, caso você queira testar outras aparências que julguei interessantes.
Obs.: Ao alterar as configurações do Gnuplot no script, lembre-se que existem dois campos: remetente e destinatário.
Como usar o script:
1ª Maneira-> Na janela de chat, ao conversar com Richard Stallman (nickname), escreva:
/exec Plot3d.sh 'sin(x)*cos(y)' -pi pi -pi pi 10 'Richard Stallmann'
2ª Maneira-> Também é possível especificar a conta para qual você deseja mandar o gráfico, por exemplo:
/exec Plot3d.sh 'x**2-y**2' -10 10 -10 10 10 'richard.stallman@freesoftware.org'
O último argumento numérico está associado ao refinamento do gráfico, geralmente 10 é suficiente. Se divirtam e mostrem o poder do Linux para os seus contatos. =)
#!/bin/bash # Plot3d.sh sends 3D plots to specified Kopete contact # Copyright (C) 2010 Júlio Hoffimann Mendes # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # ---------------------------------------------------------------------- # # Dependencies: gnuplot # Description: send 3D plots to specified Kopete contact # Usage: Plot3d.sh <f(x,y), g(x,y),..., h(x,y)> xmin xmax ymin ymax samples AccountID # samples is associated to the number of points to be plotted for each x and y axis, generally 10 is sufficient # Example: Plot3d.sh 'x**2-y**2' -10 10 -10 10 10 'richard.stallman@freesoftware.org' # OBS: AccountID could be MetaContactID, for example 'Richard Stallman' # gnuplot file with plot specifications SPECS=`tempfile` FIGURE=`tempfile --prefix Plot- --suffix .png` # =================================== # Destinatary Plot Specifications # =================================== echo " reset; set term png; set xrange [$2:$3]; set yrange [$4:$5]; set autoscale zmin; set autoscale zmax; # set samples 400; set isosamples $6; set grid; set pm3d; # set palette defined ( 0 \"cyan\", 1 \"white\", 2 \"red\" ); # set hidden3d; set contour; set cntrparam levels auto 10; unset clabel; set colorbox front; set title \"Seja livre, use Linux!\"; splot $1 with lines lc rgb \"#d3d3d3\"; # splot $1 with pm3d lc rgb \"#d3d3d3\"; " > $SPECS # make figure gnuplot $SPECS > $FIGURE # send it to specified contact qdbus org.kde.kopete /Kopete org.kde.Kopete.sendFile "$7" $FIGURE # =================================== # Remetent Plot Specifications # =================================== echo " reset; set xrange [$2:$3]; set yrange [$4:$5]; set autoscale zmin; set autoscale zmax; # set samples 400; set isosamples $6; set grid; set pm3d; # set palette defined ( 0 \"cyan\", 1 \"white\", 2 \"red\" ); # set hidden3d; set contour; set cntrparam levels auto 10; unset clabel; set colorbox front; set title \"Seja livre, use Linux!\" font \"Times,18\"; splot $1 with lines lc rgb \"#d3d3d3\"; # splot $1 with pm3d lc rgb \"#d3d3d3\"; " > $SPECS # plot function(s) on a float window to remetent gnuplot -persist $SPECS rm $SPECS
Instalar e configurar o Wireshark automaticamente no Ubuntu
Nenhum coment�rio foi encontrado.
Aprenda a Gerenciar Permissões de Arquivos no Linux
Como transformar um áudio em vídeo com efeito de forma de onda (wave form)
Como aprovar Pull Requests em seu repositório Github via linha de comando
Visualizar arquivos em formato markdown (ex.: README.md) pelo terminal
Dando - teoricamente - um gás no Gnome-Shell do Arch Linux
Como instalar o Google Cloud CLI no Ubuntu/Debian
Mantenha seu Sistema Leve e Rápido com a Limpeza do APT!
Procurando vídeos de YouTube pelo terminal e assistindo via mpv (2025)
Alguém já usou o framework Avalonia para desenvolver interfaces de usu... (4)
Ajuda Pra Melhoria do NFTABLES. (8)
Sinto uma leve lentidão ao arrastar, miniminizar e restauras as janela... (2)
Pastas da raiz foram para a área de trabalho [RESOLVIDO] (7)