You are not logged in.

#1 2018-01-26 12:18:54

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

conky for Helium

It was mentioned here that the following screenshot

beam_test.th.jpg

looks good, which was a test for beam. But:

johnraff wrote:

I forgot at the time to get the conky config script ... it will have to be reverse-engineered...


I gave it a try. First I searched for the original CB conky, which I found here (pasted here under III). I looked at the BL conky script too (pasted here under IV) and tried to make a new one (pasted here under I). There is also a changelog (under II). First some remaining remarks/questions, nothing serious I guess:

- Following lines might need descriptions:
pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc" &
#### ${font Monospace:bold:size=10}${alignc}${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}

Someone could come up maybe with a short comment?

- pad_percents 2 - it says in conky: "doesn't seem to work since v1.7.1" - leave it out? This is "#Pad percentages to this many decimals (0 = no padding)"

- These two were in CB conky but not in BL conky. Leave them out?
total_run_times 0   #Total number of times for Conky to update before quitting. Zero makes Conky run forever
cpu_avg_samples 2    #The number of samples to average for CPU monitoring.

- It looks like on the screenshot there is more line spacing and the fonts might be different.

Part I:

Proposed for Helium:

# conky configuration
#
# For conky variables and commands use the terminal command:
# man conky
#
# BunsenLabs conky threads
# Index » Scripts, Tutorials & Tips » Conky - Calendars / Clocks / Time
# https://forums.bunsenlabs.org/viewtopic.php?id=516
#
# Open a thread and post conky questions in: Index » GUI & Applications
# https://forums.bunsenlabs.org/viewforum.php?id=4
#
# Display your completed conky and codes
# Index » Scripts, Tutorials & Tips » Show us your conky
# https://forums.bunsenlabs.org/viewtopic.php?id=512
#
# BunsenLabs conky scripts help
# Openbox Menu/Preferences/Conky/Conky Manager Help
#
# If there are one or more conkys running, it is possible to kill one conky with
# the following command, IF you used what is between the quotes to start the conky, e.g.:
# pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc"


###  Window Settings  #####################
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_class Conky
own_window_title BunsenLabs Default Conky

# ARGB can be used for real transparency
#own_window_argb_visual = true, -- Options: true|false

# NOTE that a composite manager is required for real transparency and ARGB will not
# work as desired (in most cases) in conjunction with 'own_window_type override'.
# Use with: own_window_type = 'normal',
# Use with: own_window_transparent = false,

# When ARGB visuals are enabled, use the following to modify the alpha value. Valid
# range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value = 150,

minimum_size 200 0    ### width | height
maximum_width 200

gap_x 20    ### left | right
gap_y 45    ### up | down

alignment top_right
#######################  End Window Settings  ###


###  Font Settings  #############################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Liberation Mono:bold:size=10
#xftfont Liberation Sans:size=10
xtfont sans-serif:size=10


# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1

# Force UTF8? requires XFT ###
override_utf8_locale yes
uppercase no
#########################  End Font Settings  ###


###  Colour Settings  ###########################
draw_shades no
default_shade_color 000000
draw_outline no # amplifies text if yes
default_outline_color 000000
default_color 678b8b
#default_color 656667 # Waldorf original colour
#default_color 7a7a7a # Flame & BunsenLabs Grey
#default_color 929292 # BunsenLabs Grey
#default_color C0C0C0 # BunsenLabs Silver
color0 B0E0E6 # PowderBlue
color1 778899 # LightSlateGray
color2 D8BFD8 # Thistle
color3 9ACD32 # YellowGreen
color4 FFA07A # LightSalmon
color5 FFDEAD # NavajoWhite
color6 00BFFF # DeepSkyBlue
color7 5F9EA0 # CadetBlue
color8 BDB76B # DarkKhaki
color9 CD5C5C # IndianRed
#######################  End Colour Settings  ###


###  Borders Section  ###########################
draw_borders no

#Stippled borders?
#stippled_borders 5

#border margins
#border_inner_margin 5
#border_outer_margin 0

#border width
#border_width 2

#graph borders
draw_graph_borders no
#default_graph_size 15 40
#######################  End Borders Section  ###


###  Miscellaneous Section  #####################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 6144

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable the image cache.
imlib_cache_size 0

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

# Update interval in seconds
update_interval 1
#################  End Miscellaneous Section  ###


