Conky Helps and Stuff

Message
Author
User avatar
asqwerth
Developer
Posts: 7210
Joined: Sun May 27, 2007 5:37 am

Re: Conky Helps and Stuff

#311 Post by asqwerth »

What was the screenshot showing? It was too small and blurred to see.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
smilliken
Posts: 206
Joined: Tue Feb 06, 2007 11:47 pm

Re: Conky Helps and Stuff

#312 Post by smilliken »

The files located in the ~/dexter/1_accuweather directory.
There is no "Ctrl+Z" in life!
Asus X570, Rysen 3600, 32 GB RAM MX-21
Acer 7551G MX-21 & Win 10
Asus i5, 16 GB RAM MX-21 & Win 10
Brother DCP-7065DN/HL-L3270CDW
Linux User# 4523410

User avatar
Eadwine Rose
Administrator
Posts: 11894
Joined: Wed Jul 12, 2006 2:10 am

Re: Conky Helps and Stuff

#313 Post by Eadwine Rose »

if you open a terminal in that folder and enter

Code: Select all

ls -l
You will get the content as a list.


(note those are small Ls, not 1s)
MX-23.2_x64 July 31 2023 * 6.1.0-18-amd64 ext4 Xfce 4.18.1 * 8core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 525.147.05 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
asqwerth
Developer
Posts: 7210
Joined: Sun May 27, 2007 5:37 am

Re: Conky Helps and Stuff

#314 Post by asqwerth »

The contents of the 1_accuweather directory are extracted from the bunsenlabs forum link, and it's fine to leave that whole directory as a subfolder of your main $HOME folder.

That's not where your converted old syntax conky goes, if you want Conky Manager to detect and list it. Place your conky in $HOME/.conky folder.

The 1_accuweather folder just holds the script and weather info/fonts/pictures that a conky making reference to the accuweather script will use to display the weather info.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 1:21 am

Re: Conky Helps and Stuff

#315 Post by KoO »

This just a conky shortcuts keys help file for i3 and herbstluftwm conky v1.10+ (This is very easy to edit to suit your needs)

This is the i3 config line to run the conky = exec --no-startup-id conky -c ~/.config/i3/conky_shortcuts

Image

Code: Select all

conky.config = {
	alignment = 'bottom_left',
	background = true,
	color2 = 'F9FAF9',
	cpu_avg_samples = 2,
	default_color = 'f6cb33',
	double_buffer = true,
	font = 'Bitstream Vera Sans:size=8',
	draw_shades = false,
	gap_x = 25,
	gap_y = 45,
	minimum_width = 200,
	no_buffers = true,
	own_window = true,
	own_window_type = 'override',
	own_window_transparent = true,
	update_interval = 1.0,
	use_xft = true,
}
conky.text = [[
${color2}mod = ${color}<WIN>

${color2}Terminal - ${color}mod+Enter
${color2}Rofi - ${color}mod+d
${color2}Close Program - ${color}mod+Shift+q
${color2}Change Workspace 1-8 - ${color}mod+1-8
${color2}Move Workspace to Number  1-8 - ${color}mod+Alt+1-8
${color2}Float Workspace - ${color}mod+Shift+Space
${color2}Full Screen - ${color}mod+f
${color2}Refresh i3 - ${color}mod+shift+r

${color2}ncmpcpp - ${color}mod+n
${color2}Ranger - ${color}mod+r
${color2}Spotify - ${color}mod+s
${color2}Thunar - ${color}mod+q
]] 
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

male

Re: Conky Helps and Stuff

#316 Post by male »

With this interactive Conky, the various protocols of the system are displayed on the desktop with a mouse click.
[Logs] --> Protocol list --> [Close] and back [Close] --> [Logs]
I've marked each one with a red arrow.

ImageImageImage

There is also a video of it: http://youtu.be/SQVX3sgXdnA

Necessary is:
- conky-legacy-all (syntax 1.10 does not work)
- the packages xdotool and xwininfo (are here in MX18)
- the font Anonymous Pro
- the conkyrc of Sector11
- the Lua script s11buttons.lua

Code: Select all

