[RISOLTO] slackware64 14.0 - conky - cairo -lua problem

Se avete problemi con l'installazione e la configurazione di Slackware64 postate qui. Non usate questo forum per argomenti che trattano la Slackware32 o generali... per quelli usate rispettivamente il forum Slackware e Gnu/Linux in genere.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware64 usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Slackware64, se l'argomento è Slackware32 o generale usate rispettivamente il forum Slackware o Gnu/Linux in genere.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
Avatar utente
ricciare
Linux 0.x
Linux 0.x
Messaggi: 71
Iscritto il: mer 27 feb 2008, 15:50
Nome Cognome: Nicola
Slackware: current 64bit
Kernel: 4.20.2
Desktop: fluxbox + kde4.10.5
Località: Pescia
Contatta:

[RISOLTO] slackware64 14.0 - conky - cairo -lua problem

Messaggio da ricciare »

Salve a tutti, in questi giorni do dovuto forzatamente reinstallare slackware e ne ho approfittato per fare un'installazione pulita della 14.0, a 64bit. Ho reinstallato pure conky, lua, tolua++, scons, imlib2 e ripristinato la configurazione di conky che in precedenza andava divinamente, mentre adesso invece proprio non ne vuol sentire di far partire gli elementi grafici. Come si vede dalla lista dei pacchetti, li ho presi tutta dai repository 64bit.
Qualche idea su come risolvere la rognetta?

Questo e' il simpaticissimo messaggio che appare

================================================================================

bash-4.2# ./run_conky &
[1] 2145
bash-4.2# Conky: llua_load: error loading module 'cairo' from file '/usr/lib64/conky/libcairo.so':
dynamic libraries not enabled; check your Lua installation
Conky: forked to background, pid is 2147

Conky: desktop window (1e5) is root window
Conky: window type - override
Conky: drawing to created window (0x1a00001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_clock_rings execution failed: attempt to call a nil value
...
e continua con lo stesso messaggio fintanto che non uccido conky.

================================================================================

bash-4.2# conky -v
Conky 1.9.0 compiled Sun Dec 30 12:35:34 CET 2012 for Linux 3.7.1 (x86_64)

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib64/conky

X11:
* Xdamage extension
* XDBE (double buffer extension)
* Xft
* ARGB visual

Music detection:
* Audacious
* MPD
* MOC

General:
* math
* hddtemp
* portmon
* Curl
* RSS
* Weather (METAR)
* Weather (XOAP)
* config-output
* Imlib2
* apcupsd
* iostats
* ncurses
* Lua

Lua bindings:
* Cairo
* Imlib2
================================================================================
pacchetti installati:
================================================================================
lua-5.1.5-x86_64-3sl.txz
tolua++-1.0.93-x86_64-1sl.txz
scons-2.2.0-x86_64-1sl.txz
imlib2-1.4.5-x86_64-2sl.txz
conky-1.9.0-x86_64-2sl.txz
dal cui slackbuild ho tolto solo: --enable-wlan \
--enable-ibm \
erano opzioni che non mi interessavano visto che non sto usando un pc/latptop ibm/lenovo
ed il pc non usa connessione wi-fi

================================================================================
conkyrc:
================================================================================

# Conky settings #
background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

# Window specifications #

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

minimum_size 200 250
maximum_width 200

alignment tl
gap_x 5
gap_y 10


# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5

uppercase no

temperature_unit celsius


default_color FFFFFF

# Lua Load #
lua_load ~/.conky/clock_rings.lua
lua_draw_hook_pre clock_rings

TEXT
${voffset 8}${color 3399FF}${font caviar dreams:size=16}${time %A}${font}${voffset -2}${alignr 50}${color FFFFFF}${font caviar dreams:size=32}${time %e}${font}
${color FFFFFF}${voffset -30}${color 3399FF}${font caviar dreams:size=18}${time %b}${font}${voffset -3} ${color FFFFFF}${font caviar dreams:size=20}${time %Y}${font}${color 3399FF}${hr}
${alignc 17}${font Arial Black:size=20}${time %H:%M %S}${font}
${voffset 18}${voffset 7}${font Arial Black:size=10}${alignc}${sysname}: ${color FFFFFF}${kernel}${machine}
${voffset 0}${color 3399FF}${font Arial Black:size=10}${alignc}Uptime: ${color FFFFFF}$uptime_short}${font}
${color FFFFFF}${goto 40}${voffset 47}${cpu cpu}%
${color 3399FF}${goto 35}${exec sensors | grep "CPU Temperature" | awk '{print $3}'}
${color 3399FF}${goto 25}CPU
${color FFFFFF}${goto 100}${voffset -33}${cpu cpu1}%
${color 3399FF}${goto 95}${exec sensors | grep "Core0" | awk '{print $3}'}
${color 3399FF}${goto 85}CORE0
${color FFFFFF}${goto 160}${voffset -33}${cpu cpu2}%
${color 3399FF}${goto 155}${exec sensors | grep "Core1" | awk '{print $3}'}
${color 3399FF}${goto 145}CORE1
${color FFFFFF}${goto 40}${voffset 30}${memperc}%
${color 3399FF}${goto 25}${voffset 6}RAM
${color FFFFFF}${goto 100}${voffset -28}${fs_used_perc /}%
${color 3399FF}${goto 85}${voffset 6}S64HD