##############################################
#  Output
##############################################
TEXT
S Y S T E M    I N F O
${hr}
Host:$alignr$nodename
Uptime:$alignr$uptime
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Disk usage:$alignr${fs_used /}/${fs_size /}
# Root usage:$alignr${fs_used /}/${fs_size /}
# Home usage:$alignr${fs_used /home}/${fs_size /home}
CPU Average:$alignr${cpu cpu0}%
#
# Weather information from openweathermap.org can be displayed in conky by
# using the script $HOME/.config/conky/scripts/bunsenweather.sh. The openweathermap
# service requires registration in order to receive an API Key, which has to be
# added to bunsenweather.sh. For further info see this script and the following thread:
# https://forums.bunsenlabs.org/viewtopic.php?id=2060
#
# Calling bunsenweather.sh from conky works by using
# ${execpi <t> /path/to/bunsenweather.sh "yourlocation"} 
# where <t> is the update interval. If "yourlocation" is not defined, the script
# sets geolocation based on your IP adress using the website ipinfo.io.
#
#W E A T H E R
#${hr}
#${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}

S H O R T C U T    K E Y S
${hr}
Alt+F2$alignr Run Dialog
Alt+F3$alignr Alt Menu
Super+Space$alignr Main Menu
Super+Tab$alignr Client Menu
Super+t$alignr Terminal
Super+f$alignr File Manager
Super+e$alignr Editor
Super+m$alignr Media Player
Super+w$alignr Web Browser
Super+h$alignr Task Manager
Super+l$alignr Lock Screen
Super+v$alignr Volume Control
Super+x$alignr Logout
PrtSc$alignr Screenshot
Part II:

Changelog:

As for the TEXT section:

Used CB original conky  https://web.archive.org/web/20150208173825/http://crunchbang.org/forums/viewtopic.php?id=25419

Commented out Disk usage

Added root and home usage
---------------------------------------------------------------------------------------------------------------------------


Took first two description paragraphs from BL conky

Added hint to conky help section in BL-Menu

Deleted  http://crunchbang.org/forums/viewtopic.php?pid=371424#p371424   (does not work properly anymore, only via web.archive)

Added link to BunsenLabs "Show us your conky" thread

Removed beta tested line
----------------------------------------------------------------------------------------------------------------------------

Took over "Windows Settings" Section as uncommented line from BL conky for "own_window" lines and grouped code according to BL conky.
These are the main sections (from BL conky): Window Settings, Font Settings, Colour Settings, Borders Section, Miscellaneous Section

Changed "own_window_type desktop" to "own_window_type normal" like in BL conky

Took over from BL conky:
"own_window_colour 000000
own_window_class Conky
own_window_title Bunsen Labs Default Conky"

Took over argb_visual section from BL conky

maximum_size and maximum_width from BL conky

gap x,y as in BL conky (20 and 45)

Changed font to "xftfont Monospace:bold:size=9" like in BL conky

Changed override_utf8_locale to yes according to BL conky (in CB it was no)

Changed default_outline_color from 828282 to 00000

Changed default_color from 656667 (CB) and C0C0C0 (BL) to 598078

Took over uncommented "default_color" lines from BL conky

In"Borders Section" used only "draw_borders no" and
"draw_graph_borders no" (as in CB conky).
Took over from BL conky stippled_borders border_inner_margin border_outer_margin border_width and default_graph_size but ALL uncommented

Took over "use_spacer none", "text_buffer_size 6144", "short_units yes", "imlib_cache_size 0" from BL conky
Part III:

CB conky:

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
background yes
use_xft yes
xftfont Liberation Sans:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
#own_window_argb_visual yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 200
maximum_width 240
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 656667
default_shade_color 000000
default_outline_color 828282
alignment top_right
gap_x 12
gap_y 56
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
##############################################
#  Output
##############################################
TEXT
S Y S T E M    I N F O
${hr}
Host:$alignr$nodename
Uptime:$alignr$uptime
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Disk usage:$alignr${fs_used /}/${fs_size /}
CPU usage:$alignr${cpu cpu0}%


S H O R T C U T    K E Y S
${hr}
Alt+F2$alignr Run Dialog
Alt+F3$alignr Alt Menu
Super+Space$alignr Main Menu
Super+Tab$alignr Client Menu
Super+t$alignr Terminal
Super+f$alignr File Manager
Super+e$alignr Editor
Super+m$alignr Media Player
Super+w$alignr Web Browser
Super+h$alignr Task Manager
Super+l$alignr Lock Screen
Super+v$alignr Volume Control
Super+x$alignr Logout
PrtSc$alignr Screenshot

Part IV:

BL conky:

# For commands above TEXT check:
# http://conky.sourceforge.net/config_settings.html
#
# For commands available below TEXT check:
# http://conky.sourceforge.net/variables.html

# Bunsen Labs Conky help threads
# http://crunchbang.org/forums/viewtopic.php?pid=371424#p371424


# pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc" &
###  Begin Window Settings  #####################
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
own_window_colour 000000
own_window_class Conky
own_window_title Bunsen Labs Default Conky

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes # Options: yes or no

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 50

minimum_size 200 0  ### width | height
maximum_width 200

gap_x 20    ### left | right
gap_y 45    ### up | down

