Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 48

Thread: Easy configuring conky with conkyconf

  1. #11

    Default Re: Easy configuring conky with conkyconf

    Quote Originally Posted by please_try_again View Post
    OK. It was simply missing in conkyweather. I didn't write this program. I think the author, Hardik Mehta, lives in Germany. I use celsius and never paid attention. So I added this feature in conkyweather as well as an option in conkyconf to turn it on. You should update conkyconf and conkyweather.

    To display the temperature in farhrenheit, use the option -F.
    Example: to display weather + weather forecast in F:
    That did it, thanks.

  2. #12

    Default Re: Easy configuring conky with conkyconf

    It seems google weather API is not available anymore. Google is planning to close this awesome service.
    Is it possible to switch for worldweatheronline.com ? Actually, google uses this service.

  3. #13

    Default Re: Easy configuring conky with conkyconf

    Quote Originally Posted by alex_bel View Post
    It seems google weather API is not available anymore. Google is planning to close this awesome service.
    They did already: Google Silently Kills Popular API, Breaks Weather Apps Everywhere | Lifehacker Australia

    Quote Originally Posted by alex_bel View Post
    Is it possible to switch for worldweatheronline.com ? Actually, google uses this service.
    In theory, but people have to register to use this api and get their own key. I'm not sure how many will do that. ... I'll look if I can start something with the rss feed from theweathernetwork.com - not as convenient as an api though.

  4. #14

    Default Re: Easy configuring conky with conkyconf

    OK. I rewrote conkyweather entirely (Actually I wrote it this time. I didn't write the original googleweather, just added some features and packaged it). I guess I can just copy/paste the new package description from the spec file:

    %description
    This new version of conkyweather retrieves weather information from
    theweathernetwork.com and displays it in conky. It has nothing to do
    anymore with the previous version (0.3.2) originally written by Hardik Mehta,
    which used the Google api. A complete rewriting of this script was
    necessary because the Google free api is not available anymore.
    This version doesn't use the conkyweather True Type font but .png icons (which
    requires conky to be compiled with imlib2 support).
    This package still includes the old script, xslt files and patches in a .tgz
    archive, in case somebody would like to try to make them work wit another api.
    This new version downloads and parses the RSS feed (not an api).
    As stated above, this script uses the RSS feed from theweathernetwork.com. It's a good news for Canadians ... I hope it will be acceptable for the rest of the world - maybe not everywhere though.

    Of course I had to do a lot of changes in conkyconf too, but functionality and usage remain the same.

    new options:

    -U --weatherupdate : update interval for weather data in minutes (default: 60)

    changed options:


    -g --geo <location> : doesn't take "City,Country|State|Province" as argument anymore but just a city code.
    Find out your city code on theweathernetwork.com. For example here's the url for Portland, OR:

    Code:
     http://www.theweathernetwork.com/weather/usor0275

    Thus you will use this code usor0275 (and option -F if you want the temperature in Fahrenheit):

    Code:
    conkyconf -wf -g usor0275 -F
    - f --forecast : implies current weather info. -wf is the same as -w.
    The reason is that it is not possible to positionate images relatively in conky - it's certainly possible in lua+cairo, but I don't know how. Therefore I also had to place the weather info at the top (but it looks better IMO).








  5. #15

    Default Re: Easy configuring conky with conkyconf

    Thanks, it does work!!!
    Sorry to bother you, but it seems as we dont have opportunity to get parameters (temperature, humidity, wind etc.) separate. (maybe I'm wrong and there is keys to get it?)
    It would be nice if we can do it like this old way
    ${color0}Temperature: ${goto 100}${color grey60}${execi 5000 /usr/bin/conkyweather -g usor0275 ct}
    ${color0}Conditions: ${goto 100}${color grey60}${execi 5000 /usr/bin/conkyweather -g usor0275 cc}
    ${color0}Humidity: ${goto 100}${color grey60}${execi 5000 /usr/bin/conkyweather -g usor0275 ch}

    So, we have got different color and styles for titles and values.

  6. #16

    Default Re: Easy configuring conky with conkyconf

    Quote Originally Posted by alex_bel View Post
    Thanks, it does work!!!
    Sorry to bother you, but it seems as we dont have opportunity to get parameters (temperature, humidity, wind etc.) separate. (maybe I'm wrong and there is keys to get it?)
    That's right - I'm sorry. I rewrote conkyweahter from scratch. It's a totally different script. It uses only 2 xslt files: weather.xslt and forecast.xslt (located in /usr/share/conkyweather) to parse the output of the RSS feed. I have to admit that using a RSS feed, which is intended to be human readable, is not the best approach. It would more efficient to use a "machine readable" api. But that's all I have to offer for now.


    Quote Originally Posted by alex_bel View Post
    It would be nice if we can do it like this old way
    Code:
    ${color0}Temperature: ${goto 100}${color grey60}${execi 5000 /usr/bin/conkyweather -g usor0275 ct}
    ${color0}Conditions: ${goto 100}${color grey60}${execi 5000 /usr/bin/conkyweather -g usor0275 cc}
    ${color0}Humidity: ${goto 100}${color grey60}${execi 5000 /usr/bin/conkyweather -g usor0275 ch}
    No you can't do that. But the new way is better because ${execi} in conky uses too much resources. This new version calls two lua functions "conky_weather" and "conky_forecast" (you can see them in /etc/conky/conky.lua) Unfortunately, aligning the values with ${goto} doesn't work in lua. I thought it was because the input contained carriage returns (which I removed btw), but it had nothing to do with that. My guess is that it's a bug in lua. It would work if I use two line feeds instead of one, but then it would add blank lines.

    Code:
    ${lua_parse weather usor0275 60 /shome/agnelo /usr/local/share/conkyweather/images C}
    ${lua_parse forecast usor0275 60 /shome/agnelo /usr/local/share/conkyweather/images C}
    where:
    • "weather" is a call to the lua function "conky_weather"
    • "usor0275" is the city code
    • 60 (minutes) is the update interval after which the RSS file will be downloaded again.
    • /shome/agnelo is an alternate location to save this file (here on a file server to avoid downloading it too often on several machines with the same IP and get banned from the site at some point - as it already happened to me with google api.) There is still bug which prevents this from working if the directory is a symlink. I already fixed it but haven't update the package yet.
    • /usr/local/share/conkyweather/images is the directory where the icons are located. I'm posting from ArchLinux right now. On openSUSE, it will be /usr/share/conlyweather/images.
    • "C" means "Celsius". It's the default (see this post: http://forums.opensuse.org/english/o...ml#post2483580)


    Quote Originally Posted by alex_bel View Post
    So, we have got different color and styles for titles and values.
    Actually the default colors for suse in conkyconf are different but very similar.

    Code:
    sus_weather_label_color=DarkOliveGreen3
    sus_weather_color=DarkOliveGreen2
    I'm going to change this default. You can also overwrite these colors in conkyconf:


    Code:
    # You can define some colors here to overwrite the distro themes.
    # You have to define the colors here if the distro colors are not defined!
    # !!! When specifying the color value in hex, omit the leading hash (#) !!! 
    
    #own_window_color=black
    #default_color=white
    #label_color=goldenrod	
    #caption_color=white
    #hr_color=white
    #fs_color=white
    #fs_used_color=red
    #fs_free_color=green
    #weather_label_color=yellow
    weather_color=yellow
    ....
    But conkyconf will be overwritten when the package is updated.

  7. #17

    Default Re: Easy configuring conky with conkyconf

    Thanks for great explanation and your awesome work.

  8. #18
    Join Date
    Jan 2012
    Location
    BC
    Posts
    178

    Default Re: Easy configuring conky with conkyconf

    Conky looks great, I just can't seem to get it running on openSUSE 12.2 KDE 64-bit.

    I created the conkyrc file with:
    Code:
    conkyconf -kwfdNIt -b 22 -e 22 -g cabc0054
    Trying to run conky:
    Code:
    saultdon@opensuse12-2: conky.sh&
    [1] 13403
    saultdon@opensuse12-2:/sys/class/hwmon> Conky: forked to background, pid is 13411
    
    
    Conky: desktop window (20001e9) is subwindow of root window (25f)
    Conky: window type - normal
    Conky: drawing to created window (0x1e00001)
    Conky: drawing to double buffer
    Conky: llua_do_call: function conky_forecast execution failed: /etc/conky/conky.lua:594: bad argument #1 to 'gmatch' (string expected, got nil)
    Conky: can't open '/sys/class/hwmon/hwmon0/temp1_input': No such file or directory
    please check your device or remove this var from Conky
    I couldn't find that temp1_input file but there are a bunch in the 'device' folder:
    Code:
    saultdon@opensuse12-2:/sys/class/hwmon> ls */*
    hwmon0/uevent
    
    
    hwmon0/device:
    driver    name       temp2_crit        temp2_label  temp3_crit_alarm  temp3_max         temp4_input  temp5_crit        temp5_label
    hwmon     power      temp2_crit_alarm  temp2_max    temp3_input       temp4_crit        temp4_label  temp5_crit_alarm  temp5_max
    modalias  subsystem  temp2_input       temp3_crit   temp3_label       temp4_crit_alarm  temp4_max    temp5_input       uevent
    
    
    hwmon0/power:
    async                 control              runtime_active_time  runtime_status          runtime_usage
    autosuspend_delay_ms  runtime_active_kids  runtime_enabled      runtime_suspended_time
    
    
    hwmon0/subsystem:
    hwmon0
    Here are the contents of my .conkyrc file:
    Code:
    saultdon@opensuse12-2:/sys/class/hwmon> cat ~/.conkyrc
    # check http://conky.sourceforge.net/config_settings.html for the list of settings
    # Check http://conky.sourceforge.net/variables.html for the list of variables
    
    
    background yes
    
    
    font 7x13
    # Use Xft?
    use_xft yes
    xftfont Bitstream Vera Sans Mono:size=9
    xftalpha 0.8
    override_utf8_locale no
    short_units
    
    
    update_interval 5
    total_run_times 0
    
    
    own_window yes
    own_window_type normal
    own_window_transparent yes
    own_window_class Conky
    own_window_argb_visual no
    own_window_colour 082103
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    
    
    double_buffer yes
    minimum_size 320 5
    maximum_width 320
    max_text_width 0
    
    
    draw_shades yes
    draw_outline no
    draw_borders no
    draw_graph_borders yes
    stippled_borders 5
    border_inner_margin 0
    border_outer_margin 0
    border_width 1
    
    
    default_color white 
    default_shade_color black 
    default_outline_color black
    color0 PaleGreen
    color1 DarkSeaGreen
    color2 SeaGreen
    color3 GreenYellow
    color4 red
    color5 white
    color6 DarkOliveGreen3
    color7 khaki1
    color8 white
    color9 ForestGreen
    default_bar_size 100 10
    
    
    alignment top_right
    gap_x 8
    gap_y 2 
    
    
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    net_avg_samples 2
    use_spacer none
    
    
    top_name_width 18
    top_cpu_separate false
    
    
    lua_load /etc/conky/conky.lua
    lua_startup_hook init 5
    
    
    TEXT
    ${if_running plasma-desktop}${voffset 35}${endif}${color}${time %a, %d %b %Y, %H:%M:%S} ${goto 190}${color0}Uptime:${color DarkOrange1} ${uptime}
    ${lua_parse weather cabc0054 60 /home/saultdon /usr/share/conkyweather/images C}
    ${lua_parse forecast cabc0054 60 /home/saultdon /usr/share/conkyweather/images C}
    ${color2}${stippled_hr}
    ${color0}Linux Kernel: ${color8}${kernel} on ${machine}
    ${color0}CPU Details:  ${color8}${machine}, $freq(MHz)
    ${color0}CPU1:${offset +4}${lua_parse cpubar 1 ffa500 ffffff}${goto 165}${color0}CPU2:${offset +4}${lua_parse cpubar 2 ffa500 ffffff}
    ${color0}CPU3:${offset +4}${lua_parse cpubar 3 ffa500 ffffff}${goto 165}${color0}CPU4:${offset +4}${lua_parse cpubar 4 ffa500 ffffff}
    ${voffset 3}${color0}RAM used:${color8}${alignr 160} ${mem} ($memperc%)${goto 165}${lua_parse temperature CPU}
    ${color0}Available RAM:${color8}${goto 100}${memmax}${goto 165}${lua_parse temperature MB}
    ${color9}${cpugraph 3dba19 aecf4c -t -l}
    #
    #
    ${if_up eth0}${voffset 3}${color1}Network ${color}($nodename) ${color2}${hr}
     ${color}eth0: ${color0}Down:${color yellow1} ${downspeed eth0}/s${color0}${goto 190}Up:${color OrangeRed1} ${upspeed eth0}/s
     ${color9}${downspeedgraph eth0 24,150 000000 91ec31} ${color9}${upspeedgraph eth0 24,150 000000 ec3131}
     ${color0}LAN IP: ${color}${goto 60}${addr eth0}${if_gw}${goto 180}${color0} gw: ${goto 215}${color}${gw_ip}
     ${color0}WAN IP: ${color4}${goto 60}${lua_parse wanip 600 }$endif${goto 180}${color0}dns: ${goto 215}${color}${nameserver}${endif}
    ${voffset 3}${color1}File Systems ${color2}${hr}
    ${lua_parse fs /windows/C /windows/C sda1 7fff00 white}
    ${lua_parse fs / / sda6 7fff00 white}
    ${lua_parse fs /home /home sda7 7fff00 white}
    ${lua_parse fs /windows/D /windows/D sdb1 7fff00 white}
    #
    ${voffset 3}${color1}Processes:${color} ${processes}  ${color1}Running:${color red1} ${running_processes} ${color2}${hr 1}
    ${alignc}${color0}(top 5 sorted by CPU usage)
    ${color0}NAME${alignr 110}PID${alignr 60}CPU%${alignr 20}MEM%
    ${lua_parse top cpu 1}
    ${lua_parse top cpu 2}
    ${lua_parse top cpu 3}
    ${lua_parse top cpu 4}
    ${lua_parse top cpu 5}
    ${alignc}${color0}(top 3 sorted by MEM usage)
    ${color0}NAME${alignr 110}PID${alignr 60}CPU%${alignr 20}MEM%
    ${lua_parse top mem 1}
    ${lua_parse top mem 2}
    ${lua_parse top mem 3}
    #
    #
    ${voffset 3}${color1}Tcp connections: ${color5}${tcp_portmon 22 22 count} ${color6}(top 5)${color2}${hr}
    ${lua_parse tcpmon 22 22 0}
    ${lua_parse tcpmon 22 22 1}
    ${lua_parse tcpmon 22 22 2}
    ${lua_parse tcpmon 22 22 3}
    ${lua_parse tcpmon 22 22 4}
    ${voffset -3}${color2}${hr 1}
    I'm not sure what I need to change in my conky.lua file. I've pasted it's contents at SUSE Paste.

    Thought these lines look interesting:
    Code:
    -- CPU and mainboard temperature
    function conky_temperature (sensor)
            local t = ""
            if ( sensor == "CPU" ) then t = CPU     else t = MB end
            if ( t == nil ) then
                    if ( sensor == "CPU" ) then t = "${color0}Temperature: ${color}${alignr}${hwmon temp 1}" .. DEG else t = "" end
            else
                    t = t .. DEG
            end
            return t
    end
    Should I change "${hwmon temp 1}" to "${hwmon0 temp 2}"?

  9. #19
    Join Date
    Jan 2012
    Location
    BC
    Posts
    178

    Default Re: Easy configuring conky with conkyconf

    I got it running on my laptop that's also running 12.2 KDE - 64bit but they both output that conky_forecast error:

    Code:
    Conky: llua_do_call: function conky_forecast execution failed: /etc/conky/conky.lua:594: bad argument #1 to 'gmatch' (string expected, got nil)

  10. #20

    Default Re: Easy configuring conky with conkyconf

    Quote Originally Posted by saultdon View Post
    Conky looks great, I just can't seem to get it running on openSUSE 12.2 KDE 64-bit.

    I created the conkyrc file with:
    Code:
    conkyconf -kwfdNIt -b 22 -e 22 -g cabc0054
    Sounds good. But looking at your .conkyrc, I noticed that option -N had no effect. It should have written something like this:


    Code:
    ${if_match "${nvidia temp}" != "N/A"}${voffset 3}${color1}Nvidia Gfx card ${color2}${hr}
    ${color0}GPU Frequency:${color8}${goto 110}${nvidia gpufreq} Mhz ${lua_parse gputemp temp}
    ${color0}Mem Frequency:${color8}${goto 110}${nvidia memfreq} Mhz${goto 165}${color0}Image quality:${color8}${alignr}${nvidia imagequality}${else}${voffset -15}${endif}
    Thus it makes me wonder if you are using the nvidia proprietary driver, if the module is loaded and if the conky version you're using has nvidia support. It's not related with the other issues though. Did you install conky from my repo?

    Code:
    # conky -v
    Conky 1.9.0 compiled Fri Jun 22 01:27:06 UTC 2012 for Linux 3.1.9-1.4-default (x86_64)
    
    Compiled in features:
    
    System config file: /etc/conky/conky.conf
    Package library path: /usr/lib64/conky
    
     X11:
      * Xdamage extension
      * XDBE (double buffer extension)
      * Xft
      * ARGB visual
    
     Music detection:
      * MPD
      * MOC
    
     General:
      * math
      * hddtemp
      * portmon
      * Curl
      * RSS
      * wireless
      * nvidia
      * config-output
      * Imlib2
      * apcupsd
      * iostats
      * ncurses
      * Lua
    
      Lua bindings:
       * Cairo
       * Imlib2

    Quote Originally Posted by saultdon View Post

    Trying to run conky:
    Code:
    saultdon@opensuse12-2: conky.sh&
    [1] 13403
    saultdon@opensuse12-2:/sys/class/hwmon> Conky: forked to background, pid is 13411
    
    Conky: desktop window (20001e9) is subwindow of root window (25f)
    Conky: window type - normal
    Conky: drawing to created window (0x1e00001)
    Conky: drawing to double buffer
    Conky: llua_do_call: function conky_forecast execution failed: /etc/conky/conky.lua:594: bad argument #1 to 'gmatch' (string expected, got nil)
    Conky: can't open '/sys/class/hwmon/hwmon0/temp1_input': No such file or directory
    please check your device or remove this var from Conky
    The first error looks like a bug in the lua script. I was able to reproduce it with your .conkyrc. Will try to fix it.
    The second problem is tricky. Those sensors are organized differently on each mainboard. I also have machines where they will occasionally change names (more precisely numbers). I'm not sure I can fix it in a generic fashion. I'm not sure it's doable with scripting actually. OK, it's doable but ... not today.


    Quote Originally Posted by saultdon View Post
    Thought these lines look interesting:
    Code:
    -- CPU and mainboard temperature
    function conky_temperature (sensor)
            local t = ""
            if ( sensor == "CPU" ) then t = CPU     else t = MB end
            if ( t == nil ) then
                    if ( sensor == "CPU" ) then t = "${color0}Temperature: ${color}${alignr}${hwmon temp 1}" .. DEG else t = "" end
            else
                    t = t .. DEG
            end
            return t
    end
    Should I change "${hwmon temp 1}" to "${hwmon0 temp 2}"?
    Yes or to something else. But that's it. Make a copy of /etc/conky/conky.lua because it will be overwritten by the next update.

Page 2 of 5 FirstFirst 1234 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •