Conky configuration and usage: discussion

Moderator: Forum moderators

Post Reply
User avatar
stemsee
Posts: 656
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 0
Has thanked: 160 times
Been thanked: 104 times
Contact:

Conky configuration and usage: discussion

Post by stemsee »

This thread is for conky configurations and usage.

I'm just starting to look into using conky and it's options. I had coded a conky message displayer, which had also primitive text formatting, line wrapping according to character size....it's in the old forum somewhere. However that's superseded by the conky ticker used in dogRadio v2 by fredx181. So I can send any text or images to the conky ticker, and it scrolls the text. So i wanted to use the ticker to occupy an entire display which is my second monitor. So I can display email text, ebooks, translations etc. To use the second display I found adding xinerama_head = 1 to the conky config did the trick. Along with minimum_size 1040 1040
maximum_width 1910
on my 1920 x 1080 monitor

font size set to 144

This is my edited conkyrc-radio config

Code: Select all

#oldconky
ximerama_head = 1
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_hints undecorated,above,skip_taskbar
background yes

# 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 0.1

# Minimum size of text area
minimum_size 1040 1040
maximum_width 1910
#maximum_heaight 1080
# Draw shades?
draw_shades yes

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

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

# Stippled borders?
#stippled_borders 8

# border margins
#border_margin 4

# border width.
border_width 1

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

own_window_colour EBFF00
own_window_transparent no
own_window_type normal

# Text alignment, other possible values are commented
#alignment top_left
#alignment bottom_right
#alignment bottom_left
#alignment bottom_right
alignment top_right
#alignment middle_middle
# Gap between borders of screen and text
gap_x 7
gap_y 7

# stuff after 'TEXT' will be formatted on screen

override_utf8_locale yes
xftfont WenQuanYi Micro Hei Mono:size=141
xftalpha 0.8

TEXT

${color 0CBEFF}${scroll 46 1${exec cat $HOME/.dogradio2/tmp/nowplay}}

all i did was close down some spaces in the config, but i have learnt conky is very very sensitive to formatting.
cpu usage is now at 0% .... not sure how that came about, but glad it did!
How do you use conky?

User avatar
rockedge
Site Admin
Posts: 5711
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1991 times
Been thanked: 2097 times
Contact:

Re: Conky

Post by rockedge »

Ahhhh the mystery.....
Start conky with a config file:

Code: Select all

conky -c /root/.conkyrc

This is /root/conkyrc or (/root/.conkyrc) from F96-CE

Code: Select all

# Use Xft?
use_xft yes
xftfont DejaVuSans:size=9
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# 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 true
own_window_transparent true
own_window_type override
own_window_argb_visual false

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 500
maximum_width 210

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders yes

# Stippled borders?
stippled_borders 0

# border margins
border_margin 1

# border width
border_width 0

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

# 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
# same thing as passing -x at command line
gap_x 75
gap_y 50

# 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 2

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

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

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none
color1 12d41c
color2 cecece
weather1 liverpool

#show only active network interfaces 
if_up_strictness link

TEXT

${color1}System ${hr 2}
${color2}${nodename}
#${color}${pre_exec lsb_release -i -s}
${color2}FossaPup64 CE
${color2}${sysname} ${kernel}
${color2}Uptime ${uptime}
${color1}Processes ${hr 2}
${color2}${alignr}CPU%
${color2}${top name 1}${alignr}${top cpu 1}
${color2}${top name 2}${alignr}${top cpu 2}
${color2}${top name 3}${alignr}${top cpu 3}
${color2}${top name 4}${alignr}${top cpu 4}
#${color2}${top name 5}${alignr}${top cpu 5}
#${color2}${top name 6}${alignr}${top cpu 6}
#${color}2${top name 7}${alignr}${top cpu 7}
${color2}${alignr}MEM
${color2}${top_mem name 1}${alignr}${top_mem mem_res 1}
${color2}${top_mem name 2}${alignr}${top_mem mem_res 2}
${color2}${top_mem name 3}${alignr}${top_mem mem_res 3}
${color2}${top_mem name 4}${alignr}${top_mem mem_res 4}
#${color2}${top_mem name 5}${alignr}${top_mem mem_res 5}
#${color2}${top_mem name 6}${alignr}${top_mem mem_res 6}
#${color2}${top_mem name 7}${alignr}${top_mem mem_res 7}