alignment tr
#######################  End Window Settings  ###
###  Font Settings  #############################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monospace:bold:size=9
#xftfont Liberation Sans:size=9

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
#########################  End Font Settings  ###
###  Colour Settings  ###########################
draw_shades no #yes
default_shade_color 000000

draw_outline no # amplifies text if yes
default_outline_color 000000

#default_color 656667 # Waldorf original colour
#default_color 7a7a7a # Flame  & Bunsen Grey
#default_color 929292 # Labs Grey
default_color C0C0C0 # Silver
color0 B0E0E6 # PowderBlue
color1 778899 # LightSlateGray
color2 D8BFD8 # Thistle
color3 9ACD32 # YellowGreen
color4 FFA07A # LightSalmon
color5 FFDEAD # NavajoWhite
color6 00BFFF # DeepSkyBlue
color7 5F9EA0 # CadetBlue
color8 BDB76B # DarkKhaki
color9 CD5C5C # IndianRed
#######################  End Colour Settings  ###
###  Borders Section  ###########################
draw_borders no
# Stippled borders?
stippled_borders 5
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 2
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#######################  End Borders Section  ###
###  Miscellaneous Section  #####################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 6144

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable the image cache.
imlib_cache_size 0

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

#################  End Miscellaneous Section  ###
#### ${font Monospace:bold:size=10}${alignc}${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}
update_interval 1

TEXT
${color}${alignc}S Y S T E M    I N F O
${hr}
Host:${alignr}${nodename}
Uptime:${alignr}${uptime}
UTC:${alignr}${utime %H:%M}

${goto 60}Used${alignr}Size
Root${goto 60}${fs_used /}${alignr}${fs_size /}
Home${goto 60}${fs_used /home}${alignr}${fs_size /home}

${goto 60}MEM${alignr}MAX
RAM${goto 60}${mem}${alignr}${memmax}
Swap${goto 60}${swap}${alignr}${swapmax}

CPU:${goto 60}Used${alignr}GHz
Avg${goto 60}${if_match ${cpu cpu0}<10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}%${alignr}${freq_g}

${alignc}S H O R T C U T    K E Y S
${hr}
[Alt] + F2${alignr}Run Dialog
[Alt] + F3${alignr}Alt Menu
[S] + Space${alignr}Main Menu
[S] + Tab${alignr}Client Menu
[S] + t${alignr}Terminal
[S] + f${alignr}File Manager
[S] + e${alignr}Editor
[S] + m${alignr}Media Player
[S] + w${alignr}Web Browser
[S] + h${alignr}Task Manager
[S] + l${alignr}Lock Screen
[S] + v${alignr}Volume Control
[S] + x${alignr}Logout
[PrtSc]${alignr}Screenshot

Edit: It's corrected to CPU Average instead of usage.
Edit II: pad_percents 2, total_run_times 0 and cpu_avg_samples 2 removed. Font type changed to sans-serif 10.
Edit III: Script updated to match new syntax script, intro description changed, font color changed.
Edit IV: Weather conky added.
Edit V: ARGB part updated.

Last edited by martix (2018-02-02 07:25:26)

Offline

#2 2018-01-26 13:00:20

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: conky for Helium

##pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc" & 

This command was developed by Sector11.
It is used to shoot down only this one Conky in the terminal.
Not as it used to be, with conky killall
to kill all the Conky's on the desktop.

The command is therefore an orientation for the user.

####${font Monospace:bold:size=10}${alignc}${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}

This command also goes back to Sector11. In my opinion,
is to omit it because it actually belongs below TEXT.
S11 wants to show the user how to call the weather script.


^For your other remarks, I agree.
Personally I am in favour of the Conky BL-Helium.  wink

Last edited by unklar (2018-01-26 13:06:50)

Offline

#3 2018-01-26 19:23:16

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

Thank you for the details @unklar.

I just tried that pkill command and it did not kill the conky on the desktop but it delivered a number (PID?).

As for bunsenweather.sh: Just found this thread. As it is mentioned in the thread that service requires registration now and there are some g* and similar analytic scripts. I don't know who is behind the service but at first glance it looks like a data collecting machine (well, just checked on the page: "Who we are - We are an IT company with practical experience in Big Data and geospatial technologies").

If there is no good reason for these lines, I guess these three: pad_percents 2, total_run_times 0 and cpu_avg_samples 2 can be removed from the script (tested it, running fine).

One more thing: It looks like Monospace bold is a bit too bold, Liberation Sans and Monospace a bit too narrow - does someone maybe have an idea what font type it is on the damo screenshot?

Edit: Meanwhile I tested to call bunsenweather.sh using https://forums.bunsenlabs.org/viewtopic … 070#p30070 script from the thread mentioned above. It looks like it's working fine:

bunsenweather.th.png

Font type is Liberation Sans Size 10. What about this font type? It was originally CB conky font type, size 10 seems to look better than 9.

Last edited by martix (2018-01-26 19:40:55)

Offline

#4 2018-01-26 19:45:55

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: conky for Helium

^ Thanks for this martix, awesome work!

martix wrote:

Font type

If this is to be for the BunsenLabs desktop then please stick to the three font aliases:

monospace
sans-serif
serif

This will ensure a consistent look across all programs and interfaces.

Offline

#5 2018-01-26 20:05:31

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

^Thank you for the feedback.

Implemented sans-serif 10 and it looks close to the damo screenshot. If an other type may suit the background better, it's an easy fix.

I'm not sure about that pkill line as it did not work for me.

As for the bunsenweather-line I'd add a short description (and put it under TEXT), if that bunsenweather.sh will be updated (or is it already?).

Offline

#6 2018-01-26 20:12:36

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: conky for Helium

martix wrote:

I'm not sure about that pkill line as it did not work for me

Get a list of all the "conky" processes with:

pkill -a conky

The -xf flag should match the exact (and full) command line.

Also, did you remove the comments before the command? (Sorry but I have to ask.)

Offline

#7 2018-01-26 21:17:01

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: conky for Helium

martix wrote:

I just tried that pkill command and it did not kill the conky on the desktop but it delivered a number (PID?).

The Conky must also be started with the command

conky -q -c ~/...

be startet

the -q is missing, therefore only the PID and no kill function.

-q means = silent, no output

Offline

#8 2018-01-26 23:29:44

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

Head_on_a_Stick wrote:
pkill -a conky

It looks like there is no "a" switch for pkill and comment was removed.

pkill: invalid option -- 'a'

As unklar also mentioned it depends on the part between the quotes. Meanwhile I found this: Sector 11 mentioned it here too. In the quotes there is $HOME/.config/conky/BL-Default.conkyrc but it's not the conky in use for me (as the name suggests it's the default one).

In autostart there is "bl-conky-session --autostart" and in bl-conky-session:

CONKYPATH="$HOME/.config/conky"
SESSIONFILE="$CONKYPATH/conky-sessionfile"

And in conky-sessionfile

conky -c ~/.conkyrc & sleep 1

So this is what worked for me:

pkill -xf "conky -c $HOME/.conkyrc" &

I can start conky again simply by running "conky", but interestingly I cannot use the command above in this case because the term between the quotes wasn't used to start the conky.

But let's focus on the script here. Something like this could be added:

# If there are one or more conkys running, it is possible to kill one conky with
# the following command, IF you use what is between the quotes to start the conky, e.g.:
# pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc" &

Offline

#9 2018-01-26 23:42:03

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: conky for Helium

martix wrote:
Head_on_a_Stick wrote:
pkill -a conky

It looks like there is no "a" switch for pkill and comment was removed.

pkill: invalid option -- 'a'

Ooops, sorry, don't know why I posted that; I meant to write this instead:

pgrep -a conky

Ho hum...

Offline

#10 2018-01-27 05:48:22

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,556
Website

Re: conky for Helium

@martix thank you for this!

Just one more step needs to be taken in order to use that conky in Helium: the syntax needs to be updated to conky 1.10 style. I think the CB-Right.conkyrc in the GitHub helium-dev branch comes close to the original CrunchBang, and Sector11 has already converted it to the new syntax. Perhaps it would be easiest if you merge your modifications into that?

Conky 1.10+ will accept config files in the old syntax, but exactly how it interprets them is not completely clear. I think it will be safer going forward only to use the 1.10 syntax.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#11 2018-01-27 09:52:59

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

I guess that was the conky used by damo - or at least that is very similar, using sans-serif bold 10 and the colour 678b8b. It looks good. Here it is with some minor changes (see changelog below). Questions remained:
- Add commented bunsenweather.sh line? Maybe with a link to that thread?
- Added commented pkill line ok or leave it out?
- pad_percents removed

--[[ conky configuration
 ------------------------------
 For conky variables and commands use the terminal command:

 man conky
 ------------------------------ 
 BunsenLabs conky threads
 Index » Scripts, Tutorials & Tips » Conky - Calendars / Clocks / Time
 https://forums.bunsenlabs.org/viewtopic.php?id=516

 Open a thread and post conky questions in: Index » GUI & Applications
 https://forums.bunsenlabs.org/viewforum.php?id=4

 Display your completed conky and codes
 Index » Scripts, Tutorials & Tips » Show us your conky
 https://forums.bunsenlabs.org/viewtopic.php?id=512

 BunsenLabs conky scripts help
 Openbox Menu/Preferences/Conky/Conky Manager Help
 
 If there are one or more conkys running, it is possible to kill one conky with
 the following command, IF you used what is between the quotes to start the conky, e.g.:
 pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc"
]]


