Conky Basic

Conky

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

1
Score 58.0%
Description:

Conky Basic displays only the most basic information about your system.
In the lua file you can change the color scheme used by Conky Basic, show all CPU cores or not and set a battery alert level.
You can also choose what to display, only CPU, storage, memory , details about storage etc..

Thanks to autocrosser1 and soundrolf for their ideas and code contributions

When using a laptop don't forget to set the show_battery option to yes.

If you modified Conky Basic make a backup of your files first before installing this version !!!

Installation
- unpack source file
- copy the file .conkybasic to your home directory
- copy the file .conkybasic_c110 to your home directory
- copy the basic folder into ~/.lua
- install the Unique font in ~/.lua/basic

Start conky via 'conky -c .conkybasic -q'
If you are using Conky version 1.10.0 start conky via 'conky -c .conkybasic_c110 -q'

Keep in mind that Conky 1.10.0 uses a new configuration file format and is still work in progress. That's why I used some work-arounds to get things working, so your mileage may vary.
Last changelog:

Version 1.6 1 year ago

- Changed network and battery detection

soundrolf

2 years ago

Hi Moob,
back again

Nice work

Report

C

Moob

2 years ago

Thanks soudrolf.

Report

soundrolf

3 years ago

A friend of me loves to have audacious tab with Title, Artist, Bitrate, Track Length and Album inside the tab.
So I made one for him. Here it is. If you like it, put it in your code.
The name of title and album sometimes too long, so I put in center.

-- parameters idem conky_wired_tab_music
-- Title + Album set to center, because some titles and album names are too long to fit
function conky_wired_tab_music(x,y,width,height,text,font,font_size,r,g,b)
local vuheight=15 --VU barheight
local onebarheight=vuheight+8
local basey=y
local barfs=12 -- VU bar fontsize

if height <= 60 then
print("ERROR conky_wired_tab_music: insufficient height. Must be higher than 60")
return
end

local aspect=math.floor(height/60)
local corner_radius = height / 10.0
local radius = corner_radius / aspect
local degrees = math.pi / 180.0

-- draw text
conky_lctexta(x+width,y+15,text,font,font_size,r,g,b)
-- draw tab
cairo_new_sub_path (cr)
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
cairo_set_source_rgba (cr, r,g,b,.6)
cairo_set_line_width (cr, 2)
cairo_stroke (cr)

local running=conky_parse("${exec pidof -x audacious}")
if string.len(running) == 0 then
local timer=conky_parse("${time %H}:${time %M}")
conky_lctextc(x,y+(height/2)+9,width,timer,"Zekton",40,r,g,b)
conky_lctext(x+20,y+73,conky_parse("${time %A %e %b %Y}"),font,font_size+1,r,g,b)
else