${color1}Resources ${hr 2}
${color2}CPU0 ${cpu cpu0}%${alignr}${color1}${cpubar cpu0 10,120}
#${color2}CPU1 ${cpu cpu0}%${alignr}${color1}${cpubar cpu1 10,120}
#${color2}CPU2 ${cpu cpu0}%${alignr}${color1}${cpubar cpu2 10,120}
#${color2}CPU3 ${cpu cpu0}%${alignr}${color1}${cpubar cpu3 10,120}
#${color2}CPU4 ${cpu cpu0}%${alignr}${color1}${cpubar cpu4 10,120}
#${color2}CPU5 ${cpu cpu0}%${alignr}${color1}${cpubar cpu5 10,120}
#${color2}CPU6 ${cpu cpu0}%${alignr}${color1}${cpubar cpu6 10,120}
${color2}Mem  
${color2}${mem} / ${memmax}${alignr}${color1}${membar 10,60}
${color2}Swap: $swap / $swapmax
$swapperc% ${alignr}${color1}${alignr}${swapbar 10,120}

${color1}File Systems ${hr 2}
#${color2}sda1 ${fs_used /mnt/sda1}/${fs_size /mnt/sda1}${alignr}${color1}${fs_bar 10,60 /mnt/sda1}
${color2}home ${fs_used /initrd/mnt/dev_save}/${fs_size /initrd/mnt/dev_save}${alignr}${color1}${fs_bar 10,60 /initrd/mnt/dev_save}
#${color2}sda2 ${fs_used /mnt/sda2}/${fs_size /mnt/sda2}${alignr}${color 15DF76}${fs_bar 10,60 /mnt/sda2}
#${color2}sdb1 ${fs_used /mnt/home}/${fs_size /mnt/home}${alignr}${color 15DF76}${fs_bar 10,60 /mnt/home}

#${color2}Incoming ${downspeedf eth0} KB/s ${alignr}${color1}${downspeedgraph eth0 10,60}
#${color2}Total Received${alignr}${totaldown eth0}
#${color2}Sending   ${upspeedf eth0} KB/s ${alignr}${color1}${upspeedgraph eth0 10,60}
#${color2}Total Sent${alignr}${totalup eth0}
${color2}NET: EXT: ${alignr}  ${execi 3600 wget -O - -q icanhazip.com} ${if_up eth0}
#eth0
IP (eth0):$alignr${addr eth0}
${color2} Up: ${color2}${upspeed eth0} k/s
${color1}${alignr}${upspeedgraph eth0 10,170 000000}
${color2} Down: ${color2}${downspeed eth0}k/s${color}
${color1}${alignr}${downspeedgraph eth0 10,170 000000}
${color2}TDown:${totaldown eth0} ${alignr}TUp:${totalup eth0}${endif}${if_up eth1}
#eth1
IP (eth1):$alignr${addr eth1}
${color2} Up: ${color2}${upspeed eth1} k/s
${color}${upspeedgraph eth1 10,170 000000}
${color2} Down: ${color2}${downspeed eth1}k/s${color}
${downspeedgraph eth1 10,170 000000}
${color2}TDown:${totaldown eth1} ${alignr}TUp:${totalup eth1}${endif}${if_up wlan0}
#wlan0
IP (wlan0):$alignr${addr wlan0}
${color2} Up: ${color2}${upspeed wlan0} k/s
${color1}${alignr}${upspeedgraph wlan0 10,170 000000}
${color2} Down: ${color2}${downspeed wlan0}k/s${color}
${color1}${alignr}${downspeedgraph wlan0 10,170 000000}
${color2}TDown:${totaldown wlan0}${alignr}TUp:${totalup wlan0}${endif}${if_up eth2}
#eth2
IP (eth2):$alignr${addr eth2}
${color2} Up: ${color2}${upspeed eth2} k/s
${color1}${alignr}${upspeedgraph eth2 10,170 000000}
${color2} Down: ${color2}${downspeed eth2}k/s${color}
${color1}${alignr}${downspeedgraph eth2 10,170 000000}
${color2}TDown:${totaldown eth2} ${alignr}TUp:${totalup eth2}${endif}${if_up wlan1}
#wlan1
IP (wlan1):$alignr${addr wlan1}
${color2} Up: ${color2}${upspeed wlan1} k/s
${color1}${alignr}${upspeedgraph wlan1 10,170 000000}
${color2} Down: ${color2}${downspeed wlan1}k/s${color}
${color1}${alignr}${downspeedgraph wlan1 10,170 000000}
${color2}TDown:${totaldown wlan1}${alignr}TUp:${totalup wlan1}${endif}${if_up ath0}
#ath0
IP (ath0):$alignr${addr ath0}
${color2} Up: ${color2}${upspeed ath0} k/s
${color1}${alignr}${upspeedgraph ath0 10,170 000000}
${color2} Down: ${color2}${downspeed ath0}k/s${color}
${color1}${alignr}${downspeedgraph ath0 10,170 000000}
${color2}TDown:${totaldown ath0}${alignr}TUp:${totalup ath0}${endif}${if_up ath1}
#ath1
IP (ath1):$alignr${addr ath1}
${color2} Up: ${color2}${upspeed ath1} k/s
${color1}${alignr}${upspeedgraph ath1 10,170 000000}
${color2} Down: ${color2}${downspeed ath1}k/s${color}
${color1}${alignr}${downspeedgraph ath1 10,170 000000}
${color2}TDown:${totaldown ath1}${alignr}TUp:${totalup ath1}${endif}
####don't write below this line as used for conky gui weather
${color1}${voffset 2}${hr 2}
#
#
#