conky.config = {

--  Window Settings  
	own_window = true,
	own_window_type = 'normal',
	own_window_transparent = true,
	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',
	own_window_colour = '000000',
	own_window_class = 'Conky',
	own_window_title = 'BunsenLabs Default Conky',

-- ARGB can be used for real transparency
--own_window_argb_visual = true, -- Options: true|false

-- NOTE that a composite manager is required for real transparency and ARGB will not
-- work as desired (in most cases) in conjunction with 'own_window_type override'.
-- Use with: own_window_type = 'normal',
-- Use with: own_window_transparent = false,

-- When ARGB visuals are enabled, use the following to modify the alpha value. Valid
-- range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
--own_window_argb_value = 150,

	minimum_width = 200, minimum_height = 0,-- width | height
	maximum_width = 200,

	gap_x = 20,-- left | right
	gap_y = 45,-- up | down

	alignment = 'top_right',
--  End Window Settings  


--  Font Settings  
-- Use Xft (anti-aliased font and stuff)
	use_xft = true,
--font = 'Liberation Mono:bold:size=10',
--font = 'Liberation Sans:size=10',
	font = 'Sans-serif:size=10',

-- Alpha of Xft font. Must be a value at or between 1 and 0
	xftalpha = 1,
-- Force UTF8? requires XFT 
	override_utf8_locale = true,

	uppercase = false,
--  End Font Settings  


--  Color Settings  
	draw_shades = false,
	default_shade_color = '000000',

	draw_outline = false,-- amplifies text if true
	default_outline_color = '000000',
        default_color = '678b8b', -- Beam green
--default_color = '656667', -- Waldorf original colour
--default_color = '7a7a7a', -- Flame  & BunsenLabs Grey
--default_color = '929292', -- BunsenLabs Grey
--default_color = 'C0C0C0', -- BunsenLabs Silver
	color0 = 'B0E0E6',-- PowderBlue
	color1 = '778899',-- LightSlateGray
	color2 = 'D8BFD8',-- Thistle
	color3 = '9ACD32',-- YellowGreen
	color4 = 'FFA07A',-- LightSalmon
	color5 = 'FFDEAD',-- NavajoWhite
	color6 = '00BFFF',-- DeepSkyBlue
	color7 = '5F9EA0',-- CadetBlue
	color8 = 'BDB76B',-- DarkKhaki
	color9 = 'C0C0C0',-- Silver	
--  End Color Settings  


--  Borders Section  
	draw_borders = false,
-- Stippled borders?
	stippled_borders = 5,
-- border margins
	border_inner_margin = 5,
	border_outer_margin = 0,
-- border width
	border_width = 2,
-- graph borders
	draw_graph_borders = false,
--default_graph_height = 15,
--default_graph_width = 40,
--  End Borders Section  


--  Miscellaneous Section  
-- Boolean value, if true, Conky will be forked to background when started.
	background = true,

-- Adds spaces around certain objects to stop them from moving other things
-- around, this only helps if you are using a mono font
-- Options: right, left or none
	use_spacer = 'none',

-- Default and Minimum size is 256 - needs more for single commands that
-- "call" a lot of text IE: bash scripts
--text_buffer_size = 6144,

-- Subtract (file system) buffers from used memory?
	no_buffers = true,

-- change GiB to G and MiB to M
	short_units = true,

-- Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
-- $image lots. Set to 0 to disable the image cache.
	imlib_cache_size = 0,

-- Use the Xdbe extension? (eliminates flicker)
-- It is highly recommended to use own window with this one
-- so double buffer won't be so big.
	double_buffer = true,

--   Maximum size of user text buffer, i.e. layout below TEXT line in config file
--  (default is 16384 bytes)
--max_user_text = 16384,

-- Desired output unit of all objects displaying a temperature. Parameters are
-- either "fahrenheit" or "celsius". The default unit is degree Celsius.
-- temperature_unit = 'Fahrenheit',

-- Update interval in seconds
	update_interval = 1,
	
--  End Miscellaneous Section  
};


conky.text = [[
S Y S T E M    I N F O
${hr}
Host:${alignr}${nodename}
Uptime:${alignr}${uptime}
RAM:$alignr${mem} / ${memmax}
Swap usage:${alignr}${swap} / ${swapmax}
Disk usage:$alignr${fs_used /} / ${fs_size /}
#Root usage:$alignr${fs_used /} / ${fs_size /}
#Home usage:$alignr${fs_used /home} / ${fs_size /home}
CPU Average:${alignr}${cpu cpu0}%
#
# Weather information from openweathermap.org can be displayed in conky by
# using the script $HOME/.config/conky/scripts/bunsenweather.sh. The openweathermap
# service requires registration in order to receive an API Key, which has to be
# added to bunsenweather.sh. For further info see this script and the following thread:
# https://forums.bunsenlabs.org/viewtopic.php?id=2060
#
# Calling bunsenweather.sh from conky works by using
# ${execpi <t> /path/to/bunsenweather.sh "yourlocation"} 
# where <t> is the update interval. If "yourlocation" is not defined, the script
# sets geolocation based on your IP adress using the website ipinfo.io.
#
#W E A T H E R
#${hr}
#${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}

S H O R T C U T    K E Y S
${hr}
Alt + F2${alignr}Run Dialog
Alt + F3${alignr}Alt Menu
Super + Space${alignr}Main Menu
Super + Tab${alignr}Client Menu
Super + t${alignr}Terminal
Super + f${alignr}File Manager
Super + e${alignr}Editor
Super + m${alignr}Media Player
Super + w${alignr}Web Browser
Super + h${alignr}Task Manager
Super + l${alignr}Lock Screen
Super + v${alignr}Volume Control
Super + x${alignr}Logout
PrtSc${alignr}Screenshot
]];