--[[conky interactive log messages by mrpeachy 03/12
http://youtu.be/SQVX3sgXdnA
call in conkyrc in a similar manner to this
lua_load /home/mcdowall/lua/filename.lua
lua_draw_hook_pre draw_main

in the conkyrc you also need to add this setting

own_window_title click_log

or you can set your own window title then edit towards the bottom of the script
so that any instances of click_log are replaced with the title you set
avoid spaces in title name


see interactive weather thread on crunchbang forum
link soon

]]

require 'cairo'
start=1
buttons={}
buttons[1]=0
text_table={}
--------------------------------------------------------------------------------
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)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--get click coordinates
localx,localy=clickfunction()--dont edit
--##############################################
--SETTINGS #####################################
--set message length
local tail_length=1
commands={
"dmesg",
"/var/log/alternatives.log",
"/var/log/alternatives.log.1",
"/var/log/apt/history.log",
"/var/log/apt/term.log",
"/var/log/ConsoleKit/history",
"/var/log/ConsoleKit/history.1",
"/var/log/dpkg.log",
"/var/log/dpkg.log.1",
"/var/log/fontconfig.log",
"/var/log/installer/hardware-summary",
"/var/log/installer/lsb-release",
"/var/log/nvidia-installer.log",
"/var/log/pm-powersave.log",
"/var/log/pm-powersave.log.1",
"/var/log/sgfxi/sgfxi.log.1",
"/var/log/smxi.log",
"/var/log/Xorg.0.log",
"/var/log/Xorg.1.log",
"/var/log/Xorg.2.log",
}
--setup list table
list={
"dmesg",
"alternatives.log",
"alternatives.log.1",
"apt/history.log",
"apt/term.log",
"ConsoleKit/history",
"ConsoleKit/history.1",
"dpkg.log",
"dpkg.log.1",
"fontconfig.log",
"installer/hardware-summary",
"installer/lsb-release",
"nvidia-installer.log",
"pm-powersave.log",
"pm-powersave.log.1",
"sgfxi/sgfxi.log.1",
"smxi.log",
"Xorg.0.log",
"Xorg.1.log",
"Xorg.2.log",
}
--set list font and size
local list_font="Anonymous Pro"
local list_fsize=12
--set text properties for LOG main button
local log_text="[Logs]"
local log_font="Anonymous Pro"
local log_fsize=12
--set button top left corner coordinates and width/heioght
local log_tlx=20.5
local log_tly=20.5
--need to set the top left corner of the top button in the list
local list_tlx=100.5
local list_tly=20.5
--set gap between buttons
local gap=5
--setup sections###############################
--set topl left coords and size of close button
local tlx_close=300.5
local tly_close=20.5
--set text properties for CLOSE main button
local close_text="[Close]"
local close_font="Anonymous Pro"
local close_fsize=12
--set properties for section display text
local section_font="Anonymous Pro"
local section_fsize=12
local section_blx=20.5
local section_bly=50.5
--set how many lines to show
local max_lines=60
local line_height=12
--END OF SETTINGS ########################################
--########################################################
--calculate number of entries in the above table
number_in_list=#list
--main button, button1 ###################################
--get dimensions of log text
cairo_select_font_face (cr, log_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, log_fsize)
--get font height
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,log_text,extents)
local log_height=extents.height
local log_width=extents.width
--########################################################
--calculate if click was inside box
if localx>=log_tlx and localx<=log_tlx+log_width and localy>=log_tly and localy<=log_tly+log_height and buttons[1]~=1 then
buttons[1]=1
elseif localx>=log_tlx and localx<=log_tlx+log_width and localy>=log_tly and localy<=log_tly+log_height and buttons[1]==1 then
buttons[1]=0
end
if buttons[1]==1 then
color={1,0,0,1}--set on color red
elseif buttons[1]==0 then
color={1,1,1,1}--offcolor white
end
cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
--[[draw the box for positioning purposes, you can comment out the draw commands later
cairo_set_line_width (cr,1)
cairo_rectangle (cr,tlx,tly,width,height)
cairo_stroke (cr)--]]
--write title
cairo_move_to (cr,log_tlx,log_tly+log_height)
cairo_show_text (cr,log_text)
cairo_stroke (cr)
--------------------------------------------------------------------------------------
--if the main button is clicked then all this stuff will happen
if buttons[1]==1 then 
--generate buttons
cairo_select_font_face (cr, list_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, list_fsize)
--get font height
local getheight_text="the quick brown fox jumps over the lazy dog"
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,getheight_text,extents)
list_height=extents.height--dont localize
for i=1,number_in_list do --use a for loop to generate all the buttons with a single code chunk
--###########################################################
--buttons--##################################################
--calculate width and height based on text and font and fsize
local list_text=list[i]
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,list_text,extents)
local list_width=extents.width
--###########################################################
--calculate if click is inside buttons
    if localx>=list_tlx and localx<=list_tlx+list_width and localy>=list_tly+((gap+list_height)*(i-1)) and localy<=list_tly+((gap+list_height)*(i-1))+list_height and buttons[tostring("button1_"..i)]~=1 then
    buttons[tostring("button1_"..i)]=1
    elseif localx>=list_tlx and localx<=list_tlx+list_width and localy>=list_tly+((gap+list_height)*(i-1)) and localy<=list_tly+((gap+list_height)*(i-1))+list_height and buttons[tostring("button1_"..i)]==1 then
    buttons[tostring("button1_"..i)]=0
    end