Which ends up looking like this example :

Screenshot(8).jpg
Screenshot(8).jpg (27.96 KiB) Viewed 855 times
User avatar
stemsee
Posts: 656
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 0
Has thanked: 160 times
Been thanked: 104 times
Contact:

Re: Conky

Post by stemsee »

thanks @rockedge

Yes conky has so many builtin key words for weather, and hardware, and network infos. Nice wallpaper btw, chiaroscuro

In my first post the exec command is being used, which according to the manual https://linux.die.net/man/1/conky is very resource intensive, instead we should use execi + numeric value equal to the value of update_interval.

Code: Select all

${execi 0.1 cat $textfile}
User avatar
gychang
Posts: 553
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 195 times
Been thanked: 51 times

Re: Conky

Post by gychang »

stemsee wrote: Wed Apr 12, 2023 5:01 pm

thanks @rockedge

Yes conky has so many builtin key words for weather, and hardware, and network infos. Nice wallpaper btw, chiaroscuro

In my first post the exec command is being used, which according to the manual https://linux.die.net/man/1/conky is very resource intensive, instead we should use execi + numeric value equal to the value of update_interval.

Code: Select all

${execi 0.1 cat $textfile}

Where exactly would this be replaced in the above @rockedge code?

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

User avatar
stemsee
Posts: 656
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 0
Has thanked: 160 times
Been thanked: 104 times
Contact:

Re: Conky

Post by stemsee »

gychang wrote: Wed Apr 12, 2023 7:30 pm
stemsee wrote: Wed Apr 12, 2023 5:01 pm

thanks @rockedge

Yes conky has so many builtin key words for weather, and hardware, and network infos. Nice wallpaper btw, chiaroscuro

In my first post the exec command is being used, which according to the manual https://linux.die.net/man/1/conky is very resource intensive, instead we should use execi + numeric value equal to the value of update_interval.

Code: Select all

${execi 0.1 cat $textfile}

Where exactly would this be replaced in the above @rockedge code?

In my first post, conkyrc-radio, from dogradio v2 .... the last line
${scroll 55 1 ${exec cat /root/.dogradio2/tmp/nowplay}} ... change to ${scroll 55 1 ${execi 0.1 cat /root/.dogradio2/tmp/nowplay}}

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 357 times

Re: Conky configuration and usage: discussion

Post by Jasper »

Here's my Conky configuration file.

It does display an IP address, I just removed it.

Just uncomment the #'s to use the options for your hardware

Code: Select all


# Use Xft?
use_xft yes
xftfont DroidSansMono:size=11
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# 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 true
own_window_transparent  true
own_window_argb_visual true
own_window_type = desktop

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 500
maximum_width 250

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders yes

