You are not logged in.

#26 2018-01-28 22:42:50

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: conky for Helium

The script from #14 doesn't work for me.
However, this one fine

bl-orig-default9.th.jpg

# conky1.9 configuration   
	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 BunsenLabs Default Conky
	own_window_argb_visual yes

	minimum_size 200 0 
	maximum_width 200

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

	alignment top_left

	use_xft yes
#font Liberation Mono:bold:size=10
#font Liberation Sans:size=10
	font Sans-serif:size=10
	xftalpha 1
	override_utf8_locale yes

	uppercase no
  
	draw_shades no
	default_shade_color 000000

	draw_outline no
	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	
  
	draw_borders no
	stippled_borders 5
	border_inner_margin 5
	border_outer_margin 0
	border_width 2

	draw_graph_borders no
	background yes
	use_spacer none
	no_buffers yes
	short_units yes
	imlib_cache_size 0
	double_buffer yes
	update_interval 1


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}
Root usage:$alignr${fs_used /} / ${fs_size /}
Home usage:$alignr${fs_used /home} / ${fs_size /home}
CPU Average:${alignr}${cpu cpu0}%

B U N S E N   W E A T H E R
${hr}
${execpi 600 $HOME/.conky/bl-conky/orig_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
#!/bin/bash
#
## bunsenweather.sh by <damo> June 2016
## 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> $HOME/.config/conky/scripts/bunsenweather.sh [location]}


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

# Get API KEY by registering for one at http://openweathermap.org/api
api="cbcdd9a40999d5d68afc55145f756764"

# Either set the location manually here, or by passing it as a script parameter in the Conky
place="$1"
place="Dresden"

# Choose fahrenheit/Imperial or Celcius/metric:
#metric='imperial' && unit='F'
metric='metric' && unit='C'

########################################################################
# If latlong is preferred then don't set a value for $place
if [[ -z $place ]];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
    location="q=$place"
fi

weather=$(curl -s http://api.openweathermap.org/data/2.5/weather\?APPID\=$api\&$location\&units\=${metric})
### TODO: better to try and put the output into a jq array, to reduce the processes :/ ###
city=$(echo $weather | jq -r '.name')
temperature=$(printf '%.0f' $(echo $weather | jq '.main.temp'))
condition=$(echo $weather | jq -r '.weather[0].main')
wind=$(echo $weather | jq '.wind.speed')
winddir=$(echo $weather | jq '.wind.deg')
humidity=$(echo $weather | jq '.main.humidity')
pressure=$(echo $weather | jq '.main.pressure') 

# Format the output with printf
printf "%s: %s\n\${goto 5}Wind: %d m/s, from %.3d°\n\${goto 5}Temp: %d°C\n\${goto 5}Humidity: %d%%\n\${goto 5}Pressure: %d hPa" "$city" "$condition" "$wind" "$winddir" "$temperature" "$humidity%" "$pressure" 2>/dev/null

exit

(provisional with conky1.9)  big_smile

Offline

#27 2018-01-29 02:52:44

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

martix wrote:

Question: Use Disk (and Swap) usage as default and commented-out Root usage and Home usage?

Disk + Swap sounds good, with alternatives commented out.

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

Right: https://github.com/brndnmtthws/conky/wi … .10-syntax

Edit: In the script it's now 10 without bold.

OK

martix wrote:

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.

The new conky (1.10) will try to interpret old style conky files, but as you see, it won't always be exactly right. Let's move on to the 1.10 syntax, at least for default BunsenLabs files.

- sans-serif - making slightly bigger as new syntax uses smaller letters?

I thought 'Sans-serif:size=10' looked OK in new syntax. I like the rather low-key conky, but... other opinions?

Will be Menu open on pressing the Super key implemented or only as a commented out line?

This is on the todo list, so might well be implemented, but let's comment it out until it actually arrives.

martix wrote:

- Disk usage implemented, Root usage and Home usage commented out.

Add Swap too?

- Damo's bunsenweather.sh script is working, output might need formatting, (commented out) bunsenweather.sh line not added yet
- Shipping with api number in bunsenweather.sh - consider or not? In this case removing "#" would get bunsenweather working (as it uses ipinfo.io and gets location according to that)

How reliable is bunsenweather.sh, and which is now the definitive version? Damo made a number of improvements to his script - is it OK, or still needs work? Anyway it looks as if the currently shipped script ( https://github.com/BunsenLabs/bunsen-co … weather.sh ) no longer works.

I think we have three options for weather in default Helium:

1) If it now works OK (more testing?) then replace the old script, add the entry in the default conky, and display a small weather item by default.
2) If it has to be tweaked by the user to work properly, then add the new script, but comment out the entry in the conky.text section, and add a comment to the file as to what to do to make it work.
3) Remove everything, and just add a comment in the conky file with a link to the forum topic.

I'm personally OK with any of the above, but other opinions...?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#28 2018-01-29 07:50:22

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

Re: conky for Helium

unklar wrote:

The script from #14 doesn't work for me.
(provisional with conky1.9)  big_smile

Thank you @unklar for the feedback.

Slowly I'm starting to understand this bunsenweather script. This working script you mentioned was basically damo's first version with api key.

Originally in the shipped bunsenweather script there was no need for an api key, but openweathermap.org changed its service. It was required that users register and get an api key to use with service.  The original - shipped - script needed some tweaking and it is what I called above damo's first version with api key.

In this version there is a remark: "### TODO: better to try and put the output into a jq array, to reduce the processes hmm ###"

The script from #14 is damo's improved version with arrays and internet connection checking.

This script tries to connect to http://ftp.debian.org/debian/README. If there is a connection, it shows the weather data, otherwise a message: "No internet connection" "Weather information unavailable" (I changed it to info because the text was too wide for the conky).

It also checks if there is a required api key. If not, the message is: "No API key" "Weather info unavailable".

Formatting of the output: This line in the improved code

printf "Location:%s\nTemp: %s\nWind %s from %s\n" "$city" "$temperature" "$windspeed" "$winddir"

produces this output:
conkyimprovedweatherconky1.th.png

And this:

printf "%s: %s\n\${voffset 10}Wind: %d m/s, from %.3d°\nTemp:\${color red} %d°c\${color}" "$city" "$condition" "$windspeed" "$winddir" "$temperature" 2>/dev/null

looks like this:
conkyimprovedweatherconky2.th.png


As mentioned above, this improved version of the script works for me. Feedback appreciated (it looks like it slows down starting conky a bit if there is no internet connection). Edit: Just a clarifications for new users: It's about simply pasting this script into ~/.config/conky/scripts/bunsenweather.sh and replace the original script there.

#!/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 "Location: %s\nTemp: %s\nWind %s from %s\n" "$city" "$temperature" "$windspeed" "$winddir"

    else
        placeholder 1
    fi
fi

exit

This goes into conkyrc under conky.text (600 means update interval 600 seconds) to call the script:

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

Last edited by martix (2018-01-29 15:26:24)

Offline

#29 2018-01-29 08:28:35

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

Re: conky for Helium

johnraff wrote:

Disk + Swap sounds good, with alternatives commented out.

Done.

johnraff wrote:

Let's move on to the 1.10 syntax, at least for default BunsenLabs files.
I thought 'Sans-serif:size=10' looked OK in new syntax. I like the rather low-key conky, but... other opinions?

Yeah, that's fine by me with 1.10 syntax. What I meant is that the old conky using font size 9 was bigger than the new syntax conky with font size 10, because of the font size issue mentioned.

Now it is sans-serif 10, which looks ok, but the font size is considerably smaller than it used to be. This is why I mentioned making it a bit bigger using size 10.5, but I'm not sure how it looks on other screens. On my notebook 10.5 is better to read than 10.

johnraff wrote:

Add Swap too?

Yep, swap is there on default.

johnraff wrote:

How reliable is bunsenweather.sh, and which is now the definitive version? Damo made a number of improvements to his script - is it OK, or still needs work? Anyway it looks as if the currently shipped script ( https://github.com/BunsenLabs/bunsen-co … weather.sh ) no longer works.

Indeed, it was a version without api key.

I think there is no definitive version, but at least the script at the end of this post was damo's last - updated - version. It looks like this bunsenweather script did not draw much attention so far.

The script works for me, but there is more feedback needed.

johnraff wrote:

I think we have three options for weather in default Helium:
2) If it has to be tweaked by the user to work properly, then add the new script, but comment out the entry in the conky.text section, and add a comment to the file as to what to do to make it work.

I'd say go for this option. Make a commented out entry in conky.text with a short description. bunsenweather.sh works out-of-the-box,IF it is shipped together with an api key (which requires a registration on openweathermap.org; the api key above in the post goes back to bra10n's post).

Basically it looks good, script is working, code is ready for conky.text, if the user will remove the # from those three bunsenweather lines, there will be a weather conky.

Offline

#30 2018-01-29 08:59:16

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

Re: conky for Helium

What about having this Weather format on default in the bunsenweather script?

conkyweatherformat.th.png

Sorry about those screenshot posts above, should've cut off the shortcuts.

Edit: I can confirm that with the activated Weather conky it starts slowly without internet connection. It takes some seconds till the conky appeares. Otherwise it works fine so far, update interval works, it's getting correct data.

As a sidenote: For weather don't forget the good old terminal

curl -4 wttr.in/bunsen

Edit II: There is one more cool feature of bunsenweather.sh. There is no need to edit bunsenweather.sh (the script above in post #28), in order to get the weather for whatever city the user wants. Using simply this line with "yourlocation" in the conky.text section works fine (let's try an example as a tribute for the creator of the script):

${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh "damo"}

conkyweather4.th.png

Last edited by martix (2018-01-29 12:12:02)

Offline

#31 2018-01-29 13:04:21

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: conky for Helium

#28

Now it works. Nevertheless, there are mistakes.

-IP-Localisation deviates from 150 - 200 km

[unklar@archhost ~]$ conky: desktop window (2000012) is subwindow of root window (4d5)
conky: window type - normal
conky: drawing to created window (0x3800002)
conky: drawing to double buffer
conky: forked to background, pid is 3781

/home/unklar/conky/bunsenweather.sh: Zeile 96: printf: 13.74: Ungültige Zahl.
/home/unklar/conky/bunsenweather.sh: Zeile 97: printf: 51.05: Ungültige Zahl.
/home/unklar/conky/bunsenweather.sh: Zeile 103: printf: 7.2: Ungültige Zahl.

-windspeed is not displayed
-no change even if the city is specified

bl-NEUdefault10.th.jpg

martix wrote:

Edit: I can confirm that with the activated Weather conky it starts slowly without internet connection. It takes some seconds till the conky appeares.

Of course the script has to collect the data first.
So that's normal.

Offline

#32 2018-01-29 15:07:53

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

Re: conky for Helium

^That's strange. I just tried

${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh "dresden"}

and it looks good here:
conkyweatherd.th.png

I have the script from #28.

Offline

#33 2018-01-30 05:38:42

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

Confirmed, Damo's script works for me, either passing "Nagoya" (or other cities) in the execpi line, or letting it figure it out from the IP.
I also added "humidity" by extending the array by one element. The info is there anyway.

Still, users will have to edit the script to paste in an API KEY. I "borrowed" the one posted by bra10n, but we can't exactly enable that by default - all the new BL Helium users would be hitting that account and it would soon be closed, so let's leave weather commented out in the conky we ship.

Here's my script with humidity:

#!/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 information unavailable"
    else
        echo "No API key"
        echo "Weather information 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,.main.humidity'))
        #                   ARRAY INDEX  0          1          2                3          4              5              6              7           8         9           10           11          12

        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")
        humidity="${all[12]}"
        description="$weather_desc"
        
        #Example format for output:
        #printf "%s; %s; %s %s" "$city" "$temperature" "$windspeed" "$winddir"
        printf "%s: %s\nTemp: %s\nHumidity: %s%%\nWind %s from %s\n" "$city" "$description" "$temperature" "$humidity" "$windspeed" "$winddir"

    else
        placeholder 1
    fi
fi

exit

And screenshot (not passing city name): bKGgAbnm.png


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#34 2018-01-30 08:49:02

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

Re: conky for Helium

^It's been working fine here too. Sometimes I got null:null for city when it stopped working for some reason, but it happened just once in a while. 

@johnraff Did you use the new syntax for the conky on the screenshot? On a 12" machine this conky covers for me a smaller area, less than 2/3 of the screen heigth with font size 10 (but it's still good readable). With size 10 "Weather information unavailable" fits the width. The default conky supposed to have one line less (as /home was commented out).

Humidity is a good idea. Actually I looked for it in the script but did not check the api description. Btw "Wind" could be removed on default as for the average user the data may not mean much.

So what about adding the following to conky.text between the System info and the Shortcuts:

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

Offline

#35 2018-01-30 08:58:27

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

martix wrote:

@johnraff Did you use the new syntax for the conky on the screenshot?

Pretty much what you posted, yes the 1.10 version, but I may have missed the last couple of changes.

Btw "Wind" could be removed on default as for the average user the data may not mean much.

Agreed.


So what about adding the following to conky.text between the System info and the Shortcuts:

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

Looks good.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#36 2018-01-30 09:21:14

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

Re: conky for Helium

Ok, new syntax script is in #11, Weather conky added. It is also added to the old syntax script in the OP.

Double check:
- Spacing between the System Info and the Shortcut Keys sections (currently it's one empty line)
- Spacing above System Info (currently no empty line)
- If Menu-open-on-super will be implemented, this should be in the Shortcut Keys too.
- Remove API Key from bunsenweather.sh, remove Wind.

It looks good then. I may add that Sector 11 and damo made awesome work here as there were only a few minor changes to their scripts, otherwise everything has been working fine.

Edit: One minor thing that came to my mind: What is the way the default conky starts? Is it "conky -c ~/.conkyrc" (from conky-sessionfile)? Just because there is now  pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc"  but it'd be good to have a version which actually kills the default conky (that might be pkill -xf "conky -c $HOME/.conkyrc". I guess the "-q" is only relevant for starting the conky as it won't have output in the terminal (as unklar mentioned "quiet").

Last edited by martix (2018-01-30 09:36:07)

Offline

#37 2018-01-30 16:45:08

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: conky for Helium

martix wrote:

Edit: One minor thing that came to my mind: What is the way the default conky starts? Is it "conky -c ~/.conkyrc" (from conky-sessionfile)? Just because there is now  pkill -xf "conky -q -c $HOME/.config/conky/BL-Default.conkyrc"  but it'd be good to have a version which actually kills the default conky (that might be pkill -xf "conky -c $HOME/.conkyrc". I guess the "-q" is only relevant for starting the conky as it won't have output in the terminal (as unklar mentioned "quiet").

Since usually the start with

conky -c ~/path/too/conkyrc &

has taken place, is

pkill -xf "conky -c /home/user/path/too/conkyrc" &

right.   wink

Offline

#38 2018-01-30 17:06:03

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

Re: conky for Helium

@unklar Johnraff mentioned that using the ampersand & is not necessary, it's removed from the script too.

Otherwise that's correct, just like it says in the script "IF you used what is between the quotes to start the conky", i.e. there must be the exact same switches (and "-q" is also relevant for closing, not like I mentioned above!). Just tried it: Starting with -c -q won't get closed using only conky -c in the pkill command.

Offline

#39 2018-01-31 02:58:08

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

martix wrote:

Double check:
- Spacing between the System Info and the Shortcut Keys sections (currently it's one empty line)

Looks good.

- Spacing above System Info (currently no empty line)

Fine. There's no need for an empty space at the top of the conky. Positioning on the screen can be set by gap_y and gap_x.

- If Menu-open-on-super will be implemented, this should be in the Shortcut Keys too.
- Remove API Key from bunsenweather.sh, remove Wind.

I'll do those.

What is the way the default conky starts?

You can check all the currently running conkys with

pgrep -a conky

It looks as if the -q option is not being used at the moment.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#40 2018-01-31 04:00:25

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

Re: conky for Helium

^Indeed, -q for killing a conky is only relevant, if someone used it before like

conky -c -q ~/.config/conky/BL-Left.conkyrc

pkill -xf " " won't work in this case, if there is no -q in the quotes (ie between the " " has to be the same as the conky start command). Hence killing the default conky works for me via

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

What I just realized is that the part recently added to the script

# BunsenLabs conky scripts help
# Openbox Menu/Preferences/Conky/Conky Manager Help

is - as it says - a help with "Conky Manager", which is actually "Openbox Menu/Preferences/Conky/Conky Chooser".

This Conky Chooser is an awesome little tool (created by damo) and it is the script /usr/bin/bl-conkyzen.

Conky Manager=Conky Chooser=bl-conkyzen - this might be a bit confusing for new users (especially as in the help it's about a Conky Manager and no word about "Conky Chooser". Btw it can be started also via terminal

bl-conkyzen

Last edited by martix (2018-01-31 04:01:33)

Offline

#41 2018-01-31 04:23:49

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

martix wrote:

This Conky Chooser is an awesome little tool (created by damo)

Yes!

Conky Manager=Conky Chooser=bl-conkyzen - this might be a bit confusing for new users (especially as in the help it's about a Conky Manager and no word about "Conky Chooser".

Agreed, but I had nothing to do with this. (It took me a while to figure out what conkyzen was.) It might be a bit late for a major renaming just now...


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#42 2018-01-31 04:32:29

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

Re: conky for Helium

^Yeah, that's true. Room for future improvements though.

Just discovered BL-Ellipses-Time.conkyrc via Conky Chooser and it's really cool.

Offline

#43 2018-02-01 02:36:07

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

One question: about ARGB visuals:

conkyrc wrote:

-- This option will not work as desired (in most cases) in conjunction with
-- own_window_type normal,

Is this still true (if it ever was)?
Especially considering the next section says:

-- When ARGB visuals are enabled, use this to modify the alpha value
-- Use: own_window_type = 'normal'

Remove the first comment about not working? (It's always worked OK for me anyway.)

Also, maybe set the commented-out argb transparency to '--own_window_argb_value = 50,' just to keep it the same as Sector11's original choice? EDIT I see in another file '150' so I guess that's OK.

Last edited by johnraff (2018-02-01 02:59:29)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#44 2018-02-01 11:47:53

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

Re: conky for Helium

^I can confirm that it works fine here too.

It looks like it's been a copy&paste mess up as it should be "This option will not work as desired (in most cases) in conjunction with 'own_window_type override'." (from conky manual). There are some minor mistakes in that part ("are enabled, this use this to modify", there is a "," missing from the end of the window type normal line, etc.). Here is a newer version - how does it look?

-- 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 ARGB: own_window_type = 'normal',
-- Use with ARGB: 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,

It might be considered to add one more line to the intro (as Conky Chooser and that Help belong together):

 BunsenLabs conky scripts help
 Openbox Menu/Preferences/Conky/Conky Chooser
 Openbox Menu/Preferences/Conky/Conky Manager Help

For future releases wttr.in could be also used. Just a one liner displays a nice output.

Offline

#45 2018-02-02 06:49:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

martix wrote:
-- 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 ARGB: own_window_type = 'normal',
-- Use with ARGB: 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,

Looks good, except how about:

-- Use with: own_window_type = 'normal',
-- Use with: own_window_transparent = false,

That "ARGB:" might be confusing?

It might be considered to add one more line to the intro (as Conky Chooser and that Help belong together):

 BunsenLabs conky scripts help
 Openbox Menu/Preferences/Conky/Conky Chooser
 Openbox Menu/Preferences/Conky/Conky Manager Help

Actually, if you look at the "Conky Manager Help" it's not only about Conky Chooser/bl-conkyzen but describes the whole set of conky management scripts, so maybe it's OK how it is?

For future releases wttr.in could be also used. Just a one liner displays a nice output.

If the conky people here come up with something, then sure, it has the advantage of working out of the box, so could just go in as default. Maybe with comments explaining about the alternative. Something for Lithium. smile


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#46 2018-02-02 07:39:45

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

Re: conky for Helium

Ok, updated in #11 and old syntax in the OP as suggested. Apart from the things mentioned I cannot think of anything else to change right now. This is how it looks:

--[[ 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
]];

Offline

#47 2018-02-02 08:01:03

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

Great! I'll upload that to GitHub tomorrow and we've got one item less on the Helium TODO. cool


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#48 2018-02-03 00:29:11

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,336
Website

Re: conky for Helium

The new .conkyrc is in bunsen-configs here:
https://github.com/BunsenLabs/bunsen-co … l/.conkyrc
and in bunsen-conky here:
https://github.com/BunsenLabs/bunsen-co … lt.conkyrc
(I took the liberty of adding a couple of empty lines and adjusting indenting in a couple of places.)

Damo's bunsenweather script is here:
https://github.com/BunsenLabs/bunsen-co … weather.sh

That all looks OK?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#49 2018-02-03 09:30:52

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

Re: conky for Helium

Checked it and it looks good.

Using an API-key works fine too, weather info looks great.

Offline

Board footer

Powered by FluxBB