Changelog:
- Openbox Menu/Preferences/Conky/Conky Manager Help  added
- Added commented pkill line
- Window title changed to BunsenLabs Default Conky
- Added --default_color = 'C0C0C0', -- BunsenLabs Silver
- Removed pad_percents = 2
- Added -- Update interval in seconds to Miscellaneous section
Edit:
- Ampersand removed from pkill line
- BunsenLabs conky scripts help moved further down
- Disk usage added, Root and Home usage commented out
- Font changed from bold 10 to 10.
- Added Weather conky
- ARGB part updated

Last edited by martix (2018-02-02 07:30:25)

Offline

#12 2018-01-28 06:03:34

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,556
Website

Re: conky for Helium

martix wrote:

Questions remained:
- Add commented bunsenweather.sh line? Maybe with a link to that thread?

Why not? As long as the comment is clear what it is for.

- Added commented pkill line ok or leave it out?

Let's leave it in. There should be no ampersand at the end, though.

- pad_percents removed

Sure. The comment said it no longer worked anyway.

Changelog:
- Openbox Menu/Preferences/Conky/Conky Manager Help  added

OK to change this slightly?

 BunsenLabs conky scripts help
 Openbox Menu > Preferences > Conky > Conky Manager Help

and put it at the bottom of the list, not the top, since it's not about conky itself, but about the BL conky menu items.

Everything else looks fine. I'm just about to take this on a test drive. cool

EDIT2 please ignore my edit below about spacing. After trying, I agree it's better with.
OTOH, I wonder about the need for bold text. Doesn't it look more elegant without?
kEgasYKm.png

One other question: this might be because it's on a VM, but the "root" and "home" disk usage entries report the same, and wrong. Go back to single "Disk usage" entry? Have to test on a real machine...

EDIT 1 (now obsolete)
My only other question is about the spacing in the actual "conky.text" section.
The original CrunchBang config - and your post earlier - put things closer together, while  CB-Right.conkyrc - and your post today - adds some horizontal spacing on the lines.

Original Crunchbang style:

S Y S T E M    I N F O
${hr}
Host:$alignr$nodename
Uptime:$alignr$uptime
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Disk usage:$alignr${fs_used /}/${fs_size /}
CPU usage:$alignr${cpu cpu0}%


S H O R T C U T    K E Y S
${hr}
Alt+F2$alignr Run Dialog
Alt+F3$alignr Alt Menu
Super+Space$alignr Main Menu
Super+Tab$alignr Client Menu
Super+t$alignr Terminal
Super+f$alignr File Manager
Super+e$alignr Editor
Super+m$alignr Media Player
Super+w$alignr Web Browser
Super+h$alignr Task Manager
Super+l$alignr Lock Screen
Super+v$alignr Volume Control
Super+x$alignr Logout
PrtSc$alignr Screenshot

Later, spaced style:

S Y S T E M    I N F O
${hr}
Host:${alignr}${nodename}
Uptime:${alignr}${uptime}
RAM:$alignr${mem} / ${memmax}
Swap usage:${alignr}${swap} / ${swapmax}
Root usage:$alignr${fs_used /} / ${fs_size /}
Home usage:$alignr${fs_used /home} / ${fs_size /home}
CPU Average:${alignr}${cpu cpu0}%


S H O R T C U T    K E Y S
${hr}
Alt + F2${alignr}Run Dialog
Alt + F3${alignr}Alt Menu
Super + Space${alignr}Main Menu
Super + Tab${alignr}Client Menu
Super + t${alignr}Terminal
Super + f${alignr}File Manager
Super + e${alignr}Editor
Super + m${alignr}Media Player
Super + w${alignr}Web Browser
Super + h${alignr}Task Manager
Super + l${alignr}Lock Screen
Super + v${alignr}Volume Control
Super + x${alignr}Logout
PrtSc${alignr}Screenshot

The extra spaces enhance readability, but the lines look neater without them (IMO).

Does anyone have a preference here?

Last edited by johnraff (2018-01-28 07:35:15)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#13 2018-01-28 13:18:33

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: conky for Helium

Finally got the chance to try this out and I love it — great work here martix cool

johnraff wrote:

I wonder about the need for bold text. Doesn't it look more elegant without?

+1, I prefer the non-emboldened look.

johnraff wrote:

Go back to single "Disk usage" entry?

+1, perhaps leave the separate entries as commented-out lines?

Here's my tweaked, minimal version:

2018-01-28-130458_1280x800_scrot.th.png

I'm not usually a conky person but I may keep this 8)

I certainly prefer it to the arty desk-calendar style conky's used by Mint, et al.

Offline

#14 2018-01-28 14:08:51

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

@johnraff Ampersand removed, conky scripts line moved further down in the new syntax script. I'll implement those changes in the OP too.

@HoaS It's actually Sector 11's work with minor changes. Writing here feel likes wandering around in Sector 11's department (hehe, that ampersand came actually from him too).

Root usage and Home usage data are correct for me (without Virtualbox).

Question: Use Disk (and Swap) usage as default and commented-out Root usage and Home usage?
Although in BL conky there were already Root and Home usage but they clearly won't work in virtualbox, so Disk usage might be better default I guess. Edit: Just noticed that Disk usage and Root usage are actually the same. The same data under different label. Disk usage added to the script, other ones commented out.

bunsenweather.sh: As unklar mentioned this line actually belongs to the conky.text section. Before Shortcut Keys there could be something like (commented out and with a short description above it):

#W E A T H E R
#${hr}
#${font Sans-serif:size=10.5}${alignc}${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}

Sidenote: Just noticed that "conky.config = {" and "conky.text = [[" are differnt in the script. In the conky.text section "--" won't work.

When those # are removed, it looks like:
conkyweather.th.png