# Stippled borders?
stippled_borders 0

# border margins
#border_margin 1

# border width
#border_width 0

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

# 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
# same thing as passing -x at command line
gap_x 75
gap_y 75

# 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 2

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

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

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none
color1 ec8fbd
color2 ffffff
#weather1 

TEXT

${voffset -16}${font sans-serif:bold:size=18}${alignc}${time %H:%M}${font}
${voffset 4}${alignc}${time %A %d %B %Y}
#
${color1}System ${hr 2}
#${color2}${nodename}
#${color}${pre_exec lsb_release -i -s}
#${color2}fossapup64
#${color2}${sysname} ${kernel}
${color2}Uptime ${alignr}${uptime}
${color2}Home ${fs_used /initrd/mnt/dev_save}/${fs_size /initrd/mnt/dev_save}${alignr}${color 15DF76}${fs_bar 10,60 /initrd/mnt/dev_save}

${color1}Resources ${hr 2}
${color2}CPU ${cpu cpu0}%${alignr}${hwmon 0 temp 4}${color 15DF76}${cpubar cpu0 10,170}
#${color2}CPU1 ${cpu cpu0}%${alignr}${color1}${cpubar cpu1 10,120}
#${color2}CPU2 ${cpu cpu0}%${alignr}${color1}${cpubar cpu2 10,120}
#${color2}CPU3 ${cpu cpu0}%${alignr}${color1}${cpubar cpu3 10,120}
#${color2}CPU4 ${cpu cpu0}%${alignr}${color1}${cpubar cpu4 10,120}
#${color2}CPU5 ${cpu cpu0}%${alignr}${color1}${cpubar cpu5 10,120}
#${color2}CPU6 ${cpu cpu0}%${alignr}${color1}${cpubar cpu6 10,120}
${color2}RAM ${color2}${mem}/${memmax}${alignr}${color 15DF76}${membar 10,70}
${color2}SWAP $swap/$swapmax${alignr}${color 15DF76}${alignr}${swapbar 10,70}

${color1}Processes ${hr 2}
${color1}${alignr}CPU%
${color2}${top name 1}${alignr}${top cpu 1}
${color2}${top name 2}${alignr}${top cpu 2}
${color2}${top name 3}${alignr}${top cpu 3}
${color2}${top name 4}${alignr}${top cpu 4}
#${color2}${top name 5}${alignr}${top cpu 5}
#${color2}${top name 6}${alignr}${top cpu 6}
#${color}2${top name 7}${alignr}${top cpu 7}
${color1}${alignr}MEM%
${color2}${top_mem name 1}${alignr}${top_mem mem_res 1}
${color2}${top_mem name 2}${alignr}${top_mem mem_res 2}
${color2}${top_mem name 3}${alignr}${top_mem mem_res 3}
${color2}${top_mem name 4}${alignr}${top_mem mem_res 4}
#${color2}${top_mem name 5}${alignr}${top_mem mem_res 5}
#${color2}${top_mem name 6}${alignr}${top_mem mem_res 6}
#${color2}${top_mem name 7}${alignr}${top_mem mem_res 7}