local title = conky_parse("${pre_exec audtool --current-song-tuple-data title}")
local artist = conky_parse("${pre_exec audtool --current-song-tuple-data artist}")
local album = conky_parse("${pre_exec audtool --current-song-tuple-data album}")
local track_length = conky_parse("${pre_exec audtool --current-song-length}")
local bitrate = conky_parse("${pre_exec audtool --current-song-bitrate-kbps}")
conky_lctext(x+6,y+20,"Title","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctextc(x,y+32,width,title,font,font_size,r,g,b)
conky_lctext(x+6,y+44,"Artist","Arial",10,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+44,artist,font,font_size,r,g,b)
conky_lctext(x+6,y+56,"Bitrate","Arial",10,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+120,y+56,bitrate,font,font_size,r,g,b)
conky_lctexta(x+150,y+56,"KB/s","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+68,"Track Length","Arial",10,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+68,track_length,font,font_size,r,g,b)
conky_lctext(x+6,y+80,"Album","Arial",10,themes.tred,themes.tgreen,themes.tblue)
conky_lctextc(x,y+92,width,album,font,10,r,g,b)

end
return (x+width),(y+height)

end -- conky_wired_tab_music

Enjoy

Report

C

Moob

3 years ago

Nice work soundrolf. I will see if I can integrate this in Conky Basic.

Report

soundrolf

3 years ago

Thank you. It's just a suggestion

There is a small problem either in radiotray and my newly made audacious tab. If a song or artist or album name is too long, it does not fit into tab.
Is there a way to make it scrollable if the string is longer then the width of the tab. To fold it I think is not a good idea, because not enough lines inside tab. I thinking about your system line inside Radio Tray.
This conky makes fun to work on it.

Report

C

Moob

3 years ago

[Is there a way to make it scrollable ..]
You indeed could use conky_wired_scroller for this. This function uses separate global variables (info.scrollcounter,info.scrollcounterstart,info.scrolltextlength) to keep track of the scrolling. Which actually only moves the contents of a text buffer around and then displays it. Because system info already uses this function I don't know if this will work when scrolling other text. That needs to be tested. But you could create a second scroller function with separate variables if it does not work.

[This conky makes fun to work on it.]
Thanks for the complement. I don't like going through lots of code just to change some setting. That is why I made it the way it is, and its fun to do. Its always a challenge to create clear understandable code which makes extending it by others easier.

As for extra Audacious information. I already have a test running with a separate user preference where one can choose to display it or not. Still in testing mode though :)

Report

soundrolf

3 years ago

Finally I made it.

If a artist name and / or a song name is longer than 23 characters, then the artist name and / or the song name will scroll. I made new functions to implement this.

Here is the code
end -- end conky_wired_system_information -- system_information end --

-- parameters idem conky_wired_audacious_title -- audacious_title start --
function conky_wired_audacious_title()
local title=""..conky_parse("${pre_exec audtool --current-song-tuple-data title}")

local retval=title..", "..title..", "..title..", "..title

return string.gsub(retval,"%c","")

end -- end conky_wired_audacious_title -- audacious_title end --

-- parameters idem conky_wired_audacious_artist -- audacious_artist start --
function conky_wired_audacious_artist()
local artist=""..conky_parse("${pre_exec audtool --current-song-tuple-data artist}")

local retval=artist..", "..artist..", "..artist..", "..artist

return string.gsub(retval,"%c","")

end -- end conky_wired_audacious_artist -- audacious_artist end --


-- scrolls text by changing the text buffer
-- parameters: width - width of the graphical tab container
-- text - text to scroll
-- font - font to use
-- fontsize - font size to use
-- Returns: the scrolled part of the text

-- parameters idem conky_wired_tab_scoller -- scroller start --

The show starts

if show_audacious_extented == "no" then
conky_lctext(x+6,y+30,"Station","Arial",11,r,g,b)
station=string.gsub(station,"%p","")
conky_lctextc(x,y+43,width,station,font,font_size,r,g,b)
conky_lctext(x+6,y+57,"Artist & Song","Arial",11,r,g,b)
song=string.gsub(song,"%c","")
--conky_lctextc(x,y+72,width,artist,font,font_size,r,g,b)
if string.len(artist) < 23 then
conky_lctextc(x,y+72,width,artist,font,font_size,r,g,b)
else
local info=conky_wired_audacious_artist()
local artist=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+72,width,artist,font,font_size,r,g,b)
end
if string.len(song) < 23 then
conky_lctextc(x,y+87,width,song,font,font_size,r,g,b)
else
local info=conky_wired_audacious_title()
local title=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+87,width,title,font,font_size,r,g,b)
end
end
end
-- restore original, remove clipping region
cairo_restore(cr)
-- conky_wired_audacious_title()
return (x+width),(y+height)

end -- conky_wired_tab_radiotray -- radiotray end --


It works like perfect.


Report

C

Moob

3 years ago

..and I also put the scroller into the lctextc function. So if the text is more then the tab width, it starts to scroll it.

Report

soundrolf

3 years ago

Understood

15-11-2015

added functions for radiotray and audacious
to make scrollable name of artist and song
in radiotray, as well name of title, artist
and song in audacious if they are longer
than the tab width or the left space.

functions:

end -- end conky_wired_system_information

-- audacious section -- get information for title, artist and album
-- parameters idem conky_wired_audacious_title -- get title name for scrolling if too long
function conky_wired_audacious_title()
local title=""..conky_parse("${pre_exec audtool --current-song-tuple-data title}")

local retval=title..", "..title..", "..title..", "..title

return string.gsub(retval,"%c","")

end -- end conky_wired_audacious_title

-- parameters idem conky_wired_audacious_artist -- get artist name for scrolling if too long
function conky_wired_audacious_artist()
local artist=""..conky_parse("${pre_exec audtool --current-song-tuple-data artist}")