if buttons[tostring("button1_"..i)]==1 then
color={1,0,0,1}--set on color red
--also going to turn off all the other buttons
        n=i
        for i=1,number_in_list do
            if i~=n then
            buttons[tostring("button1_"..i)]=0
            end
        end
        buttons[1]=0
else--if buttons[tostring("button1_"..i)]==0 then
color={1,1,1,1}--offcolor white
end
cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
--[[draw the box for positioning purposes, you can comment out the draw commands later
cairo_set_line_width (cr,1)
cairo_rectangle (cr,tlx,tly+((gap+height)*(i-1)),width,height)
cairo_stroke (cr)--]]
--------------------------------------------------------------------------------------
--write titles
cairo_move_to (cr,list_tlx,list_tly+((gap+list_height)*(i-1))+list_height)
cairo_show_text (cr,list_text)
cairo_stroke (cr)
end--for loop
end--if main button=1
--############################################################
--activate the function
--get dimensions of close text
cairo_select_font_face (cr, close_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, close_fsize)
--get font height
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,close_text,extents)
local height_close=extents.height
local width_close=extents.width
for i=1,number_in_list do
    if buttons[tostring("button1_"..i)]==1 then
if get_text~=1 then
text_table={}
--do the thing and put it in table
if i>1 then
    local file = assert(io.open(tostring(commands[i]), "r"))
    for line in file:lines() do 
    table.insert(text_table,line)
    end
    file:close()
    get_text=1
elseif i==1 then
    local file = io.popen(tostring(commands[i]))
    for line in file:lines() do 
    table.insert(text_table,line)
    end
    file:close()
    get_text=1    
end
end
    cairo_set_source_rgba (cr,1,1,1,1)    
    cairo_select_font_face (cr, section_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, section_fsize)
    for i=1,max_lines do
    cairo_move_to (cr,section_blx,section_bly+((i-1)*line_height))
    cairo_show_text (cr,text_table[i])
    cairo_stroke (cr)    
    end
    cairo_set_source_rgba (cr,1,1,1,1)    
    cairo_select_font_face (cr, list_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, list_fsize)
    cairo_move_to (cr,list_tlx,list_tly+list_height)
    cairo_show_text (cr,list[i])
    cairo_stroke (cr)    
    --loadstring('button1_'..i..'display("'..section_font..'",'..section_fsize..','..section_blx..','..section_bly..')')()
    --close button- turns everything off back to start position
    --calculate if click was inside box
    if localx>=tlx_close and localx<=tlx_close+width_close and localy>=tly_close and localy<=tly_close+height_close and buttons[2]~=1 then
    buttons[2]=1
    elseif localx>=tlx_close and localx<=tlx_close+width_close and localy>=tly_close and localy<=tly_close+height_close and buttons[2]==1 then
    buttons[2]=0
    end
    if buttons[2]==1 then
    color={1,0,0,1}--set on color red    
            for i=1,number_in_list do
                buttons[tostring("button1_"..i)]=0
            end
            buttons[1]=0
            buttons[2]=0
            get_text=0
    else
    color={1,1,1,1}--offcolor white
    end
    cairo_set_source_rgba (cr,color[1],color[2],color[3],color[4])
    --[[draw the box for positioning purposes, you can comment out the draw commands later
    cairo_set_line_width (cr,1)
    cairo_rectangle (cr,tlx_close,tly_close,width_close,height_close)
    cairo_stroke (cr)--]]
    --write titles
    cairo_select_font_face (cr, close_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, close_fsize)
    cairo_move_to (cr,tlx_close,tly_close+height_close)
    cairo_show_text (cr,close_text)
    cairo_stroke (cr)
    end--if button =1
end--for i=
--#########################################################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end--end main function

function clickfunction()
--start click logging and calculations ##########################################
if start==1 then
xdot=conky_parse("${if_running xdotool}1${else}0${endif}")
    if tonumber(xdot)==1 then
    os.execute("/usr/bin/killall xdotool && echo 'xdo killed' &")
    end
os.execute("xdotool search --name click_log behave %@ mouse-click getmouselocation >> /tmp/xdo &")
start=nil--]]
local f = io.popen("xwininfo -name 'click_log' | grep 'Absolute'")
geometry = f:read("*a")
f:close()
geometry=string.gsub(geometry,"[\n]","")
s,f,abstlx=string.find(geometry,"X%p%s*(%d*)")
s,f,abstly=string.find(geometry,"Y%p%s*(%d*)")
end--if start=1 ######################################
--click calculations #################################
local f=io.open("/tmp/xdo")
click=f:read()
f:close()
    if click~=nil then
    local f = io.open("/tmp/xdo","w")
    f:write("")
    f:close() 
    end--if click=nil
if click==nil then click="x:0 y:0 " end
s,f,mousex=string.find(click,"x%p(%d*)%s")
s,f,mousey=string.find(click,"y%p(%d*)%s")
mousex=tonumber(mousex)
mousey=tonumber(mousey)
localx=mousex-abstlx
localy=mousey-abstly
--END CLICK CALCULATIONS #################################
return localx,localy
end--function 
Make sure that the respective protocols are also available on your system ! Otherwise the Conky will crash. 7 years ago it looked a bit different on a Linux system. ;)
Another path of these protocols is possible at two places in the lua script in the same form.

male

Re: Conky Helps and Stuff

#317 Post by male »

@asqwerth

the original files (in syntax1.10) are here
the conkyrc changed by me in the syntax1.9 is the

Code: Select all

# conky-version1.9 @male2017
    background yes
    use_xft yes
    xftfont monofur:size=10
    xftalpha 1 
    update_interval 1.0
    total_run_times 0
    own_window yes
    own_window_transparent yes
    own_window_type normal
    own_window_hints undecorated,below,skip_taskbar,skip_pager  #sticky,
    double_buffer yes
    minimum_size 800 900
#minimum_height = 900,
#maximum_width = 900,
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    default_color 48192D
    default_shade_color 000000
    default_outline_color 828282
    alignment top_left
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    net_avg_samples 1
    temperature_unit celsius
    override_utf8_locale yes
    imlib_cache_size 0
    default_color FFFFFF
    color0 FFFFFF
    color1 48192D
    color2 333333
    color3 414569
    color4 1994D1
    color5 000000
    color6 C22E14
    template9 de_DE.UTF-8
#own_window_argb_value = 0,
    own_window_argb_visual yes
#own_window_colour = '000000',
    gap_x 50
    gap_y 20
    if_up_strictness address
#pozycja_x=400,
#pozycja_y=400,
    lua_load /Conky/derivantArt/urgo/conky/.lua/urgo.lua
    lua_draw_hook_post main


TEXT
${font monofur:weight=Bold:size=90}${color4}\
${alignc}${time %H:%M}\
${font}${color}
${font Liberation Sans Narrow:weight=Bold:size=28}${color4}\
${voffset 10}\
${alignc}${execi 10 LANG=${template9} LC_TIME=${template9} date +"%A, %d. %B"}\
${font}${color}