Question1: I cannot see in that bunsenweather.sh (see script here further down) why the city name is not aligned to the left (at least that'd look better I guess).

Question2: For that openweathermap service an api number is needed and that requires registration (on the screenshot it uses the api number from that post in the thread). It looks like it'd be possible to simply get an api number for bunsenweather.sh - consider this option? - Edit: I think this is a bad idea after all, as a registration is not a big deal anyway.

Here is damo's bunsenweather.sh with that api number to test. This script simply works via copy&paste into bunsenweather.sh and using those lines above in the conky.text section. Edit: This script suddenly stopped working for me and I have no idea why. Actually it's working, output might need formatting (printf was commented out).

#!/bin/bash
#
## bunsenweather.sh by <damo> June 2016
## Adapted from bunsenweather.sh, which was based on ideas from 
## weatherbang.sh version 1.0, 2013 by Ryan Fantus
##
## Requires:
##          'jq' (sudo apt-get install jq);
##          API Key from http://openweathermap.org/api
##
## USAGE: Call this script from Conky with ( replace "<t>" with the update interval)
##          ${execpi <t> /path/to/bunsenweather.sh [location]}


#### User configurables:  ##############################################

# Get API KEY by registering for one at http://openweathermap.org/api
#api="your very long api number"
api="cbcdd9a40999d5d68afc55145f756764"
# Either set the location manually here, or by passing it as a script parameter in the Conky.
# "yourlocation" must be a name (which doesn't have spaces), or a numeric id.
#
# id's can be obtained from http://bulk.openweathermap.org/sample/city.list.json.gz
# Download and extract the json file, then simply search for an id with grep. 
#   For example:   grep "New York" city.list.json
#
# If $place is not set, then the script attempts to get a geolocation from the IP address.

place="$1"              # Get $place from script parameter.
#place="yourlocation"   # Uncomment and add name or id. NB If the name has spaces, then you must use the id.

# Choose fahrenheit/Imperial or Celcius/metric:
#metric='imperial'
metric='metric'

#########################################################################
connectiontest() {
    local -i i attempts=${1-0}
    for (( i=0; i < attempts || attempts == 0; i++ )); do
        if wget -O - 'http://ftp.debian.org/debian/README' &> /dev/null; then
            return 0
        fi
        if (( i == attempts - 1 )); then # if last attempt
            return 1
        fi
    done
}

placeholder() {
    if (( $1 == 1 )) &>/dev/null;then
        echo "No internet connection"
        echo "Weather info unavailable"
    else
        echo "No API key"
        echo "Weather info unavailable"
    fi
}

if [[ $metric == metric ]] &>/dev/null;then
    scaleT="°C"
    scaleV="m/s"
else
    scaleT="°F"
    scaleV="mph"
fi

if [[ -z "$api" ]] &>/dev/null;then
    placeholder 0 && exit 1
else
    connectiontest 10
    
    # If latlong is preferred then don't set a value for $place
    if (( $? == 0 )) &>/dev/null;then
        if [[ -z $place ]] &>/dev/null;then
            # Geolocate IP:
            ipinfo=$(curl -s ipinfo.io)
            latlong=$(echo "$ipinfo" | jq -r '.loc')
            # Parse the latitude and longitude
            lat=${latlong%,*}
            long=${latlong#*,}
            location="lat=$lat&lon=$long"
        else
            # check if numeric id, or placename is being used
            [[ ${place##*[!0-9]*} ]] &>/dev/null && location="id=$place" || location="q=$place"
        fi

        # get json data from openweathermap:
        weather=$(curl -s http://api.openweathermap.org/data/2.5/weather\?APPID=$api\&"$location"\&units=$metric)
        city=$(echo "$weather" | jq -r '.name') # In case location has spaces in the name
        weather_desc=$(echo "$weather" | jq -r '.weather[0].description')   # In case description has spaces in the name

        # load values into array:
        all=($(echo "$weather" | jq -r '.coord.lon,.coord.lat,.weather[0].main,.main.temp,.main.pressure,.main.temp_min,.main.temp_max,.wind.speed,.wind.deg,.clouds.all,.sys.sunrise,.sys.sunset'))
        #                   ARRAY INDEX  0          1          2                3          4              5              6              7           8         9           10           11

        longitude=$(printf '%06.1f' ${all[0]})
        latitude=$(printf '%+.1f' ${all[1]})
        condition="${all[2]}"
        temperature=$(printf '%+.1f%s' ${all[3]} $scaleT)
        pressure=$(printf '%.f %s' ${all[4]} mb)
        temperature_min=$(printf '%+.1f%s' ${all[5]} $scaleT)
        temperature_max=$(printf '%+.1f%s' ${all[6]} $scaleT)
        windspeed=$(printf '%.1f %s' ${all[7]} $scaleV)
        winddir=$(printf '%3.f%s' ${all[8]} °)
        cloud_cover=$(printf '%d%s' ${all[9]} %)
        sunrise=$(date -d @${all[10]} +"%R")
        sunset=$(date -d @${all[11]} +"%R")
        description="$weather_desc"
        
        #Example format for output:
        printf "%s; %s; %s %s" "$city" "$temperature" "$windspeed" "$winddir"

    else
        placeholder 1
    fi
fi

exit

I tried bold and not bold and finally ended up using size 10.5 (without bold), like on the screenshot.
Question: Consider 10.5 as an option? Stick to 10 not bold?
Edit: In the script it's now 10 without bold.

Last edited by martix (2018-01-28 20:52:44)

Offline

#15 2018-01-28 15:10:37

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: conky for Helium

martix wrote:

Sidenote: Just noticed that "conky.config = {" and "conky.text = [[" are differnt in the script. In the conky.text section "--" won't work.

The syntax of the Conky1.10 is correct.
conky.config starts with = {
and ends before (TEXT) with };
(is)commented here with --

The text itself is in conky.text = [[
and ends with ]];
(is)commented here with #.

The question is, do you really want Conky1.10? I know about Sector11, he talked to this syntax causes its "problems". The reason for this is that not all the usual 1.9 configurations do not (yet) work with the new syntax.   hmm

Last edited by unklar (2018-01-28 15:23:05)

Offline

#16 2018-01-28 15:14:26

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

@unklar Is it ]]; at the end or supposed to be ];?

Edit: I cannot really comment on Conky1.10 as I'm not familiar with it, just trying to get the script done for the release.

Last edited by martix (2018-01-28 15:29:53)

Offline

#17 2018-01-28 15:22:17

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: conky for Helium

^ Yeah, that's wrong.   wink

Offline

#18 2018-01-28 15:27:47

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

This is really interesting.

Try both conky scripts, the first one in the OP (old syntax) or the new syntax here (they are the same now).

Both scripts have "sans-serif:size=10".

BUT: Using the old syntax, the actual text looks much bigger than the text according the new syntax with the same font size.

Edit: Two more minor things came to my mind: 1. Window title is "BunsenLabs Default Conky" now - I'm not sure it should match some githubs names or is it ok like that?
2. Will be Menu open on pressing the Super key implemented or only as a commented out line?

Last edited by martix (2018-01-28 15:40:45)

Offline

#19 2018-01-28 15:37:19

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: conky for Helium

martix wrote:

Question1: I cannot see in that bunsenweather.sh (see script here further down) why the city name is not aligned to the left (at least that'd look better I guess).

then the line must be so

W E A T H E R
${hr}
${execpi 600 $HOME/conky/bunsenweather.sh}

because the ${alignc} aligns it in "the middle".

Offline

#20 2018-01-28 15:44:52

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: conky for Helium

@unklar Indeed, thank you! It looks like you have a different path, on default its more like "${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}"

Does that script actually work for you (the one from damo posted above)? For me it stopped showing output in conky.

Offline

Board footer

Powered by FluxBB