local retval=artist..", "..artist..", "..artist..", "..artist

return string.gsub(retval,"%c","")

end -- end conky_wired_audacious_artist

-- parameters idem conky_wired_audacious_album -- get album name for scrolling if too long
function conky_wired_audacious_album()
local album=""..conky_parse("${pre_exec audtool --current-song-tuple-data album}")

local retval=album..", "..album..", "..album..", "..album

return string.gsub(retval,"%c","")

end -- end conky_wired_audacious_album
-- end audacious section --

-- radiotray section -- get information for artist and song
-- parameters idem conky_wired_radiotray_song -- get song name for scrolling if too long
function conky_wired_radiotray_song()
local playing = conky_parse("${execi 3 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w 50}")
local i,j=string.find(playing,"-")
if i ~= nil and j ~= nil then
artist = string.sub(playing,1,j-1)
song = string.sub(playing,j+1,string.len(playing))
end

local retval=song..", "..song..", "..song..", "..song

return string.gsub(retval,"%c","")

end -- end conky_wired_radiotray_song

-- parameters idem conky_wired_radiotray_artist -- get artist name for scrolling if too long
function conky_wired_radiotray_artist()
local station = conky_parse("${execi 3 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}")
local i,j=string.find(station,"not playing")
if i == nil and j == nil then
local playing = conky_parse("${execi 3 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w 50}")
local i,j=string.find(playing,"-")
if i ~= nil and j ~= nil then
artist = string.sub(playing,1,j-1)
song = string.sub(playing,j+1,string.len(playing))
end
end

local retval=artist..", "..artist..", "..artist..", "..artist

return string.gsub(retval,"%c","")

end -- end conky_wired_radiotray_artist
-- end radiotray section --

radiotray:

-- function radiotray displays output from the Radio Tray and Audacious programs.

--[[ in this function I made some changes. No rhythmbox. Just radiotray and audacious. If both not playing,
show clock. In radiotray: if name of artist or song is longer than 23 characters then name of artist or
name of song will scrolled. If choosing show_audacious_extented == "yes" then display audacious data,
and show scrolled title, artist and album if they are too long.
If choosing show_audacious_extented == "no" then display audacious data like radiotray version.
]]--

-- parameters idem conky_wired_tab_radiotray
function conky_wired_tab_radiotray(x,y,width,height,text,font,font_size,r,g,b)
if height <= 60 then
print("ERROR conky_wired_tab_radiotray: insufficient height. Must be higher than 60")
return
end

local aspect=math.floor(height/60)
local corner_radius = height / 10.0
local radius = corner_radius / aspect
local degrees = math.pi / 180.0
local station,player,running,song,artist ="","","","",""
local i,im,j,jm=0,0,0,0


-- check if there is a radiotray process
running=conky_parse("${exec pidof -x radiotray}")
player ="Radiotray"
-- no radiotray, check for a rhythmbox process
if string.len(running) == 0 then
running=conky_parse("${exec pidof -x audacious}")
if string.len(running) > 0 then
player = "Audacious"
else
text=""
end
end

-- save original context before using clipping
cairo_save(cr)

-- draw text
conky_lctexta(x+width,y+15,text,font,font_size,r,g,b)
-- draw tab contours
cairo_new_sub_path (cr)
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
cairo_set_source_rgba (cr, r,g,b,.6)
cairo_set_line_width (cr, 2)
cairo_stroke (cr)

-- setup clipping region
cairo_rectangle(cr,x+2,y+2,width-4,height-4)
-- activate clipping so everything that falls outside the clipping region will have no text overflow visible
cairo_clip(cr)