#${color4}SYSTEM ${hr 2}
#${offset 15}$sysname $kernel
#${offset 15}$nodename
#${offset 15}Uptime: $uptime
#${offset 120}${cpugraph 40,183 666666 666666}${voffset -25}



#Battery: ${battery_percent BAT1}% ${battery_bar BAT1}
#${offset 90}ETHERNET
#${offset 15}Up: ${upspeed enp2s0} / ${totalup}
#${offset 15}${upspeedgraph enp2s0 40,285 4B1B0C FF5C2B 100 -l}
#${offset 15}Down: ${downspeed enp2s0} / ${totaldown}
#${offset 15}${downspeedgraph enp2s0 40,285 324D23 77B753 100 -l}
#${offset 15}Up: ${upspeed wlp3s0} / ${totalup}
#${offset 15}Down: ${downspeed wlp3s0} / ${totaldown}
#${color4}${hr 2}
 
Both configurations run perfectly here. You have to change the paths according to your machine.

Good luck! :happy:
Last edited by male on Thu Apr 11, 2019 6:42 am, edited 1 time in total.

User avatar
asqwerth
Developer
Posts: 7210
Joined: Sun May 27, 2007 5:37 am

Re: Conky Helps and Stuff

#318 Post by asqwerth »

male wrote: Thu Apr 11, 2019 5:51 am @asqwerth

the original files (in syntax1.10) are here
the conkyrc changed by me in the syntax1.9 is the .......

Both configurations run perfectly here. You have to change the paths according to your machine.

Good luck! :happy:
Thank you!
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
asqwerth
Developer
Posts: 7210
Joined: Sun May 27, 2007 5:37 am

Re: Conky Helps and Stuff

#319 Post by asqwerth »

male wrote: Thu Apr 11, 2019 5:51 am @asqwerth

the original files (in syntax1.10) are here
the conkyrc changed by me in the syntax1.9 is the...

[snip]

Both configurations run perfectly here. You have to change the paths according to your machine.

Good luck! :happy:
Finally got down to trying this, but got this error message:

Code: Select all

conky
conky: Syntax error (/home/testmx15/.conkyrc:2: '=' expected near 'yes') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.
conky: desktop window (c00003) is subwindow of root window (d6)
conky: window type - normal
conky: drawing to created window (0x4c00002)
conky: drawing to double buffer
conky: forked to background, pid is 11094
 testmx15  ~  

conky: obj->data.i 1 info.cpu_count 0
conky: attempting to use more CPUs than you have!
I tested your mod and the original 1.10 syntax version from deviantart. Both give the same error message.

SInce the conky itself is straightforward, I'm guessing that the issue is in the lua script, which I am unfamiliar with. What parts do I change?

I note that the lua script references both a cpu0 and cpu1. That doesn't seem like too many cores, since my PC has a Intel Haswell CPU, which is 2 or 4 cores.

And inxi -F says my CPU is

Code: Select all

CPU:
  Topology: Quad Core model: Intel Core i5-4460 bits: 64 type: MCP 
  L2 cache: 6144 KiB 
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

male

Re: Conky Helps and Stuff

#320 Post by male »

The required information for your computer you're investigating:

Code: Select all

sensors
and

Code: Select all

ls -l /sys/class/hwmon

my changed lines in the lua-Script:
389

Code: Select all

        cairo_show_text (cr,"cpu0: "..conky_parse("${cpu cpu0}").."%, "..conky_parse("${freq_g cpu0}").."Ghz, "..conky_parse("${hwmon 2 temp 2}").."°C")
398

Code: Select all

        cairo_show_text (cr,"cpu1: "..conky_parse("${cpu cpu1}").."%, "..conky_parse("${freq_g cpu1}").."Ghz, "..conky_parse("${hwmon 2 temp 4}").."°C")

So you only give two cores to. Of course you can also specify all 5 cores, but then you have to configure the remaining three in the Lua script.

Post Reply

Return to “Software / Configuration”