${voffset 10}${color 3399FF}${font Arial Black:size=9}MB Temperature: ${color FFFFFF}${exec sensors | grep "MB Temperature" | awk '{print $3}'}${goto 134}C
${voffset 0}${color 3399FF}NV Temperature: ${color FFFFFF}+${exec nvidia-settings -q [gpu:0]/GPUCoreTemp | grep "Attribute" | awk '{print $4}'|sed 's/.\{1\}$//'}.0 C${font}


================================================================================
clock_rings.lua :
================================================================================

--[[
Clock Rings by londonali1010 (2009) Edited by jpope

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
lua_load ~/scripts/clock_rings.lua
lua_draw_hook_pre clock_rings

Changelog:
+ v1.0 -- Original release (30.09.2009)
v1.1p -- Jpope edit (05.10.2009)
]]

settings_table = {
{
-- Edit this table to customise your rings.
-- You can create more rings simply by adding more elements to settings_table.
-- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
name='time',
-- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
arg='%I.%M',
-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
max=12,
-- "bg_colour" is the colour of the base ring.
bg_colour=0xffffff,
-- "bg_alpha" is the alpha value of the base ring.
bg_alpha=0.1,
-- "fg_colour" is the colour of the indicator part of the ring.
fg_colour=0x3399cc,
-- "fg_alpha" is the alpha value of the indicator part of the ring.
fg_alpha=0.2,
-- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
x=100, y=150,
-- "radius" is the radius of the ring.
radius=0,
-- "thickness" is the thickness of the ring, centred around the radius.
thickness=5,
-- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
start_angle=0,
-- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
end_angle=360
},
{
name='cpu',
arg='cpu0',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffff00,
fg_alpha=0.4,
x=50, y=202,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
}, {
name='cpu',
arg='cpu1',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffff00,
fg_alpha=0.4,
x=110, y=202,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='cpu',
arg='cpu2',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0xffff00,
fg_alpha=0.4,
x=170, y=202,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='memperc',
arg='',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0x33ccff,
fg_alpha=0.8,
x=50, y=260,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
{
name='fs_used_perc',
arg='/',
max=100,
bg_colour=0xffffff,
bg_alpha=0.2,
fg_colour=0x3399cc,
fg_alpha=0.3,
x=110, y=260,
radius=25,
thickness=5,
start_angle=-90,
end_angle=180
},
}

require 'cairo'

function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function draw_ring(cr,t,pt)
local w,h=conky_window.width,conky_window.height

local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

local angle_0=sa*(2*math.pi/360)-math.pi/2
local angle_f=ea*(2*math.pi/360)-math.pi/2
local t_arc=t*(angle_f-angle_0)

-- Draw background ring

cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
cairo_set_line_width(cr,ring_w)
cairo_stroke(cr)

-- Draw indicator ring

cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)
end

function conky_clock_rings()
local function setup_rings(cr,pt)
local str=''
local value=0

str=string.format('${%s %s}',pt['name'],pt['arg'])
str=conky_parse(str)

value=tonumber(str)
pct=value/pt['max']

draw_ring(cr,pct,pt)
end

-- Check that Conky has been running for at least 5s

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 cr=cairo_create(cs)

local updates=conky_parse('${updates}')
update_num=tonumber(updates)

if update_num>5 then
for i in pairs(settings_table) do
setup_rings(cr,settings_table)
end
end

end
Ultima modifica di ricciare il mer 2 gen 2013, 1:21, modificato 1 volta in totale.

Avatar utente
ricciare
Linux 0.x
Linux 0.x
Messaggi: 71
Iscritto il: mer 27 feb 2008, 15:50
Nome Cognome: Nicola
Slackware: current 64bit
Kernel: 4.20.2
Desktop: fluxbox + kde4.10.5
Località: Pescia
Contatta:

Re: slackware64 14.0 - conky - cairo -lua problem

Messaggio da ricciare »

problema risolto: ho fatto un downgrade di lua installando il pacchetto versione 5.1.4 per la slackware64 13.37 e tutto e' tornato a funzionare alla perfezione. Adesso vedo di dare un'occhiata a lua 5.1.5 per slackware64 14.0, visto che era quello che creava quei problemi.

Rispondi