Interface gráfica para nível de tinta (escputil) em shell script

Publicado por Perfil removido (última atualização em 01/06/2015)

[ Hits: 4.766 ]

Download escputil-001.sh




Visualização gráfica dos níveis de tinta obtidos através do utilitário escputil.
Falta colocar parâmetros e dispositivo para ajuste fino.

Requer gnuplot.

  



Esconder código-fonte

#!/bin/bash

export BARRA="";
export ESPACO="";
export TABELA="";
export PARAMETROS=""; # coloque aqui parametros conforme impressora
export DISPOSITIVO=""; # coloque aqui dipositivo conforme local instalacao da impressora

j=1;

TABELA=`escputil "$PARAMETROS" "$DISPOSITIVO" | while read i; do

   COR=($i);

   case ${COR[0]} in
      (Cyan|Ciano|Yellow|Amarelo|Black|Preto|Magenta)
         echo -e "$j ${COR[0]} ${COR[1]}";
         let j++;
         ;;
      *)   continue
         ;;
   esac

done;

echo "e"
`

echo -ne "reset
set font \"Helvetica, 14\"

set title \"escputil colors\"
set ylabel \"\\\n% ink level\\\n\"

set xrange [0:5]
set yrange [-0.5:105]
set boxwidth 0.375

set style line 1 lc rgb \"white\"
set style line 2 lc rgb \"cyan\"
set style line 3 lc rgb \"yellow\"
set style line 4 lc rgb \"magenta\"
set style line 5 lc rgb \"black\"

set style fill solid

unset key 

plot '-' every ::0::0 using 1:3:xtic(2) with boxes ls 2, \
     '-'  every ::1::1 using 1:3:xtic(2) with boxes ls 3, \
     '-'  every ::2::2 using 1:3:xtic(2) with boxes ls 4, \
     '-'  every ::3::3 using 1:3:xtic(2) with boxes ls 5

$TABELA
$TABELA
$TABELA
$TABELA
" | gnuplot -p

exit 0

Scripts recomendados

Limpar o cache do squid3 sem parar a internet por muito tempo

Dia Anterior

Linux Mint 20 Pós Instalação

Advix - controle de processos judiciais para advogados

InitX


  

Comentários

Nenhum comentário foi encontrado.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts