Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Il ritrovo della comunità dove confrontarsi e discutere sulle notizie dal mondo dell'informatica, di Ubuntu e di tutto quello che la riguarda, novità, pettegolezzi e quant'altro.
Avatar utente
centoventicinque
Prode Principiante
Messaggi: 145
Iscrizione: martedì 31 luglio 2007, 11:33
Località: deruta-perugia-umbria

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da centoventicinque »

monitorali.. in conky ?

p.s. , ho buttato giu ste 2 righe, van bene per le cpu ?

#${offset 240}${color}${font weather:size=26}y ${font}FSB ${i2c temp 1} °C
#${offset 240}${color slate grey}Temperature:
#${offset 240}${color}${font weather:size=26}z ${font}CPU ${i2c temp 2} °C
Avatar utente
mauccta
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 394
Iscrizione: lunedì 14 dicembre 2009, 17:06
Località: Prato

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da mauccta »

io utilizzo queste per HD e CPU

Codice: Seleziona tutto

Hard Disk: ${hddtemp /dev/sda}°C
Core 0: ${execi 200 sensors | grep Core\ 0 | cut -c15-16 ;}°C
Core 1: ${execi 200 sensors | grep Core\ 1 | cut -c15-16 ;}°C
Avatar utente
candyman
Scoppiettante Seguace
Scoppiettante Seguace
Messaggi: 577
Iscrizione: sabato 11 luglio 2009, 14:47
Desktop: XFCE
Distribuzione: Ubuntu 12.10 x86_64

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da candyman »

raga, che voi sappiate, esiste un modo per impostare un'azione quando si clicca su conky?
Non capisco perchè molti parlano male di Windows... Per me, insieme a Virtual Box, è uno dei migliori programmi che gira sotto Linux!
Avatar utente
centoventicinque
Prode Principiante
Messaggi: 145
Iscrizione: martedì 31 luglio 2007, 11:33
Località: deruta-perugia-umbria

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da centoventicinque »

no, ma con compiz si può fare una fighata simile  8)
Allegati
Schermata-1.jpg
Avatar utente
alecive
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1886
Iscrizione: venerdì 12 dicembre 2008, 14:09
Desktop: gnome-shell o unity
Distribuzione: Ubuntu 12.04
Località: Sestri Levante
Contatti:

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da alecive »

Esiste ma è un po' un casino.. I metodi sono due:

1. conky con sotto nascosti dei lanciatori -> esempi:
http://alecive.deviantart.com/art/A-New ... -169100684
http://bigrza.deviantart.com/art/update ... -136234552

2. adeskbar -> esempio:
http://jpope777.deviantart.com/art/Conk ... -183247482
La follia è come la gravità. Basta una piccola spinta.                              AwOken Iconset - Rilasciata la  2.4!! (c'è anche il ppa [lucid-maverick-natty-oneiric-precise]!)
Avatar utente
SuNjACk
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1061
Iscrizione: martedì 19 maggio 2009, 16:27
Località: Pesaro

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da SuNjACk »

Codice: Seleziona tutto

#!/bin/zsh

netfile="/proc/net/dev"
netdev=( "wlan0" "ppp0" )
active="none"

for i in $netdev[@] ; do
#	echo "-> searching dev \"$i\""
	string="`grep $i $netfile`"
	if  [ -n "$string" ]; then
#		echo "-> found dev"
		#carrier=` echo $string | awk '{ print $15 }' `
		carrier="/sys/class/net/${i}/carrier"
#		echo "-> checking carrier"
		if [ -r "$carrier" ]; then
			cat $carrier &>/dev/null
			if [ "$?" = "0" ]; then
#				echo "-> carrier on for dev $i"
				active="$i"
			fi
		fi
	fi
done

#echo "-> choosen dev: $choosendev"
if [ "$active" != "none" ]; then
	echo "[\${color1}$active\${color}] DW \${color1}\${downspeed $active}\$color @ UP \${color1}\${upspeed $active}\$color"
else
	echo "Network Disabled"
fi
Uno script che ho fatto per vedere quale interfaccia per la rete sono attive

PER ORA È IN ZSH PERCHÈ COL BASH HO PROBLEMI CON GLI ARRAY

quindi se lo volete utilizzare controllare che zsh sia installato

la stringa che ho inserito nel conky è

Codice: Seleziona tutto

${execpi ~/bin/conky-net}
Desktop openbox Halloween Documents Linux non è Windows
Free Software Is A Matter Of Liberty Not Price
Avatar utente
Sargonsei
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2536
Iscrizione: domenica 17 febbraio 2008, 13:56

Re: Posta il tuo conkyrc & .png

Messaggio da Sargonsei »

Owen88 ha scritto: Ecco il mio:

Codice: Seleziona tutto

# Conky sample configuration
#
# the list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.

# set to yes if you want Conky to be forked in the background
background yes

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=7

# Text alpha when using Xft
xftalpha 0.8

# Print everything to stdout?
 out_to_console yes

# MPD host/port
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell

# Print everything to console?
 out_to_console yes

# mail spool
#mail_spool $MAIL

# Update interval in seconds
update_interval 3.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes

# If own_window is yes, you may use type normal, desktop or override
own_window_type normal

# Use pseudo transparency with own_window?
own_window_transparent yes

# If own_window_transparent is set to no, you can set the background colour here
#own_window_colour hotpink

# If own_window is yes, these window manager hints may be used
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 100 5

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders yes

# Stippled borders?
#stippled_borders 8

# border margins
border_margin 4

# border width
border_width 4

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 2
gap_y 29

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 1

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale no

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

# Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
max_port_monitor_connections 256

# Maximum number of special things, e.g. fonts, offsets, aligns, etc.
#max_specials 512

# Maximum size of buffer for user text, i.e. below TEXT line.
#max_user_text 16384

# Timing interval for music player thread, e.g. mpd, audacious
#music_player_interval (update_interval is default)

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

TEXT
${color green}Alberto - $sysname $kernel
$stippled_hr
${color green}Uptime:$color $uptime ${color green}- Load:$color $loadavg
${color green}CPU 1 Usage:${color} ${cpu cpu1}% ${cpubar cpu1}
${color green}CPU 2 Usage:${color} ${cpu cpu2}% ${cpubar cpu2}
${color}${cpugraph cpu1 0000ff 00ff00}
${color}${cpugraph cpu2 0000ff 00ff00}
${color green}RAM:$color $mem/$memmax - $memperc% ${membar}
${color green}Processes:$color $processes  ${color grey}Running:$color $running_processes
$color$stippled_hr
${color green}File system:
/ $color${fs_used /}/${fs_size /} ${fs_bar /}
${color green}home: $color${fs_used /home}/${fs_size /home} ${fs_bar /home}
$stippled_hr
${color green}Network: 
${color green}Down ${color white}${downspeed wlan0} k/s ${alignr}${color green}Up ${color white}${upspeed wlan0} k/s
${downspeedgraph wlan0 25,107 0000ff 0000ff} ${alignr}${upspeedgraph wlan0 25,107 0000ff 0000ff}
${color green}Total ${color white}${totaldown wlan0} ${alignr}${color green}Total ${color white}${totalup wlan0}
$stippled_hr
 ${color}Name      	  PID    CPU%   MEM%
 ${color #ddaa00} ${top name 1}${top pid 1} ${top cpu 1} ${top mem 1}
 ${color #ddaa00} ${top name 2}${top pid 2} ${top cpu 2} ${top mem 2}
 ${color green} ${top name 3}${top pid 3} ${top cpu 3} ${top mem 3}
 ${color green} ${top name 4}${top pid 4} ${top cpu 4} ${top mem 4}
 ${color #ddaa00} ${top name 5}${top pid 5} ${top cpu 5} ${top mem 5}
 ${color #ddaa00} ${top name 6}${top pid 6} ${top cpu 6} ${top mem 6}
 ${color green} ${top name 7}${top pid 7} ${top cpu 7} ${top mem 7}
 ${color green} ${top name 8}${top pid 8} ${top cpu 8} ${top mem 8}
 ${color #ddaa00} ${top name 9}${top pid 9} ${top cpu 9} ${top mem 9}
 ${color #ddaa00} ${top name 10}${top pid 10} ${top cpu 10} ${top mem 10}

Immagine
Vorrei un conky come quello quotato, ma con una differenza: vorrei che i grafici che mostrano l'occupazione della CPU fossero mostrati sovrapposti, come vengono mostrati nel monitor di sistema.
È possibile? Come si fa?
Postare l'output di un comando significa inserire nel post: la riga in cui si digita il comando, tutto l'output, e la riga in cui il prompt ricompare.
Hardware e Sistema Operativo di Sargonsei: http://sargonsei.altervista.org/hardwar ... r-fisso-2/
Comandi da tenere a portata di mano: http://sargonsei.altervista.org/655-2/
Avatar utente
SuNjACk
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1061
Iscrizione: martedì 19 maggio 2009, 16:27
Località: Pesaro

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da SuNjACk »

Sargonsei ha scritto:
Owen88 ha scritto: Ecco il mio:

Codice: Seleziona tutto

# Conky sample configuration
#
# the list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.

# set to yes if you want Conky to be forked in the background
background yes

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=7

# Text alpha when using Xft
xftalpha 0.8

# Print everything to stdout?
 out_to_console yes

# MPD host/port
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell

# Print everything to console?
 out_to_console yes

# mail spool
#mail_spool $MAIL

# Update interval in seconds
update_interval 3.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes

# If own_window is yes, you may use type normal, desktop or override
own_window_type normal

# Use pseudo transparency with own_window?
own_window_transparent yes

# If own_window_transparent is set to no, you can set the background colour here
#own_window_colour hotpink

# If own_window is yes, these window manager hints may be used
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 100 5

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders yes

# Stippled borders?
#stippled_borders 8

# border margins
border_margin 4

# border width
border_width 4

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 2
gap_y 29

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 1

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 1

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale no

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

# Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
max_port_monitor_connections 256

# Maximum number of special things, e.g. fonts, offsets, aligns, etc.
#max_specials 512

# Maximum size of buffer for user text, i.e. below TEXT line.
#max_user_text 16384

# Timing interval for music player thread, e.g. mpd, audacious
#music_player_interval (update_interval is default)

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

TEXT
${color green}Alberto - $sysname $kernel
$stippled_hr
${color green}Uptime:$color $uptime ${color green}- Load:$color $loadavg
${color green}CPU 1 Usage:${color} ${cpu cpu1}% ${cpubar cpu1}
${color green}CPU 2 Usage:${color} ${cpu cpu2}% ${cpubar cpu2}
${color}${cpugraph cpu1 0000ff 00ff00}
${color}${cpugraph cpu2 0000ff 00ff00}
${color green}RAM:$color $mem/$memmax - $memperc% ${membar}
${color green}Processes:$color $processes  ${color grey}Running:$color $running_processes
$color$stippled_hr
${color green}File system:
/ $color${fs_used /}/${fs_size /} ${fs_bar /}
${color green}home: $color${fs_used /home}/${fs_size /home} ${fs_bar /home}
$stippled_hr
${color green}Network: 
${color green}Down ${color white}${downspeed wlan0} k/s ${alignr}${color green}Up ${color white}${upspeed wlan0} k/s
${downspeedgraph wlan0 25,107 0000ff 0000ff} ${alignr}${upspeedgraph wlan0 25,107 0000ff 0000ff}
${color green}Total ${color white}${totaldown wlan0} ${alignr}${color green}Total ${color white}${totalup wlan0}
$stippled_hr
 ${color}Name      	  PID    CPU%   MEM%
 ${color #ddaa00} ${top name 1}${top pid 1} ${top cpu 1} ${top mem 1}
 ${color #ddaa00} ${top name 2}${top pid 2} ${top cpu 2} ${top mem 2}
 ${color green} ${top name 3}${top pid 3} ${top cpu 3} ${top mem 3}
 ${color green} ${top name 4}${top pid 4} ${top cpu 4} ${top mem 4}
 ${color #ddaa00} ${top name 5}${top pid 5} ${top cpu 5} ${top mem 5}
 ${color #ddaa00} ${top name 6}${top pid 6} ${top cpu 6} ${top mem 6}
 ${color green} ${top name 7}${top pid 7} ${top cpu 7} ${top mem 7}
 ${color green} ${top name 8}${top pid 8} ${top cpu 8} ${top mem 8}
 ${color #ddaa00} ${top name 9}${top pid 9} ${top cpu 9} ${top mem 9}
 ${color #ddaa00} ${top name 10}${top pid 10} ${top cpu 10} ${top mem 10}

Immagine
Vorrei un conky come quello quotato, ma con una differenza: vorrei che i grafici che mostrano l'occupazione della CPU fossero mostrati sovrapposti, come vengono mostrati nel monitor di sistema.
È possibile? Come si fa?
intendi quelli con la linea continua? mi sa che per quelli bisogna fare ricorso a uno script lua.
Vuoi continuare? [Y/n] _

;D
Desktop openbox Halloween Documents Linux non è Windows
Free Software Is A Matter Of Liberty Not Price
deegan
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2639
Iscrizione: lunedì 28 aprile 2008, 12:42
Distribuzione: Ubuntu 20.04
Sesso: Maschile
Località: Varese

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da deegan »

Secondo mè li vuole sovrapposti così:: :P

Codice: Seleziona tutto

${cpugraph cpu1 0000ff 00ff00}
${voffset -40}${cpugraph cpu2 DC143C DC143C}
Immagine
MB* ASUS TUF Gaming Z690 SV* EVGA RTX 3080 Ti CPU* i7-12700K
RAM* Vengeance RGB PRO 32GB 3600MHz SSD* Samsung 980 PRO 2TB
Avatar utente
Sargonsei
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2536
Iscrizione: domenica 17 febbraio 2008, 13:56

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da Sargonsei »

deegan ha scritto: Secondo mè li vuole sovrapposti così:: :P

Codice: Seleziona tutto

${cpugraph cpu1 0000ff 00ff00}
${voffset -40}${cpugraph cpu2 DC143C DC143C}
Immagine
Esatto!
Si può fare?
Postare l'output di un comando significa inserire nel post: la riga in cui si digita il comando, tutto l'output, e la riga in cui il prompt ricompare.
Hardware e Sistema Operativo di Sargonsei: http://sargonsei.altervista.org/hardwar ... r-fisso-2/
Comandi da tenere a portata di mano: http://sargonsei.altervista.org/655-2/
deegan
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2639
Iscrizione: lunedì 28 aprile 2008, 12:42
Distribuzione: Ubuntu 20.04
Sesso: Maschile
Località: Varese

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da deegan »

Cerrrrrrrto ;D
Inserisci nel .conkyrc queste 2 stringhe:

Codice: Seleziona tutto

${cpugraph cpu1 0000ff 00ff00}
${voffset -40}${cpugraph cpu2 DC143C DC143C}
MB* ASUS TUF Gaming Z690 SV* EVGA RTX 3080 Ti CPU* i7-12700K
RAM* Vengeance RGB PRO 32GB 3600MHz SSD* Samsung 980 PRO 2TB
Avatar utente
Sargonsei
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2536
Iscrizione: domenica 17 febbraio 2008, 13:56

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da Sargonsei »

deegan ha scritto: Cerrrrrrrto ;D
Inserisci nel .conkyrc queste 2 stringhe:

Codice: Seleziona tutto

${cpugraph cpu1 0000ff 00ff00}
${voffset -40}${cpugraph cpu2 DC143C DC143C}
Avevo provato ad inserirle, ma nel mio PC veniva fuori qualcosa di diverso... per ottenere quello che volevo io, le ho dovute modificare così

Codice: Seleziona tutto

${color #00C200}${cpugraph cpu0 0000ff 00ff00}
${voffset -30}${color #H0C200}${cpugraph cpu1 DC143C DC143C}
Grazie dell'aiuto.
Postare l'output di un comando significa inserire nel post: la riga in cui si digita il comando, tutto l'output, e la riga in cui il prompt ricompare.
Hardware e Sistema Operativo di Sargonsei: http://sargonsei.altervista.org/hardwar ... r-fisso-2/
Comandi da tenere a portata di mano: http://sargonsei.altervista.org/655-2/
deegan
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2639
Iscrizione: lunedì 28 aprile 2008, 12:42
Distribuzione: Ubuntu 20.04
Sesso: Maschile
Località: Varese

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da deegan »

Il colore dei grfici sono definiti da queti codici::
${color #00C200}${cpugraph cpu0 0000ff 00ff00}
${voffset -30}${color #H0C200}${cpugraph cpu1 DC143C DC143C}
Quindi questo lo puoi eliminare:: ;)

Codice: Seleziona tutto

${color #00C200}
MB* ASUS TUF Gaming Z690 SV* EVGA RTX 3080 Ti CPU* i7-12700K
RAM* Vengeance RGB PRO 32GB 3600MHz SSD* Samsung 980 PRO 2TB
Avatar utente
Sargonsei
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2536
Iscrizione: domenica 17 febbraio 2008, 13:56

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da Sargonsei »

Un'ultima cosa: in una memoria USB, ho inserito un conky contenente questo codice:

Codice: Seleziona tutto

${color orange}CPU 0:${color #00C200} ${cpu cpu0}% ${cpubar cpu0}
${color orange}CPU 1:${color #H0C200} ${cpu cpu1}% ${cpubar cpu1}

${color #00C200}${cpugraph cpu0 0000ff 00ff00}
${voffset -30}${color #H0C200}${cpugraph cpu1 DC143C DC143C}
che mi permette di visualizzare l'occupazione delle CPU di un PC DUAL CORE.

Però se lo uso su un PC che ha un unico processore, anziché avere un grafico fedele ed uno piatto,, ho due grafici identici, come se ci fossero comunque due processori.
Ciò mi infastidisce, perché "camuffa" in DUAL CORE i PC a unico processore.
Come posso modificare le righe sopra riportate, per far sì che, se collego la memoria USB ad un PC monoprocessore, esso venga rilevato come tale, e non come un dual core?
Postare l'output di un comando significa inserire nel post: la riga in cui si digita il comando, tutto l'output, e la riga in cui il prompt ricompare.
Hardware e Sistema Operativo di Sargonsei: http://sargonsei.altervista.org/hardwar ... r-fisso-2/
Comandi da tenere a portata di mano: http://sargonsei.altervista.org/655-2/
Avatar utente
Sargonsei
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2536
Iscrizione: domenica 17 febbraio 2008, 13:56

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da Sargonsei »

deegan ha scritto: Il colore dei grfici sono definiti da queti codici::
${color #00C200}${cpugraph cpu0 0000ff 00ff00}
${voffset -30}${color #H0C200}${cpugraph cpu1 DC143C DC143C}
Quindi questo lo puoi eliminare:: ;)

Codice: Seleziona tutto

${color #00C200}
Perché dovrei eliminare una istruzione che mi serve per definire il colore del bordo esterno del mio grafico? ???
Postare l'output di un comando significa inserire nel post: la riga in cui si digita il comando, tutto l'output, e la riga in cui il prompt ricompare.
Hardware e Sistema Operativo di Sargonsei: http://sargonsei.altervista.org/hardwar ... r-fisso-2/
Comandi da tenere a portata di mano: http://sargonsei.altervista.org/655-2/
deegan
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2639
Iscrizione: lunedì 28 aprile 2008, 12:42
Distribuzione: Ubuntu 20.04
Sesso: Maschile
Località: Varese

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da deegan »

Ah ok allora si, non lo avevi detto....  ;D
MB* ASUS TUF Gaming Z690 SV* EVGA RTX 3080 Ti CPU* i7-12700K
RAM* Vengeance RGB PRO 32GB 3600MHz SSD* Samsung 980 PRO 2TB
Avatar utente
Sargonsei
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2536
Iscrizione: domenica 17 febbraio 2008, 13:56

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da Sargonsei »

Posto il mio conky

Codice: Seleziona tutto

# Conky, a system monitor, based on torsmo
#
# Any original torsmo code is licensed under the BSD license
#
# All code written since the fork of torsmo is licensed under the GPL
#
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# 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/>.
#
# $Id: conky.conf 990 2007-11-22 19:38:17Z pkovacs $#background yes
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft no

# Update interval in seconds
update_interval 3.0

# Minimum size of text area
# minimum_size 250 5

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
#font arial
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_margin 9

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color grey

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 20

# stuff after ‘TEXT’ will be formatted on screen

TEXT
$color
# ${color}Architettura: $machine ${alignr}Uptime: $uptime_short
${color0}${font HandelGotD:size=10}${time Ore %H:%M di %a %d %B %Y}${alignr}Uptime: $uptime_short${font}${color}

${color orange}SYSTEM ${hr 2}$color
$nodename $sysname $kernel on $machine

${color orange}CPU ${hr 2}$color

${freq}MHz Load: ${loadavg} Temp: ${acpitemp}

${color orange}CPU 0:${color #00C200} ${cpu cpu0}% ${cpubar cpu0}
${color orange}CPU 1:${color #H0C200} ${cpu cpu1}% ${cpubar cpu1}

${color #00C200}${cpugraph cpu0 0000ff 00ff00}
${voffset -30}${color #H0C200}${cpugraph cpu1 DC143C DC143C}
#
# ${color #00C200}${cpugraph cpu0 000000 ffffff}
# ${color #H0C200}${cpugraph cpu1 000000 ffffff}

${color orange}MEMORY ${hr 2}$color

RAM: $mem/$memmax $memperc% ${membar 6}$color
${color red}Swap: $swap/$swapmax $swapperc% ${swapbar 6}$color

${color orange}PROCESSES ${hr 2}$color
NAME              PID    CPU%   MEM%

${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${top name 6} ${top pid 6} ${top cpu 6} ${top mem 6}
${top name 7} ${top pid 7} ${top cpu 7} ${top mem 7}
${top name 8} ${top pid 8} ${top cpu 8} ${top mem 8}
${top name 9} ${top pid 9} ${top cpu 9} ${top mem 9}

${color orange}DISK ${hr 2}$color

Root : ${fs_free /}/${fs_size /} ${fs_free_perc /}% ${fs_bar 6 /}$color
${fs_bar /}
${color red}NETWORK (${addr ppp0}) ${hr 2}$color
Down: $color${downspeed ppp0} k/s ${alignr}Up: ${upspeed ppp0} k/s
${downspeedgraph ppp0 25,140 000000 ff0000} ${alignr}${upspeedgraph ppp0
25,140 000000 00ff00}$color
Total: ${totaldown ppp0} ${alignr}Total: ${totalup ppp0}
Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768
61000 count}${alignr}Total: ${tcp_portmon 1 65535 count}

${color orange}LOGGING ${hr 2}$color
${execi 30 tail -n3 /var/log/messages | fold -w50}

${color orange}UBUNTU ${hr 2}$color

Immagine
Postare l'output di un comando significa inserire nel post: la riga in cui si digita il comando, tutto l'output, e la riga in cui il prompt ricompare.
Hardware e Sistema Operativo di Sargonsei: http://sargonsei.altervista.org/hardwar ... r-fisso-2/
Comandi da tenere a portata di mano: http://sargonsei.altervista.org/655-2/
Avatar utente
Iacoporosso
Prode Principiante
Messaggi: 232
Iscrizione: lunedì 10 gennaio 2011, 18:32
Desktop: kde 4.10
Distribuzione: kubuntu 12.10

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da Iacoporosso »

ci provo l'ultima volta...
qualcuno mi potrebbe dire come posso visualizzare sul conky la copertina dell'album in ascolto?? uso exaile  >:( >:(
Avatar utente
centoventicinque
Prode Principiante
Messaggi: 145
Iscrizione: martedì 31 luglio 2007, 11:33
Località: deruta-perugia-umbria

Re: Posta il tuo conkyrc & .png

Messaggio da centoventicinque »

questo è il mio "nouvo" conky , devo ancora mettere  mano a forecast , ma fa istess  (rotfl)


conkyrc

Codice: Seleziona tutto

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_hints undecorated,below,skip_taskbar
background no

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft yes

# Update interval in seconds
update_interval 1

# Minimum size of text area
minimum_size 150 5

# Draw shades?
draw_shades no

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no

uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 1

# border margins
border_margin 1

# border width
border_width 1

# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color black
default_outline_color grey90

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 1750
gap_y 170

# stuff after 'TEXT' will be formatted on screen

override_utf8_locale yes
xftfont Terminus:size=9
xftalpha 0.8


TEXT
  

${hr 1}
${hr 1}
${color #0066FF}SYSTEM:${color}
${voffset 5}${color}${font StyleBats:size=12} ${font}${color slate grey}UpTime: ${color }$uptime
${color}${font StyleBats:size=12} ${font}${color slate grey}Kern:${color }$kernel
${hr 2}
${color #0066FF}CPU MONITOR:${color}
#${voffset 5}${color slate grey}Temp:${color }
${voffset 5}${color slate grey}HWTemp: ${color }${hwmon temp 1}°C
${voffset 5}${color slate grey}CPU 1 Usage:${color} ${cpu cpu1}% ${cpubar cpu1}
${voffset 5}${color slate grey}CPU 2 Usage:${color} ${cpu cpu2}% ${cpubar cpu2}
${voffset 5}${color}${cpugraph cpu1 00CBFF 00CBFF}
${voffset 5}${color}${cpugraph cpu2 00CBFF 00CBFF}
${hr 2}
${color #0066FF}TASK:${color}
${color slate grey}Load: ${color }$loadavg
${color slate grey}Processes: ${color }$processes  
${color slate grey}Running:   ${color }$running_processes

${color}${font Webdings:size=12} ${font}${color slate grey}Highest CPU:
${color #0066FF} ${top name 1}${top cpu 1}
${color lightgrey} ${top name 2}${top cpu 2}
${color lightgrey} ${top name 3}${top cpu 3}

${color}${font Webdings:size=12} ${font}${color slate grey}Highest MEM:
${color #0066FF} ${top_mem name 1}${top_mem mem 1}
${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${hr 2}
${color #0066FF}SYSTEM MEMORY:${color}
${color slate grey}RAM:  ${color } $memperc% $mem/$memmax
${membar 6,150}
${color slate grey}SWAP: ${color } $swapperc% $swap/$swapmax
${swapbar 6,150}
${hr 2}
${color #0066FF}STORAGE:${color}
${color slate grey}ROOT:    ${color }${fs_free /}/${fs_size /}
${fs_bar 6,150 /}

${color slate grey}HOME:    ${color }${fs_free /home}/${fs_size /home}
${fs_bar 6,150 /home}

${color slate grey}BACKUP:    ${color }${fs_free /home/rodrigo/backup}/${fs_size /home/rodrigo/backup}
${fs_bar 6,150 /home/rodrigo/backup}
${hr 2}
${color #0066FF}NETWORK:${color}
${voffset 5}${color slate grey}TOTAL UP: ${color } ${totalup eth0} 
${voffset 1}${color}${font PizzaDude Bullets:size=12}${font}  Up: ${color }${upspeed eth0}k/s
${upspeedgraph eth0 20,150 00CBFF 00CBFF}
${voffset 5}${color slate grey}TOTAL DWN: ${color } ${totaldown eth0} 
${voffset 1}${color}${font PizzaDude Bullets:size=12}${font}  Down: ${color }${downspeed eth0}k/s
${downspeedgraph eth0 20,150 00CBFF 00CBFF}

Allegati
conky.jpg
deegan
Imperturbabile Insigne
Imperturbabile Insigne
Messaggi: 2639
Iscrizione: lunedì 28 aprile 2008, 12:42
Distribuzione: Ubuntu 20.04
Sesso: Maschile
Località: Varese

Re: Posta il tuo .conkyrc & png ""Leggete in 1°Pagina conkyForecast""

Messaggio da deegan »

Ecco il conky promesso:  ;D lo troverete anche nel 1°post.
Immagine
.conkyrc_orange

Codice: Seleziona tutto

#==============================================================================
#                               conkyrc_orange
#
#  author  : SLK
#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
#temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048

gap_x 10
gap_y 30
minimum_size 190 450
maximum_width 190
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

override_utf8_locale yes
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5
uppercase no

default_color FFFFFF
color1 DDDDDD
color2 AAAAAA
color3 888888
color4 EF5A29
#conky -c .conkyrc2

lua_load ~/.scripts/conky_orange.lua
lua_draw_hook_post main

TEXT
${voffset 35}
${goto 95}${color4}${font ubuntu:size=22}${time %e}${color1}${offset -50}${font ubuntu:size=10}${time %A}
${goto 85}${color2}${voffset -2}${font ubuntu:size=9}${time %b}${voffset -2} ${color3}${font ubuntu:size=12}${time %Y}${font}

${voffset 80}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}CPU
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${top name 1}${alignr}${top cpu 1}%
${goto 90}${font Ubuntu:size=7,weight:normal}${color2}${top name 2}${alignr}${top cpu 2}%
${goto 90}${cpugraph 10,100 A9A9A9 666666}
${goto 90}${voffset -10}${font Ubuntu:size=7,weight:normal}${color}${threads} process 

${voffset 30}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}MEM
${goto 90}${font Ubuntu:size=7,weight:normal}${color1}${top_mem name 1}${alignr}${top_mem mem 1}%
${goto 90}${font Ubuntu:size=7,weight:normal}${color2}${top_mem name 2}${alignr}${top_mem mem 2}%

${voffset 25}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}WLAN0

${goto 90}${downspeedgraph wlan0 30,100 A9A9A9 666666}${voffset -30}
${goto 90}${font Ubuntu:size=7,weight:normal}${color}Down: ${downspeed wlan0}
${goto 90}${font Ubuntu:size=7,weight:normal}${color}Up: ${upspeed wlan0}

${goto 90}Total Down:   ${totaldown wlan0}
${goto 90}Total Up:   ${totalup wlan0}
${voffset 10}
${goto 70}${font Ubuntu:size=18,weight:bold}${color3}NET${alignr}${color2}${font Ubuntu:size=7,weight:bold}${color1}${if_up eth0}wlan ${addr wlan0} ${endif}${if_up wlan0}wifi ${addr wlan0}${endif}

${goto 90}${font Ubuntu:size=7,weight:bold}${color}open ports: ${alignr}${color3}${tcp_portmon 1 65535 count}
${goto 90}${font Ubuntu:size=7,weight:bold}${color}${offset 10}IP${alignr}DPORT
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  0}${alignr 1}${tcp_portmon 1 65535 rport  0}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  1}${alignr 1}${tcp_portmon 1 65535 rport  1}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  2}${alignr 1}${tcp_portmon 1 65535 rport  2}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  3}${alignr 1}${tcp_portmon 1 65535 rport  3}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  4}${alignr 1}${tcp_portmon 1 65535 rport  4}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  5}${alignr 1}${tcp_portmon 1 65535 rport  5}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  6}${alignr 1}${tcp_portmon 1 65535 rport  6}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  7}${alignr 1}${tcp_portmon 1 65535 rport  7}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  8}${alignr 1}${tcp_portmon 1 65535 rport  8}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip  9}${alignr 1}${tcp_portmon 1 65535 rport  9}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip 10}${alignr 1}${tcp_portmon 1 65535 rport 10}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip 11}${alignr 1}${tcp_portmon 1 65535 rport 11}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip 12}${alignr 1}${tcp_portmon 1 65535 rport 12}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip 13}${alignr 1}${tcp_portmon 1 65535 rport 13}
${goto 90}${font Ubuntu:size=7,weight:normal}${tcp_portmon 1 65535 rip 14}${alignr 1}${tcp_portmon 1 65535 rport 14}
conky_orange.lua

Codice: Seleziona tutto

--==============================================================================
--                            conky_orange.lua
--
--  author  : SLK
--  version : v2011011601
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%H',                    max_value=12,
    x=110,                         y=80,
    graph_radius=53,
    graph_thickness=3,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    txt_radius=34,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.6,
    graduation_radius=53,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=110,                         y=80,
    graph_radius=57,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    txt_radius=70,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.6,
    graduation_radius=57,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=110,                         y=80,
    graph_radius=50,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.2,
    txt_radius=40,
    txt_weight=0,                  txt_size=12.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.3,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
    },
}

--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=85,                          y=200,
    graph_radius=18,
    graph_thickness=3,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu2',                  max_value=100,
    x=85,                          y=200,
    graph_radius=24,
    graph_thickness=3,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=85,                          y=300,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,       
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name="upspeedf",           arg="wlan0",                     max_value=100,
    x=85,                          y=380,
    graph_radius=24,
    graph_thickness=4,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='up',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name="downspeedf",           arg="wlan0",                max_value=100,
    x=85,                          y=380,
    graph_radius=18,
    graph_thickness=4,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption="down",
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
}

-------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

-------------------------------------------------------------------------------
--                                                            angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end

-------------------------------------------------------------------------------
--                                                              draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']

    -- background ring
    cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = (value % max_value)
    local i = 1
    while i <= val do
        cairo_arc(display, x, y, graph_radius,(  ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360)  )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
        cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = (graph_unit_angle * i) - graph_unit_thickness

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = 360 / graduation_unit_angle
        local i = 1
        while i <= nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
    local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
    cairo_set_font_size (display, txt_size);
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
    cairo_show_text (display, value);
    cairo_stroke (display);
end

-------------------------------------------------------------------------------
--                                                              draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_start_angle = data['graph_start_angle']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
    local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
    local graph_end_angle = (max_value * graph_unit_angle) % 360

    -- background ring
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = value % (max_value + 1)
    local start_arc = 0
    local stop_arc = 0
    local i = 1
    while i <= val do
        start_arc = (graph_unit_angle * i) - graph_unit_thickness
        stop_arc = (graph_unit_angle * i)
        cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
        cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = start_arc

    -- hand
    start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
    stop_arc = (graph_unit_angle * val)
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
    cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
    cairo_stroke(display)

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = graph_end_angle / graduation_unit_angle
        local i = 0
        while i < nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
            stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
            cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
    local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
    cairo_set_font_size (display, txt_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
    cairo_show_text (display, value)
    cairo_stroke (display)

    -- caption
    local caption = data['caption']
    local caption_weight, caption_size = data['caption_weight'], data['caption_size']
    local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
    local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
    cairo_set_font_size (display, caption_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
    cairo_move_to (display, x + tox + 5, y + toy + 1)
    -- bad hack but not enough time !
    if graph_start_angle < 105 then
        cairo_move_to (display, x + tox - 30, y + toy + 1)
    end
    cairo_show_text (display, caption)
    cairo_stroke (display)
end

-------------------------------------------------------------------------------
--                                                               go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
    local function load_clock_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_clock_ring(display, data, value)
    end
    
    for i in pairs(clock_h) do
        load_clock_rings(display, clock_h[i])
    end
    for i in pairs(clock_m) do
        load_clock_rings(display, clock_m[i])
    end
    for i in pairs(clock_s) do
        load_clock_rings(display, clock_s[i])
    end
end

-------------------------------------------------------------------------------
--                                                               go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
    local function load_gauge_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_gauge_ring(display, data, value)
    end
    
    for i in pairs(gauge) do
        load_gauge_rings(display, gauge[i])
    end
end

-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then 
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)
    
    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)
    
    if update_num > 5 then
        go_clock_rings(display)
        go_gauge_rings(display)
    end

end
MB* ASUS TUF Gaming Z690 SV* EVGA RTX 3080 Ti CPU* i7-12700K
RAM* Vengeance RGB PRO 32GB 3600MHz SSD* Samsung 980 PRO 2TB
Chiusa

Ritorna a “Bar Ubuntu”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 4 ospiti