-- if nothing, show clock with or without system information
if string.len(running) == 0 then
local timer=conky_parse("${time %H}:${time %M}") -- get time
conky_lctextc(x,y+(height/2)+9,width,timer,"Zekton",40,r,g,b) -- show clock
if show_system_information == "yes" then
local info=conky_wired_system_information()
local st=conky_wired_scroller(width, info, font, font_size+1,4)
conky_lctext(x+5,y+92,st,font,font_size+1,r,g,b)
end
local timing=conky_parse("${time %A} ${time %e} ${time %b} ${time %Y}")
conky_lctextc(x,y+(height/2)+28,width,timing,font,font_size+1,r,g,b)
else
if player == "Radiotray" then
station = conky_parse("${execi 3 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}")
local i,j=string.find(station,"not playing")
if i == nil and j == nil then
local playing = conky_parse("${execi 3 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w 50}")
local i,j=string.find(playing,"-")
if i ~= nil and j ~= nil then
artist = string.sub(playing,1,j-1)
song = string.sub(playing,j+1,string.len(playing))
end
end
end
-- must put it here, to see radiotray data
if show_audacious_extented == "yes" and player == "Radiotray" then
conky_lctext(x+5,y+30,"Station",font,font_size,r,g,b)
station=string.gsub(station,"%p","")
conky_lctextc(x,y+43,width,station,font,font_size,r,g,b)
conky_lctext(x+5,y+57,"Artist & Song",font,font_size,r,g,b)
if string.len(song) < 23 then
conky_lctextc(x,y+87,width,song,font,font_size,r,g,b)
else
local info=conky_wired_radiotray_song()
local title=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+87,width,title,font,font_size,r,g,b)
end
if string.len(artist) < 23 then
conky_lctextc(x,y+72,width,artist,font,font_size,r,g,b)
else
local info=conky_wired_radiotray_artist()
local artist=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+72,width,artist,font,font_size,r,g,b)
end
end
if player == "Audacious" then
station = ""
local playing3 = conky_parse("${execi 3 qdbus org.mpris.MediaPlayer2.audacious /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata}")
-- if metadata output present
if string.len(playing3) ~= 0 then
-- replace newline with *
playing3=string.gsub(playing3,"%c","*")
i,j=string.find(playing3,"http")
if i ~= nil or j ~= nil then
--internet station
im,jm=string.find(playing3,"artist")
if im ~= nil and jm ~= nil then
i,j=string.find(playing3,"*",jm+2)
station = string.sub(playing3,jm+2,j-1)
end
im,jm=string.find(playing3,"title")
if im ~= nil and jm ~= nil then
i,j=string.find(playing3,"*",jm+2)
local tmp = string.sub(playing3,jm+2,i-1)
i,j = string.find(tmp,"-")
if i ~= nil then
artist = string.sub(tmp,1,i-1)
song = string.sub(tmp,j+1,string.len(tmp))
else
station=tmp
artist="No information"
song="available"
end
end
end
i,j=string.find(playing3,"file")
if i ~= nil or j ~= nil then
--local music
station = "Local music library"
im,jm=string.find(playing3,"artist")
if im ~= nil and jm ~= nil then
i,j=string.find(playing3,"*",jm+2)
artist=string.sub(playing3,jm+2,i-1)
end
im,jm=string.find(playing3,"title")
if im ~= nil and jm ~= nil then
i,j=string.find(playing3,"*",jm+2)
song=string.sub(playing3,jm+2,i-1)
end
end

end
-- audacious information
if show_audacious_extented == "yes" and player == "Audacious" then
local title,artist,album,track_length,bitrate="","","","",""
if info.conkyversiondetection == "1.10" then
title = conky_ownpreexec("audtool --current-song-tuple-data title")
artist = conky_ownpreexec("audtool --current-song-tuple-data artist")
album = conky_ownpreexec("audtool --current-song-tuple-data album")
track_length = conky_ownpreexec("audtool --current-song-length")
bitrate = conky_ownpreexec("audtool --current-song-bitrate-kbps")
end
if info.conkyversiondetection == "1.9" then
title = conky_parse("${pre_exec audtool --current-song-tuple-data title}")
artist = conky_parse("${pre_exec audtool --current-song-tuple-data artist}")
album = conky_parse("${pre_exec audtool --current-song-tuple-data album}")
track_length = conky_parse("${pre_exec audtool --current-song-length}")
bitrate = conky_parse("${pre_exec audtool --current-song-bitrate-kbps}")
end
title = string.gsub(title,"%c","")
artist = string.gsub(artist,"%c","")
album = string.gsub(album,"%c","")
bitrate = string.gsub(bitrate,"%c","")
track_length = string.gsub(track_length,"%c","")

