[OpenIndiana-discuss] conky scripts

openbabel openbabel at gmail.com
Fri Sep 21 09:21:05 UTC 2012


Installo Scons:
http://www.scons.org/
tolua++ uses SCons to build. SCons is based on python, you can get a 
stand-alone version on their website. After you have SCons, follow this 
simple instructions:

$ tar xvzf scons-1.2.0.d20090919.tar.gz
$ cd scons-1.2.0.d20090919
$ pfexec python setup.py install

Installed SCons library modules into /usr/lib/scons-1.2.0.d20090919
Installed SCons scripts into /usr/bin
Installed SCons man pages into /usr/man/man1

$ ls -lah /usr/bin/scon*
-rwxr-xr-x 1 root root 5.9K 2009-09-20 01:59 scons
-rwxr-xr-x 1 root root 5.9K 2009-09-20 01:59 scons-1.2.0.d20090919
-rwxr-xr-x 1 root root 49K 2009-09-20 01:00 scons-time
-rwxr-xr-x 1 root root 49K 2009-09-20 01:00 scons-time-1.2.0.d20090919
-rwxr-xr-x 1 root root 17K 2009-09-20 01:59 sconsign
-rwxr-xr-x 1 root root 17K 2009-09-20 01:59 sconsign-1.2.0.d20090919

Installo TOLUA++:
$ pfexec pkg install SUNWlua

tolua++ is an extended version of tolua, a tool to integrate C/C++ code 
with Lua. tolua++ includes new features oriented to c++ such as:

* Support for std::string as a basic type (this can be turned off by a 
command line option).
* Support for class templates

$ wget http://www.codenix.com/~tolua/tolua++-1.0.93.tar.bz2
$ tar xvjf tolua++-1.0.93.tar.bz2
$ cd /data/tolua++-1.0.93

$ vi config_posix.py
# libraries
#LIBS = ['lua', 'lualib', 'm']
LIBS = ['lua', 'm']

$ pfexec scons
$ pfexec scons install

Compilo e installo conky:
http://conky.sourceforge.net/

Installo pkg-config:
$ pfexec pkg install SUNWgnome-common-devel

Scompatto e compilo:
$ tar xvjf conky-1.7.2.tar.bz2
$ cd conky-1.7.2

$ ./configure
Your operating system SunOS isn't supported
Feel free to help. :P

Dowload conky-1.7.2-opensolaris.diff da "http://www.milax.org/?p=287"

$ wget http://milax.org/files/conky-1.7.2-opensolaris.diff

$ cp configure configure.old

$ patch --dry-run -p1 -i conky-1.7.2-opensolaris.diff
patching file configure
patching file src/common.c
patching file src/config.h.in
patching file src/conky.c
patching file src/fs.c
patching file src/mail.c
patching file src/Makefile.am
patching file src/Makefile.in
patching file src/solaris.c

$ patch -p1 -i conky-1.7.2-opensolaris.diff
patching file configure
patching file src/common.c
patching file src/config.h.in
patching file src/conky.c
patching file src/fs.c
patching file src/mail.c
patching file src/Makefile.am
patching file src/Makefile.in
patching file src/solaris.c

$ export LD_LIBRARY_PATH=/usr/local/lib
$ export PATH=/usr/local/bin:/usr/local/include:$PATH

$ ./configure --prefix=/opt/conky --disable-mpd --disable-moc 
--enable-weather-metar --enable-lua-cairo

$ gmake && pfexec gmake install

Scarico e installo i file di configurazione:
Download .conkyrc clock_rings.lua
http://www.milax.org/?p=287

$ mkdir $HOME/.lua
$ mkdir $HOME/.lua/scripts

$ mv clock_rings.lua $HOME/.lua/scripts
$ mv conkyrc $HOME/.conkyrc


Lancio l'eseguibile:
$ /opt/conky/bin/conky &

$ vi $HOME/.conkyrc
${color FFFFFF}${goto 125}${voffset 25}${upspeed rtls0}
${color FFFFFF}${goto 125}${downspeed rtls0}
${color 3399FF}${goto 125}Net

cambio rtls0 con bge0/yukonx0

${color FFFFFF}${goto 125}${voffset 25}${upspeed yukonx0}
${color FFFFFF}${goto 125}${downspeed yukonx0}
${color 3399FF}${goto 125}Net

per cambiare la temperatura modificare la riga:
${font caviar dreams:size=12}${color FFFFFF}${alignr}${weather 
http://weather.noaa.gov/pub/data/observations/metar/stations/ LIRQ 
temperature temperature 30} °C${font}

per Firenze/Peretola
http://weather.noaa.gov/weather/current/LIRQ.html
http://weather.noaa.gov/pub/data/observations/metar/stations/LIRQ.TXT

per aggiungere più schede di rete:
${color FFFFFF}${goto 125}${voffset 25}${upspeed rtls0}
${color FFFFFF}${goto 125}${downspeed rtls0}
${color 3399FF}${goto 125}Net rtls0
${color FFFFFF}${goto 100}${voffset 25}${upspeed atge0}
${color FFFFFF}${goto 100}${downspeed atge0}
${color 3399FF}${goto 100}Net Atge0
${color FFFFFF}${goto 75}${voffset 25}${upspeed hme0}
${color FFFFFF}${goto 75}${downspeed hme0}
${color 3399FF}${goto 75}Net hme0

"goto" serve per spostare orizzontalmente "Net xxxx"

Per aggiungere e spostare l'interfaccia grafica si deve
modificare lo script:
$ vi $HOME/.lua/scripts/clock_rings.lua

Nel mio caso ho aggiunto due interfaccie di rete:
{
name='upspeedf',
arg='atge0',
max=100,
bg_colour=0xffff33,
bg_alpha=0.2,
fg_colour=0xffff33,
fg_alpha=0.3,
x=125, y=565,
radius=25,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='downspeedf',
arg='atge0',
max=100,
bg_colour=0xccff33,
bg_alpha=0.2,
fg_colour=0xccff33,
fg_alpha=0.3,
x=125, y=565,
radius=20,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='upspeedf',
arg='hme0',
max=100,
bg_colour=0xffff33,
bg_alpha=0.2,
fg_colour=0xffff33,
fg_alpha=0.3,
x=100, y=630,
radius=25,
thickness=4,
start_angle=-90,
end_angle=180
},
{
name='downspeedf',
arg='hme0',
max=100,
bg_colour=0xccff33,
bg_alpha=0.2,
fg_colour=0xccff33,
fg_alpha=0.3,
x=100, y=630,
radius=20,
thickness=4,
start_angle=-90,
end_angle=180
},

Ecco il risultato:

<http://4.bp.blogspot.com/_v9ldtWDnxRs/Syam3jAF90I/AAAAAAAAALs/bDPOAgCaQmQ/s1600-h/Screenshot.png>







More information about the OpenIndiana-discuss mailing list