${color1}Internet ${hr 2}
#${color2}sda1 ${fs_used /mnt/sda1}/${fs_size /mnt/sda1}${alignr}${color1}${fs_bar 10,60 /mnt/sda1}
#${color2}home ${fs_used /initrd/mnt/dev_save}/${fs_size /initrd/mnt/dev_save}${alignr}${color1}${fs_bar 10,60 /initrd/mnt/dev_save}
#${color2}sda2 ${fs_used /mnt/sda2}/${fs_size /mnt/sda2}${alignr}${color 15DF76}${fs_bar 10,60 /mnt/sda2}
#${color2}sdb1 ${fs_used /mnt/home}/${fs_size /mnt/home}${alignr}${color 15DF76}${fs_bar 10,60 /mnt/home}
#${color2}Incoming ${downspeedf eth0} KB/s ${alignr}${color1}${downspeedgraph eth0 10,60}
#${color2}Total Received${alignr}${totaldown eth0}
#${color2}Sending   ${upspeedf eth0} KB/s ${alignr}${color1}${upspeedgraph eth0 10,60}
#${color2}Total Sent${alignr}${totalup eth0}
${color2}NET:${alignr}  ${execi 3600 wget -O - -q https://icanhazip.com} ${if_up eth0}
#IP (eth0):$alignr${addr eth0}
#${color2} Up: ${color2}${upspeed eth0} k/s
#${color1}${alignr}${upspeedgraph eth0 10,170 000000}
#${color2} Down: ${color2}${downspeed eth0}k/s${color}
#${color1}${alignr}${downspeedgraph eth0 10,170 000000}
#${color2}TDown:${totaldown eth0} ${alignr}TUp:${totalup eth0}${endif}${if_up eth1}
#IP (eth1):$alignr${addr eth1}
#${color2} Up: ${color2}${upspeed eth1} k/s
#${color}${upspeedgraph eth1 10,170 000000}
#${color2} Down: ${color2}${downspeed eth1}k/s${color}
#${downspeedgraph eth1 10,170 000000}
${color2}TDown:${totaldown eth1} ${alignr}TUp:${totalup eth1}${endif}${if_up wlan0}
IP (wlan0):$alignr${addr wlan0}

${color2} Down: ${color2}${downspeed wlan0}${color}
${color 15DF76}${alignr}${downspeedgraph wlan0 10,170 000000}
${color2} Up: ${color2}${upspeed wlan0}
${color 15DF76}${alignr}${upspeedgraph wlan0 10,170 000000}

${color2}TDown:${totaldown wlan0}${alignr}TUp:${totalup wlan0}${endif}${if_up eth2}
#IP (eth2):$alignr${addr eth2}
#${color2} Up: ${color2}${upspeed eth2} k/s
#${color1}${alignr}${upspeedgraph eth2 10,170 000000}
#${color2} Down: ${color2}${downspeed eth2}k/s${color}
#${color1}${alignr}${downspeedgraph eth2 10,170 000000}
#${color2}TDown:${totaldown eth2} ${alignr}TUp:${totalup eth2}${endif}${if_up wlan1}
#IP (wlan1):$alignr${addr wlan1}
#${color2} Up: ${color2}${upspeed wlan1} k/s
#${color1}${alignr}${upspeedgraph wlan1 10,170 000000}
#${color2} Down: ${color2}${downspeed wlan1}k/s${color}
#${color1}${alignr}${downspeedgraph wlan1 10,170 000000}
#${color2}TDown:${totaldown wlan1}${alignr}TUp:${totalup wlan1}${endif}${if_up ath0}
#IP (ath0):$alignr${addr ath0}
#${color2} Up: ${color2}${upspeed ath0} k/s
#${color1}${alignr}${upspeedgraph ath0 10,170 000000}
#${color2} Down: ${color2}${downspeed ath0}k/s${color}
#${color1}${alignr}${downspeedgraph ath0 10,170 000000}
#${color2}TDown:${totaldown ath0}${alignr}TUp:${totalup ath0}${endif}${if_up ath1}
#IP (ath1):$alignr${addr ath1}
#${color2} Up: ${color2}${upspeed ath1} k/s
#${color1}${alignr}${upspeedgraph ath1 10,170 000000}
#${color2} Down: ${color2}${downspeed ath1}k/s${color}
#${color1}${alignr}${downspeedgraph ath1 10,170 000000}
#${color2}TDown:${totaldown ath1}${alignr}TUp:${totalup ath1}${endif}

####don't write below this line as used for conky gui weather
${color1}${voffset 2}${hr 2}
#
#

User avatar
trawglodyte
Posts: 236
Joined: Mon Dec 11, 2023 11:32 am
Location: my cave
Has thanked: 234 times
Been thanked: 72 times

Re: Conky configuration and usage: discussion

Post by trawglodyte »

simple-conky.png
simple-conky.png (43.95 KiB) Viewed 274 times

Code: Select all

# Use Xft?
use_xft yes
xftfont DejaVuSans:size=12
xftalpha 0.8
text_buffer_size 2048

#G instead of Gib, etc..
short_units true

# Update interval in seconds
update_interval 1

# 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 true
own_window_transparent false
own_window_type desktop
own_window_argb_visual true

# 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 500
maximum_width 248

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders yes

# Stippled borders?
stippled_borders 0

# border width
border_width 0

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

# For multiple displays choose 0,1,2 etc.. 
xinerama_head 1

# 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
# same thing as passing -x at command line
gap_x 10
gap_y 10

# 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 25

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

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

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none
color1 DC6203
color2 e5dfff
color3 FF0001
color4 0A6E2B

#show only active network interfaces 
if_up_strictness link

TEXT

${color1}${nodename}${hr 2}
${color2}BookwormPup64_10.0.4
${color2}${sysname} ${kernel}
${color1}${hr 2}
${color2}CPU ${color3}${cpugauge cpu0 80,160}
${color1}${freq_g cpu0}Ghz${alignr}${cpugovernor}
${color2}GPU ${color3}${nvidiagauge 80,160 gpuutil}
#${nvidia temp}°C
${color2}RAM ${color3}${memgauge 80,160}
${color4}SWAP${alignr}$swapperc%  ${swapbar 16,120}
${color1}STORAGE${hr 2}
#${hwmon 1 temp 1}°C
#${hwmon 2 temp 1}°C
${color2}${fs_used /initrd/mnt/dev_save}/${fs_size /initrd/mnt/dev_save}${alignr}${color4}${fs_bar 16,120 /initrd/mnt/dev_save}
${color1}INTERNET${hr 2}
#${execi 3600 wget -O - -q icanhazip.com}
${color2}U↑  ${upspeedf eth0}
${alignr}${color4}${upspeedgraph eth0 40,240}
${color2}D↓ ${downspeedf eth0}
${alignr}${color4}${downspeedgraph eth0 40,240}
#

Working on a weather bit using an API. Maybe I can learn a bit of python to do it that way? I would like to see more of other people's conky's. So I can steal bits that I like from you!

One tip I can give is enter <man -H conky> in terminal to open the manual for your version of conky in your browser. Much easier to scroll through the options that way.

Like a monkey trying to fly a space-ship. What's this button do?
Like a 12-yr old trying to wire a house. Gonna get zapped!

User avatar
trawglodyte
Posts: 236
Joined: Mon Dec 11, 2023 11:32 am
Location: my cave
Has thanked: 234 times
Been thanked: 72 times

Re: Conky configuration and usage: discussion

Post by trawglodyte »

RE: exec, execi - can be resource intensive, with execi you set an interval in seconds so conky doesn't run the terminal command every time conky refreshes. execi 300 = 5 minutes, execi 1200 = 20 minutes, execi 1800 = 1/2 hour, execi 3600 = 1 hour, etc...

Last edited by trawglodyte on Mon Jan 29, 2024 5:21 am, edited 2 times in total.

Like a monkey trying to fly a space-ship. What's this button do?
Like a 12-yr old trying to wire a house. Gonna get zapped!

User avatar
spiritwild
Posts: 75
Joined: Wed Jul 22, 2020 1:34 am
Been thanked: 24 times

Re: Conky configuration and usage: discussion

Post by spiritwild »

I've tried different conky weather stuff but I always fell back to simplicity.
I run this script in conky for just single line weather


#!/bin/sh
#AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh <locationcode>
#
#(c) Michael Seiler 2007

METRIC=0 #Should be 0 or 1; 0 for F, 1 for C

if [ -z $1 ]; then
echo
echo "USAGE: weather.sh <locationcode>"
echo
exit 0;
fi

curl -s http://rss.accuweather.com/rss/liveweat ... ocCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'


location code is zip code or airport code so I run
weather.sh evv and get Mostly Cloudy: 37F

{execi 300 /root/scripts/acuweather.sh evv}

in my older conky for us weather
I think the location code for europe may need to be quoted.
Been using this since 2008
and things change.

User avatar
trawglodyte
Posts: 236
Joined: Mon Dec 11, 2023 11:32 am
Location: my cave
Has thanked: 234 times
Been thanked: 72 times

Re: Conky configuration and usage: discussion

Post by trawglodyte »

@spiritwild

I'm trying it. This is certainly easier than the way I was going about it. I tried a couple airport codes. msy (New Orleans) iad (Dulles), and a zip code 90210. No luck so far, but I'll try to figure it out.

Code: Select all

# cd /root/Documents
# sh weather.sh msy
weather.sh: line 17: locCode%5C=msy: command not found
# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body, div, h1,h2, p, a { margin:0; padding:0; }
h1,h2,p,a { font-family:Arial, Helvetica, sans-serif; }
#wrapper { width:700px; height:350px; margin:100px auto 0; background:url("http://vortex.accuweather.com/adc2010/images/404.jpg"); position:relative; }
h1, h2, p { left:365px; color:#fff; position:absolute; }
h1 { font-size:50px; top:85px; }
h2 { font-size:22px; top:140px; }
p { font-size:18px; top:170px; font-weight:normal; width:300px; }
a { font-size:19px; width:auto; height:auto; display:block; color:#285db5; position:absolute; left:365px; top:297px; }
a span { font-weight:bold;}
</style>
</head>
<body>
<div id="wrapper">
	<h1>ERROR 404</h1>
    <h2>PAGE CANNOT BE FOUND</h2>
    <p>The page you requested has either been blown away or it never existed.</p>
	<a href="http://www.accuweather.com"><span>AccuWeather.com</span> Home Page</a>
</div>
</body>
# sh weather.sh iad
weather.sh: line 17: locCode%5C=iad: command not found
# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body, div, h1,h2, p, a { margin:0; padding:0; }
h1,h2,p,a { font-family:Arial, Helvetica, sans-serif; }
#wrapper { width:700px; height:350px; margin:100px auto 0; background:url("http://vortex.accuweather.com/adc2010/images/404.jpg"); position:relative; }
h1, h2, p { left:365px; color:#fff; position:absolute; }
h1 { font-size:50px; top:85px; }
h2 { font-size:22px; top:140px; }
p { font-size:18px; top:170px; font-weight:normal; width:300px; }
a { font-size:19px; width:auto; height:auto; display:block; color:#285db5; position:absolute; left:365px; top:297px; }
a span { font-weight:bold;}
</style>
</head>
<body>
<div id="wrapper">
	<h1>ERROR 404</h1>
    <h2>PAGE CANNOT BE FOUND</h2>
    <p>The page you requested has either been blown away or it never existed.</p>
	<a href="http://www.accuweather.com"><span>AccuWeather.com</span> Home Page</a>
</div>
</body>
</html>sh weather.sh 90210
weather.sh: line 17: locCode%5C=90210: command not found
# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body, div, h1,h2, p, a { margin:0; padding:0; }
h1,h2,p,a { font-family:Arial, Helvetica, sans-serif; }
#wrapper { width:700px; height:350px; margin:100px auto 0; background:url("http://vortex.accuweather.com/adc2010/images/404.jpg"); position:relative; }
h1, h2, p { left:365px; color:#fff; position:absolute; }
h1 { font-size:50px; top:85px; }
h2 { font-size:22px; top:140px; }
p { font-size:18px; top:170px; font-weight:normal; width:300px; }
a { font-size:19px; width:auto; height:auto; display:block; color:#285db5; position:absolute; left:365px; top:297px; }
a span { font-weight:bold;}
</style>
</head>
<body>
<div id="wrapper">
	<h1>ERROR 404</h1>
    <h2>PAGE CANNOT BE FOUND</h2>
    <p>The page you requested has either been blown away or it never existed.</p>
	<a href="http://www.accuweather.com"><span>AccuWeather.com</span> Home Page</a>
</div>
</body>
</html>

The perl part I'm clueless about, but it might be the rss.weather.com url? I have freebie API with openweather.org and I know they need my key in addition to location in the url, maybe an additional paramater too. I'm wondering if part of this url is not universal? Anyway, I'm going to see if I can figure it out here. I probably will end up doing it the hard way with my personal freebie API and possibly some python just because I need to start learning that stuff. But I'm still interested in this script and accuweather's public API.

It would be great if this script with accuweather.com public api worked though, because the openweather.org api you have to make an account and there are limits to how often you can access it. Like, I couldn't just hand someone the code and let them use my account.

Like a monkey trying to fly a space-ship. What's this button do?
Like a 12-yr old trying to wire a house. Gonna get zapped!

Post Reply

Return to “Desktop”