conky_lctext(x+6,y+20,"Title",font,11,themes.tred,themes.tgreen,themes.tblue)
if string.len(title) < 23 then
conky_lctextc(x,y+32,width,title,font,font_size,r,g,b)
else
local info=conky_wired_audacious_title()
local ti=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+32,width,ti,font,font_size,r,g,b)
end
conky_lctext(x+6,y+44,"Artist",font,10,themes.tred,themes.tgreen,themes.tblue)
if string.len(artist) < 15 then
conky_lctexta(x+150,y+44,artist,font,font_size,r,g,b)
else
local info=conky_wired_audacious_artist()
local ar=conky_wired_scroller(width, info, font, font_size+1)
conky_lctext(x+42,y+44,ar,font,font_size,r,g,b)
end
conky_lctext(x+6,y+56,"Bitrate",font,10,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+120,y+56,bitrate,font,font_size,r,g,b)
conky_lctexta(x+150,y+56,"KB/s",font,11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+68,"Track Length",font,10,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+68,track_length,font,font_size,r,g,b)
conky_lctext(x+6,y+80,"Album",font,10,themes.tred,themes.tgreen,themes.tblue)
if string.len(album) < 23 then
conky_lctextc(x,y+92,width,album,font,10,r,g,b)
else
local info=conky_wired_audacious_album()
local al=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+92,width,al,font,font_size,r,g,b)
end
end
end
-- if show_audacious_extented status is no, show audacious data in radiotray style
if show_audacious_extented == "no" then
conky_lctext(x+5,y+30,"Station",font,font_size,r,g,b)
station=string.gsub(station,"%p","")
conky_lctextc(x,y+43,width,station,font,font_size,r,g,b)
conky_lctext(x+5,y+57,"Artist & Song",font,font_size,r,g,b)
song=string.gsub(song,"%c","")
if string.len(song) < 23 then
conky_lctextc(x,y+87,width,song,font,font_size,r,g,b)
else
local info=conky_wired_radiotray_song()
local title=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+87,width,title,font,font_size,r,g,b)
end
if string.len(artist) < 23 then
conky_lctextc(x,y+72,width,artist,font,font_size,r,g,b)
else
local info=conky_wired_radiotray_artist()
local artist=conky_wired_scroller(width, info, font, font_size+1)
conky_lctextc(x,y+72,width,artist,font,font_size,r,g,b)
end
end
end
-- restore original, remove clipping region
cairo_restore(cr)

return (x+width),(y+height)

end -- conky_wired_tab_radiotray


It works very good

Report

C

Moob

3 years ago

Glad to hear it works :)

In the new version I changed the scroller. Now it continuously scrolls and I added a step parameter so you can enter the number of characters to scroll.

If you want to use it, just copy the new scroller function in your code.

Report

soundrolf

3 years ago

Looks better and better.

can you do it with audacious like rhythmbox ?

Report

C

Moob

3 years ago

Hi soundrolf, Audacious detection is added.

Report

soundrolf

3 years ago

Thank you very much to implement audacious.

I prefer audacious instead of rhythmbox.
So I removed rhythmbox out of my script.

I made a new processes tab without bars for my laptop. The screen is not as big as my desktop monitor. Users can choose which processes tab they want.

-- for smaller screen size on laptops
-- without bars
-- parameters idem conky_wired_tab_cpu_proc
function conky_wired_tab_cpu_proc(x,y,width,height,text,font,font_size,r,g,b)
local vuheight=15 --VU barheight
local onebarheight=vuheight+8
local basey=y
local barfs=12 -- VU bar fontsize

if height <= 60 then
print("ERROR conky_wired_tab_cpu_proc: insufficient height. Must be higher than 60")
return
end

local aspect=math.floor(height/60)
local corner_radius = height / 10.0
local radius = corner_radius / aspect
local degrees = math.pi / 180.0

-- draw text
conky_lctexta(x+width,y+15,text,font,font_size,r,g,b)
-- draw tab
cairo_new_sub_path (cr)
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
cairo_set_source_rgba (cr, r,g,b,.6)
cairo_set_line_width (cr, 2)
cairo_stroke (cr)

conky_lctext(x+6,y+onebarheight+8,conky_parse("${top name 1}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+onebarheight+8,conky_parse("${top cpu 1}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+44,conky_parse("${top name 2}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+44,conky_parse("${top cpu 2}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+56,conky_parse("${top name 3}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+56,conky_parse("${top cpu 3}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+68,conky_parse("${top name 4}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+68,conky_parse("${top cpu 4}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+80,conky_parse("${top name 5}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+80,conky_parse("${top cpu 5}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)

return (x+width),(y+height)

end -- conky_wired_tab_cpu_proc

Report

C

Moob

3 years ago

I will check if audacious can be added.

Report

autocrosser1

3 years ago

Looks Great---Now, I'm going to work the bars into some of my circle conkeys---will post maybe today....

What do you think of my formatting for the conkyrc & .lua?

Report

C

Moob

3 years ago

[bars into some of my circle conkeys] You mean like circulair VU bars of some sort ? That would be nice :)

I was testing your System Bar on a virtual Ubuntu with 2 CPU's and it first failed as it was gathering info on 4 CPU's. So I uncommented the auto CPU detection. I you want to the user be able to limit the number of CPU's shown I would suggest to make a user preference of it. Like you did with the CPU/GPU temperature and netinfo tabs.

The purple theme does not seem to work. You need to add a themes.purple={.627,.321,.176} with the wanted colour schemes. Then it will work fine.

Keep on the good work :)

Report

autocrosser1

3 years ago

Really like the processes tab--works much better than the one I made :) I have done several changes/edits on the tabs & have a question--In the Mem tab, I removed the swap bar (I have 12G useable--so have never touched swap) & added a pair of temperature lines (my nvidia cards)--temp is read correctly, but I would like to replace the % with C...

I also expanded on the network tab to include a used ports section...

The 2 tabs look like this right now:

-- parameters idem conky_wired_tab_mem
function conky_wired_tab_mem(x,y,width,height,text,font,font_size,r,g,b)
local vuheight=15 --VU barheight
local onebarheight=vuheight+8
local basey=y
local barfs=12 -- VU bar fontsize

if height <= 60 then
print("ERROR conky_wired_tab_mem: insufficient height. Must be higher than 60")
return
end

local aspect=math.floor(height/60)
local corner_radius = height / 10.0
local radius = corner_radius / aspect
local degrees = math.pi / 180.0

-- draw text
conky_lctexta(x+width,y+15,text,font,font_size,r,g,b)
-- draw tab
cairo_new_sub_path (cr)
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
cairo_set_source_rgba (cr, r,g,b,.6)
cairo_set_line_width (cr, 2)
cairo_stroke (cr)

conky_wired_bar(x+6,y+onebarheight,vuheight,"Ram","Arial",barfs,tonumber(conky_parse("${memperc}")))
-- conky_wired_bar(x+6,y+(2*onebarheight)+barfs,vuheight,"Swap","Arial",barfs,tonumber(conky_parse("${swapperc}")))
conky_wired_bar(x+6,y+(2*onebarheight)+barfs,vuheight,"GPU1","Arial",barfs,tonumber(conky_parse("${exec nvidia-settings -t -q [gpu:0]/GPUCoreTemp}")))
conky_wired_bar(x+6,y+(3.7*onebarheight)+barfs,vuheight,"GPU2","Arial",barfs,tonumber(conky_parse("${exec nvidia-settings -t -q [gpu:1]/GPUCoreTemp}")))

return (x+width),(y+height)

end -- conky_wired_tab_mem

-- parameters idem conky_wired_tab_network
function conky_wired_tab_network(x,y,width,height,text,font,font_size,r,g,b)
local vuheight=15 --VU barheight
local onebarheight=vuheight+8
local basey=y
local barfs=12 -- VU bar fontsize

if height <= 60 then
print("ERROR conky_wired_tab_network: insufficient height. Must be higher than 60")
return
end

local aspect=math.floor(height/60)
local corner_radius = height / 10.0
local radius = corner_radius / aspect
local degrees = math.pi / 180.0

-- draw text
conky_lctexta(x+width,y+15,text,font,font_size,r,g,b)
-- draw tab
cairo_new_sub_path (cr)
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
cairo_set_source_rgba (cr, r,g,b,.6)
cairo_set_line_width (cr, 2)
cairo_stroke (cr)

conky_lctext(x+6,y+onebarheight+8,"Upload ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+onebarheight+8,conky_parse("${upspeed "..info.iface.."}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+44,"Download ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+44,conky_parse("${downspeed "..info.iface.."}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+66,"Data Out ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+66,conky_parse("${totalup "..info.iface.."}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+78,"Data In ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+78,conky_parse("${totaldown "..info.iface.."}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+100,"LAN: ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+114,"Open Ports: ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+114,conky_parse("${tcp_portmon 1 65535 count}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+126,"Public IP: ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+126,conky_parse("${execi 60 wget -O - -q icanhazip.com}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+138,"Lan IP: ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+138,conky_parse("${addr eth2}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+160,"NET: ","Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+160,conky_parse("${tcp_portmon 1 65535 rip 0}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+172,conky_parse("${tcp_portmon 1 65535 rip 1}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+184,conky_parse("${tcp_portmon 1 65535 rip 2}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+196,conky_parse("${tcp_portmon 1 65535 rip 3}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+208,conky_parse("${tcp_portmon 1 65535 rip 4}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+220,conky_parse("${tcp_portmon 1 65535 rip 5}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+232,conky_parse("${tcp_portmon 1 65535 rip 6}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+150,y+244,conky_parse("${tcp_portmon 1 65535 rip 7}"),"Arial",11,themes.tred,themes.tgreen,themes.tblue)

return (x+width),(y+height)

end -- conky_wired_tab_network


Ideas or comments?

Report

C

Moob

3 years ago

Thanks :)

Well, I tried to make it as generic as possible that's why the swap is in it. Some will use it and some won't. I have 8GB internal memory but no swap use although my swap is activated.

As for the % and C values. The easiest way to go is to create a copy of conky_wired_bar and name it conky_wired_bar_temp and change the % sign to a C sign. Another option would be to extend conky_wired_bar with an extra parameter like in ' type' which could be a ' %' or a 'C'. The disadvantage is that you need to alter every wired_bar reference in the code.

I like your port tab. In a new conky layout I am working on I want to integrate this also. Insteadoff all single lines you could use a for loop.
This is the code I use:
local sessions = tonumber(conky_parse('${tcp_portmon 1025 65535 count}'))
local maxrows,step = 19,0
local remoteip,remoteaddrr = "",""
local maxstrlen = 48

-- start with the last session, not the first
for i=sessions,(sessions-maxrows),-1 do
if i < 0 then
break
end
remoteip=conky_parse('${tcp_portmon 1025 65535 rip '..i..'}')
remoteaddrr=conky_parse('${tcp_portmon 1025 65535 rhost '..i..'}')
local lgt = string.len(remoteaddrr)
-- fqdn longer then width, shorten it
if lgt > maxstrlen then
local strdiff = lgt - maxstrlen
remoteaddrr = "..."..string.sub(remoteaddrr,strdiff,-1)
end
-- no fqdn, use ip
if lgt == 0 then
remoteaddrr=remoteip
end
conky_lctext(x+10,y+5+(step*font_size),remoteaddrr,font,font_size,1,1,1)
step=step+1
end

Report

autocrosser1

3 years ago

Did the copy/mod for "C"--works/looks good, just added another tab for memory & did the gpu temps by themselves. Started playing with your portmon stuff...like where it is going. I'll have a mod worked up in the next day or so....

Created a quick System Info tab---just basic info:

-- parameters idem conky_wired_tab_system
function conky_wired_tab_system(x,y,width,height,text,font,font_size,r,g,b)
local vuheight=15 --VU barheight
local onebarheight=vuheight+8
local basey=y
local barfs=12 -- VU bar fontsize

if height <= 60 then
print("ERROR conky_wired_tab_network: insufficient height. Must be higher than 60")
return
end

local aspect=math.floor(height/60)
local corner_radius = height / 10.0
local radius = corner_radius / aspect
local degrees = math.pi / 180.0

-- draw text
conky_lctexta(x+width,y+15,text,font,font_size,r,g,b)
-- draw tab
cairo_new_sub_path (cr)
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
cairo_close_path (cr)
cairo_set_source_rgba (cr, r,g,b,.6)
cairo_set_line_width (cr, 2)
cairo_stroke (cr)

conky_lctext(x+6,y+onebarheight+8,conky_parse("${exec cat /etc/issue.net}"),"Arial",9,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+44,conky_parse("${execi 1000 cat /proc/cpuinfo|grep 'model name'|sed -e 's/model name.*: //'| uniq | cut -c 1-28}"),"Arial",9,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+56,"CPU Speed:","Arial",9,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+95,y+56,conky_parse("${freq_g 1}"),"Arial",9,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+90,y+56,"GHZ","Arial",9,themes.tred,themes.tgreen,themes.tblue)
conky_lctext(x+6,y+68,"Kernel:","Arial",9,themes.tred,themes.tgreen,themes.tblue)
conky_lctexta(x+120,y+68,conky_parse("$kernel"),"Arial",9,themes.tred,themes.tgreen,themes.tblue)

return (x+width),(y+height)

end -- conky_wired_tab_system

Report

autocrosser1

3 years ago

Thanks :)

Glad you liked the idea--of course use what you want...I'll play with the temp mods this weekend & post when done..Do like sharing code & ideas...helps everyone code better....

I look forward to your new Conky & playing with this one has given me a couple of ideas for new ones also. I'm liking the new format & I really needed to brush up/learn new skills/play with ideas right now--my day job is a real bore & I needed a couple of pushes to get back to my Linux system admin studies.....

Report

soundrolf

3 years ago

Excellent excellent great

Thank you very much

stunning conky

Report

C

Moob

3 years ago

Thanks, hope you enjoy ConkyBasic :)

Report

autocrosser1

3 years ago

In Gnome3 you need to add:

own_window_argb_visual = true,

in the conky prefs to make the display refresh correctly.

Report

soundrolf

3 years ago

is it possible to bring into this lua script radiotray for conky

radiotray conky:
${execi 3 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}
------------------------------------------
${execi 3 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30}
This works in conky

Thanks

Report

soundrolf

3 years ago

Thanks to implement Radio Tray tab
Thanks to implement Process tab

Added clock instead, if Radio Tray is not started

-- if not, tell the user
-- if not, show clock
if string.len(running) == 0 then
local timer=conky_parse("${time %H} : ${time %M}")
conky_lctextc(x,y+(height/2),width,timer,"Arial",32,r,g,b)
-- original conky_lctextc(x,y+(height/2),width,"Not active",font,12,r,g,b)
else

Must change battery device to /sys/class/power_supply/C1BC instead of
/proc/battery/BAT0 for my HP Compaq nc 6320 Notebook, Xubuntu-14.04.3 LTS

To me its the best conky

Report

Version 1.6 1 year ago

- Changed network and battery detection

Changelog 1.5 1 year ago

v 1.5 Added network interface display. Rearranged high CPU temperature check
v 1.4 IP address fix, distribution name fix, some minor fixes.
v 1.3 Changed disk detection so CD/DVD devices are also shown correctly

Version 1.2 2 years ago

Changed CPU high temperature limit detection

Changelog v1.1 2 years ago

Added check for eth1 and wlan1
Changed own_prexec function to prevent running out of file handles
Limit displayed diskname to 15 characters

Changelog v 1.0
Added system CPU speed and temperature details
Added disk details
Added network details

3 years ago

Version 0.9
Changed text scroller
Changed system information
Added Audacious extended information

Version 0.8.1
Added Audacious detection in Radiotray

Version 0.8
Added LAN text to fixed network
Changed Radiotray text
Added clock to radiotray when not active
Added system information to the radiotray. This is visible when not listening to music
Added user preference for showing system information or not.
Added user preference for the maximum number of processes to show
Added rhythmbox detection in Radiotray
Changed text_buffer_size to 512 in .conkyrc to accommodate Rhythmbox metadata
Added extra battery location
Minor cosmetic changes

Version 0.7
Added process tab

Version 0.6
Moved Conky 1.10.0 CPU workaround from configuration file to lua file
Change / detection as it also displayed /home as / instead of home
Minor cosmetic changes
Added Radio Tray tab as per request by soundrolf

Version 0.5.1
Change CPU display code. Should work fine in Conky 1.10 now, with a work-around in the conkybasic_c110 file

Version 0.4
Minor change in CPU detect function
Corrected display for only 1 CPU present
Changed CPU value pass-through to other functions
Tested with conky 1.10.0
Add conky version detection and 1.10.0 workarounds

Version 0.3
Major code overhaul. Every tab now has it's own function
Added disklabel length check
Changed battery display
Changed CPU detection from 'core id' to 'processor'. Core i7 processors should be correctly shown now.

Version 0.1 new

12345678910
1
product-maker soundrolf Nov 10 2015 9 excellent
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
Version 1.6
updated Sep 11 2017
added Oct 24 2015
downloads today
1
page views today 10