Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: HOWTO: Conky Multi-Desktop Configuration.

  1. #11
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: HOWTO: Conky Multi-Desktop Configuration.

    @mrpeachy

    That seems like the best way to do it to me too.
    Sounds like the right advice for non-LUA scripts as well.

    I have 3 monitors with the center one shared with a KVM switch between two computers and the other two each connected to one of the computers.
    I am only using ${desktop} right now so I know what workspace I am in on each computer when the center monitor is showing a different computer than the monitor the conky is on.

  2. #12
    Join Date
    Apr 2007
    Beans
    195

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by arclance View Post
    ${desktop} returns numbers (1, 2, 3, 4, etc.) when using Fluxbox in Ubuntu 11.04.
    So your standard method works with one modification in Fluxbox.
    You need to use ${desktop}==1 instead of ${desktop}=1.
    == is the normal comparison operator in programing languages because = is used for assignment operations, so this makes sense.

    It is also consistent with the conky documentation for ${if_match}.
    Code:
    Evaluates the given boolean expression, printing everything between $if_match and 
    the matching $endif depending on whether the evaluation returns true or not. Valid
    expressions consist of a left side, an operator and a right side. Left and right sides are
    being parsed for contained text objects before evaluation. Recognised left and right side
    types are:
    
    
    • double - Argument consists of only digits and a single dot.
    • long - Argument consists of only digits.
    • string - Argument is enclosed in quotation marks (")
    Valid operands are: '>', '<', '>=','<=', '==','!='.
    Here is the code I used for a test.
    Code:
    ${if_match ${desktop}==1}
    Workspace 1!
    ${else}${if_match ${desktop}==2}
    Workspace 2!
    ${else}${if_match ${desktop}==3}
    Workspace 3!
    ${else}${if_match ${desktop}==4}
    Workspace 4!
    ${else}
    ${endif}${endif}${endif}${endif}
    Excellent, thank you arclance! I shall append the known window managers in the howto to include Fluxbox. Indeed, it is nice to know it uses the standard comparison operator. XFCE4 (MY standard Window Manager) just needs the one equal sign to get it to work. So, I thank you immensely for testing an alternate for me.

    @mrpeachy, I figured you'd step in on this one. As you know rather well, I'm not all-knowing of the ways of LUA. I only have very basic stuff in my repertoire.

    Question though. Are you referring to changing which functions in Lua are displayed in Conky, depending on which workspace you're on? Or are you referring to changing what the already loaded functions do depending on which workspace you're on?

    The way I see it working, this Multi-Desktop thing, is that in order to get everything to line up properly every time, the entire script you want there in that workspace has to be lined up in a single if_match case. You don't want every little section that changes to be making it's own decisions, you want the entire script to be run at once when the desktop/workspace/veiwport/whatever your WM Calls It changes or is different.

    In LUA, if you don't want one element of the function to run, you leave an "if desknum==x" wrapped around it so it doesn't run unless that's there. I know, however, that certain functions may or may not like that. Hence why I need a LUA consultant on this.

  3. #13
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by 42dorian View Post
    Excellent, thank you arclance! I shall append the known window managers in the howto to include Fluxbox. Indeed, it is nice to know it uses the standard comparison operator. XFCE4 (MY standard Window Manager) just needs the one equal sign to get it to work. So, I thank you immensely for testing an alternate for me.
    Your welcome.
    Out of curiosity what happens if you try ${desktop}== in XFCE4?

    I will also give you some advice on conky if statements that I have not seen mentioned anywhere else.
    When using ${if_running} I discovered that if you want to insert blank lines with an if statement in conky each line must have at least one space on it or conky ignores them.

  4. #14
    Join Date
    Apr 2007
    Beans
    195

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by arclance View Post
    Your welcome.
    Out of curiosity what happens if you try ${desktop}== in XFCE4?

    I will also give you some advice on conky if statements that I have not seen mentioned anywhere else.
    When using ${if_running} I discovered that if you want to insert blank lines with an if statement in conky each line must have at least one space on it or conky ignores them.
    In XFCE4 it accepts one or two equal signs with no difference. ACTUAL operations require the double equal, but not for the ${desktop} variable apparently.

    You haven't seen it mentioned anywhere because, really, no one uses an If statement in that way. It hasn't been used, so it hasn't really come up before. In the case of the Multi-Desktop setup, there may well be desktops where you don't want Conky at all, and having absolutely nothing in the If statement for that workstation, although it hasn't been tested on every window manager yet, may well just turn Conky off. Leaving either nothing on that desktop, Or, as I theorise, it will leave an empty square/rectangle where Conky would be.

  5. #15
    Join Date
    Dec 2008
    Location
    The Desert
    Beans
    281
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Code:
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 0,0  WA: 0,1 1280x799  Workspace 1
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 1280,0  WA: 0,1 1280x799  Workspace 1
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 2560,0  WA: 0,1 1280x799  Workspace 1
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 3840,0  WA: 0,1 1280x799  Workspace 1
    heres my smctrl -d. workin on the different viewports
    ok I get this error on gnome
    Code:
    jyoung4@Daniels-computer:~$ conky -c ~/.conkyrc2
    Conky: forked to background, pid is 3342
    djyoung4@Daniels-computer:~$ 
    Conky: desktop window (1e000a9) is subwindow of root window (ad)
    Conky: drawing to desktop window
    Conky: drawing to double buffer
    Conky: Bad arguments: '* ' and ' 1280'
    Conky: compare failed for expression '* == 1280'
    Conky: Bad arguments: '* ' and ' 1280'
    Conky: compare failed for expression '* == 1280'
    heres my code
    Code:
    # Conky sample configuration
    #USAZ0233, USHI0026
    # 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.
    
    # set to yes if you want Conky to be forked in the background
    background yes
    
    # X font when Xft is disabled, you can pick one with program xfontsel
    #font 5x7
    #font 6x10
    #font 7x13
    #font 8x13
    #font 9x15
    #font *mintsmild.se*
    #font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
    
    # Use Xft?
    use_xft yes
    
    # Xft font when Xft is enabled
    xftfont Deja Vu Sans Mono:size=18
    
    # Text alpha when using Xft
    xftalpha 0.8
    
    # Print everything to stdout?
    # out_to_console no
    
    # MPD host/port
    # mpd_host localhost
    # mpd_port 6600
    # mpd_password tinker_bell
    
    # Print everything to console?
    # out_to_console no
    
    # mail spool
    mail_spool $MAIL
    
    # Update interval in seconds
    update_interval 1
    
    # This is the number of times Conky will update before quitting.
    # Set to zero to run forever.
    total_run_times 0
    
    # Create own window instead of using desktop (required in nautilus)
    own_window no
    
    # If own_window is yes, you may use type normal, desktop or override
    own_window_type desktop
    
    # Use pseudo transparency with own_window?
    own_window_transparent yes
    
    # If own_window_transparent is set to no, you can set the background colour here
    own_window_colour black
    
    # If own_window is yes, these window manager hints may be used
    #own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    
    # Use double buffering (reduces flicker, may not work for everyone)
    double_buffer yes
    
    # Minimum size of text area
    minimum_size 280 5
    
    # Maximum width
    maximum_width 10000
    
    # Draw shades?
    draw_shades no
    
    # Draw outlines?
    draw_outline no
    
    # Draw borders around text
    draw_borders no
    
    # Draw borders around graphs
    draw_graph_borders no
    
    # Stippled borders?
    stippled_borders 8
    
    # border margins
    border_inner_margin 4
    
    # border width
    border_width 1
    
    # Default colors and also border colors
    default_color black
    #default_shade_color black
    #default_outline_color black
    
    # Text alignment, other possible values are commented
    alignment top_left
    #alignment top_right
    #alignment bottom_left
    #alignment bottom_right
    #alignment top_middle
    #alignment bottom_middle
    #alignment none
    
    # Gap between borders of screen and text
    # same thing as passing -x at command line
    gap_x 20
    gap_y 1
    
    # Subtract file system buffers from used memory?
    no_buffers yes
    
    # set to yes if you want all text to be in uppercase
    uppercase no
    
    # number of cpu samples to average
    # set to 1 to disable averaging
    cpu_avg_samples 2
    
    # number of net samples to average
    # set to 1 to disable averaging
    net_avg_samples 2
    
    # Force UTF8? note that UTF8 support required XFT
    override_utf8_locale yes
    
    # Add spaces to keep things from moving about?  This only affects certain objects.
    use_spacer none
    
    # Shows the maximum value in scaled graphs.
    show_graph_scale no
    
    # Shows the time range covered by a graph.
    show_graph_range no
    
    # Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
    #max_port_monitor_connections 256
    
    # Maximum number of special things, e.g. fonts, offsets, aligns, etc.
    #max_specials 512
    
    # Maximum size of buffer for user text, i.e. below TEXT line.
    max_user_text 16384
    
    # Timing interval for music player thread, e.g. mpd, audacious
    #music_player_interval (update_interval is default)
    
    # Strictness of if_up. One of: up, link or address. The later ones imply the further ones.
    # Defaults to up.
    #if_up_strictness address
      #-d DATATYPE, --datatype=DATATYPE
                            #[default: HT] The data type options are: DW (Day of
                            #Week), WF (Weather Font output), WI (Weather Icon
                            #Path), LT (Forecast:Low Temp,Current:Feels Like Temp),
                            #HT (Forecast:High Temp,Current:Current Temp), CC
                            #(Current Conditions), CT (Conditions Text), PC
                            #(Precipitation Chance), HM (Humidity), VI
                            #(Visibility), WD (Wind Direction), WA (Wind Angle - in
                            #degrees), WS (Wind Speed), WG (Wind Gusts), BF
                            #(Bearing Font), BI (Bearing Icon Path), BS (Bearing
                            #font with Speed), CN (City Name), CO (Country), OB
                            #(Observatory), SR (SunRise), SS (SunSet), DL
                            #(DayLight), MP (Moon Phase), MF (Moon Font), MI (Moon
                            #Icon Path), BR (Barometer Reading), BD (Barometer
                            #Description), UI (UV Index), UT (UV Text), DP (Dew
                            #Point), LU (Last Update at weather.com), LF (Last
                            #Fetch from weather.com). Not applicable at command
                            #line when using templates.
    
    
    # variable is given either in format $variable or in ${variable}. Latter
    # allows characters right after the variable and must be used in network
    # stuff because of an argument
    
    # stuff after 'TEXT' will be formatted on screen
    # -- Lua Load -- #
    
    TEXT
    ${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 1280}
    ${cpubar cpu1}
    ${else}${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 2560}
    ${cpubar cpu2}
    ${else}${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 3840}
    ${cpubar cpu0}
    ${else}${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 5120}
    ${cpu cpu1}
    ${else}${endif}${endif}${endif}${endif}
    Last edited by djyoung4; January 21st, 2012 at 04:22 AM.
    I'm a super power user

  6. #16
    Join Date
    Apr 2007
    Beans
    195

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by djyoung4 View Post
    Code:
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 0,0  WA: 0,1 1280x799  Workspace 1
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 1280,0  WA: 0,1 1280x799  Workspace 1
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 2560,0  WA: 0,1 1280x799  Workspace 1
    djyoung4@Daniels-computer:~$ wmctrl -d
    0  * DG: 5120x800  VP: 3840,0  WA: 0,1 1280x799  Workspace 1
    heres my smctrl -d. workin on the different viewports
    ok I get this error on gnome
    Code:
    jyoung4@Daniels-computer:~$ conky -c ~/.conkyrc2
    Conky: forked to background, pid is 3342
    djyoung4@Daniels-computer:~$ 
    Conky: desktop window (1e000a9) is subwindow of root window (ad)
    Conky: drawing to desktop window
    Conky: drawing to double buffer
    Conky: Bad arguments: '* ' and ' 1280'
    Conky: compare failed for expression '* == 1280'
    Conky: Bad arguments: '* ' and ' 1280'
    Conky: compare failed for expression '* == 1280'
    heres my code
    Code:
    # Conky sample configuration
    #USAZ0233, USHI0026
    # 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.
    
    # set to yes if you want Conky to be forked in the background
    background yes
    
    # X font when Xft is disabled, you can pick one with program xfontsel
    #font 5x7
    #font 6x10
    #font 7x13
    #font 8x13
    #font 9x15
    #font *mintsmild.se*
    #font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
    
    # Use Xft?
    use_xft yes
    
    # Xft font when Xft is enabled
    xftfont Deja Vu Sans Mono:size=18
    
    # Text alpha when using Xft
    xftalpha 0.8
    
    # Print everything to stdout?
    # out_to_console no
    
    # MPD host/port
    # mpd_host localhost
    # mpd_port 6600
    # mpd_password tinker_bell
    
    # Print everything to console?
    # out_to_console no
    
    # mail spool
    mail_spool $MAIL
    
    # Update interval in seconds
    update_interval 1
    
    # This is the number of times Conky will update before quitting.
    # Set to zero to run forever.
    total_run_times 0
    
    # Create own window instead of using desktop (required in nautilus)
    own_window no
    
    # If own_window is yes, you may use type normal, desktop or override
    own_window_type desktop
    
    # Use pseudo transparency with own_window?
    own_window_transparent yes
    
    # If own_window_transparent is set to no, you can set the background colour here
    own_window_colour black
    
    # If own_window is yes, these window manager hints may be used
    #own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    
    # Use double buffering (reduces flicker, may not work for everyone)
    double_buffer yes
    
    # Minimum size of text area
    minimum_size 280 5
    
    # Maximum width
    maximum_width 10000
    
    # Draw shades?
    draw_shades no
    
    # Draw outlines?
    draw_outline no
    
    # Draw borders around text
    draw_borders no
    
    # Draw borders around graphs
    draw_graph_borders no
    
    # Stippled borders?
    stippled_borders 8
    
    # border margins
    border_inner_margin 4
    
    # border width
    border_width 1
    
    # Default colors and also border colors
    default_color black
    #default_shade_color black
    #default_outline_color black
    
    # Text alignment, other possible values are commented
    alignment top_left
    #alignment top_right
    #alignment bottom_left
    #alignment bottom_right
    #alignment top_middle
    #alignment bottom_middle
    #alignment none
    
    # Gap between borders of screen and text
    # same thing as passing -x at command line
    gap_x 20
    gap_y 1
    
    # Subtract file system buffers from used memory?
    no_buffers yes
    
    # set to yes if you want all text to be in uppercase
    uppercase no
    
    # number of cpu samples to average
    # set to 1 to disable averaging
    cpu_avg_samples 2
    
    # number of net samples to average
    # set to 1 to disable averaging
    net_avg_samples 2
    
    # Force UTF8? note that UTF8 support required XFT
    override_utf8_locale yes
    
    # Add spaces to keep things from moving about?  This only affects certain objects.
    use_spacer none
    
    # Shows the maximum value in scaled graphs.
    show_graph_scale no
    
    # Shows the time range covered by a graph.
    show_graph_range no
    
    # Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
    #max_port_monitor_connections 256
    
    # Maximum number of special things, e.g. fonts, offsets, aligns, etc.
    #max_specials 512
    
    # Maximum size of buffer for user text, i.e. below TEXT line.
    max_user_text 16384
    
    # Timing interval for music player thread, e.g. mpd, audacious
    #music_player_interval (update_interval is default)
    
    # Strictness of if_up. One of: up, link or address. The later ones imply the further ones.
    # Defaults to up.
    #if_up_strictness address
      #-d DATATYPE, --datatype=DATATYPE
                            #[default: HT] The data type options are: DW (Day of
                            #Week), WF (Weather Font output), WI (Weather Icon
                            #Path), LT (Forecast:Low Temp,Current:Feels Like Temp),
                            #HT (Forecast:High Temp,Current:Current Temp), CC
                            #(Current Conditions), CT (Conditions Text), PC
                            #(Precipitation Chance), HM (Humidity), VI
                            #(Visibility), WD (Wind Direction), WA (Wind Angle - in
                            #degrees), WS (Wind Speed), WG (Wind Gusts), BF
                            #(Bearing Font), BI (Bearing Icon Path), BS (Bearing
                            #font with Speed), CN (City Name), CO (Country), OB
                            #(Observatory), SR (SunRise), SS (SunSet), DL
                            #(DayLight), MP (Moon Phase), MF (Moon Font), MI (Moon
                            #Icon Path), BR (Barometer Reading), BD (Barometer
                            #Description), UI (UV Index), UT (UV Text), DP (Dew
                            #Point), LU (Last Update at weather.com), LF (Last
                            #Fetch from weather.com). Not applicable at command
                            #line when using templates.
    
    
    # variable is given either in format $variable or in ${variable}. Latter
    # allows characters right after the variable and must be used in network
    # stuff because of an argument
    
    # stuff after 'TEXT' will be formatted on screen
    # -- Lua Load -- #
    
    TEXT
    ${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 1280}
    ${cpubar cpu1}
    ${else}${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 2560}
    ${cpubar cpu2}
    ${else}${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 3840}
    ${cpubar cpu0}
    ${else}${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $2}' | sed 's/,0//'} == 5120}
    ${cpu cpu1}
    ${else}${endif}${endif}${endif}${endif}
    Yeah. Same as the last example. You need to change to '{print $6}' to grab your particular viewport.

  7. #17
    Join Date
    Dec 2008
    Location
    The Desert
    Beans
    281
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by 42dorian View Post
    Yeah. Same as the last example. You need to change to '{print $6}' to grab your particular viewport.
    no errors now but no display
    I'm a super power user

  8. #18
    Join Date
    Apr 2007
    Beans
    195

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by djyoung4 View Post
    no errors now but no display
    Right. Flip viewports a couple times.

    *EDIT* In fact, do two things. Change the maximum_size variable to something like 400 instead of 10000, and flip to the FOURTH Viewport. A maximum width of 10000 could very well put all results on the fourth viewport over. Just, play it safe and limit it to around 400. Or, leave one of those ifs blank to see if one of the viewports is blank.
    Last edited by 42dorian; January 21st, 2012 at 04:44 AM.

  9. #19
    Join Date
    Dec 2008
    Location
    The Desert
    Beans
    281
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by 42dorian View Post
    Right. Flip viewports a couple times.

    *EDIT* In fact, do two things. Change the maximum_size variable to something like 400 instead of 10000, and flip to the FOURTH Viewport. A maximum width of 10000 could very well put all results on the fourth viewport over. Just, play it safe and limit it to around 400. Or, leave one of those ifs blank to see if one of the viewports is blank.
    ok so i changed it to max width 400 and the code for viewport 2 goes to viewport 3 and the code for viewport 3 goes to viewport 4. I get no display on 1 and 2
    Code:
    # Conky sample configuration
    #USAZ0233, USHI0026
    # 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.
    
    # set to yes if you want Conky to be forked in the background
    background yes
    
    # X font when Xft is disabled, you can pick one with program xfontsel
    #font 5x7
    #font 6x10
    #font 7x13
    #font 8x13
    #font 9x15
    #font *mintsmild.se*
    #font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
    
    # Use Xft?
    use_xft yes
    
    # Xft font when Xft is enabled
    xftfont Deja Vu Sans Mono:size=18
    
    # Text alpha when using Xft
    xftalpha 0.8
    
    # Print everything to stdout?
    # out_to_console no
    
    # MPD host/port
    # mpd_host localhost
    # mpd_port 6600
    # mpd_password tinker_bell
    
    # Print everything to console?
    # out_to_console no
    
    # mail spool
    mail_spool $MAIL
    
    # Update interval in seconds
    update_interval 1
    
    # This is the number of times Conky will update before quitting.
    # Set to zero to run forever.
    total_run_times 0
    
    # Create own window instead of using desktop (required in nautilus)
    own_window no
    
    # If own_window is yes, you may use type normal, desktop or override
    own_window_type desktop
    
    # Use pseudo transparency with own_window?
    own_window_transparent yes
    
    # If own_window_transparent is set to no, you can set the background colour here
    own_window_colour black
    
    # If own_window is yes, these window manager hints may be used
    #own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    
    # Use double buffering (reduces flicker, may not work for everyone)
    double_buffer yes
    
    # Minimum size of text area
    minimum_size 280 5
    
    # Maximum width
    maximum_width 400
    
    # Draw shades?
    draw_shades no
    
    # Draw outlines?
    draw_outline no
    
    # Draw borders around text
    draw_borders no
    
    # Draw borders around graphs
    draw_graph_borders no
    
    # Stippled borders?
    stippled_borders 8
    
    # border margins
    border_inner_margin 4
    
    # border width
    border_width 1
    
    # Default colors and also border colors
    default_color black
    #default_shade_color black
    #default_outline_color black
    
    # Text alignment, other possible values are commented
    alignment top_left
    #alignment top_right
    #alignment bottom_left
    #alignment bottom_right
    #alignment top_middle
    #alignment bottom_middle
    #alignment none
    
    # Gap between borders of screen and text
    # same thing as passing -x at command line
    gap_x 20
    gap_y 1
    
    # Subtract file system buffers from used memory?
    no_buffers yes
    
    # set to yes if you want all text to be in uppercase
    uppercase no
    
    # number of cpu samples to average
    # set to 1 to disable averaging
    cpu_avg_samples 2
    
    # number of net samples to average
    # set to 1 to disable averaging
    net_avg_samples 2
    
    # Force UTF8? note that UTF8 support required XFT
    override_utf8_locale yes
    
    # Add spaces to keep things from moving about?  This only affects certain objects.
    use_spacer none
    
    # Shows the maximum value in scaled graphs.
    show_graph_scale no
    
    # Shows the time range covered by a graph.
    show_graph_range no
    
    # Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
    #max_port_monitor_connections 256
    
    # Maximum number of special things, e.g. fonts, offsets, aligns, etc.
    #max_specials 512
    
    # Maximum size of buffer for user text, i.e. below TEXT line.
    max_user_text 16384
    
    # Timing interval for music player thread, e.g. mpd, audacious
    #music_player_interval (update_interval is default)
    
    # Strictness of if_up. One of: up, link or address. The later ones imply the further ones.
    # Defaults to up.
    #if_up_strictness address
      #-d DATATYPE, --datatype=DATATYPE
                            #[default: HT] The data type options are: DW (Day of
                            #Week), WF (Weather Font output), WI (Weather Icon
                            #Path), LT (Forecast:Low Temp,Current:Feels Like Temp),
                            #HT (Forecast:High Temp,Current:Current Temp), CC
                            #(Current Conditions), CT (Conditions Text), PC
                            #(Precipitation Chance), HM (Humidity), VI
                            #(Visibility), WD (Wind Direction), WA (Wind Angle - in
                            #degrees), WS (Wind Speed), WG (Wind Gusts), BF
                            #(Bearing Font), BI (Bearing Icon Path), BS (Bearing
                            #font with Speed), CN (City Name), CO (Country), OB
                            #(Observatory), SR (SunRise), SS (SunSet), DL
                            #(DayLight), MP (Moon Phase), MF (Moon Font), MI (Moon
                            #Icon Path), BR (Barometer Reading), BD (Barometer
                            #Description), UI (UV Index), UT (UV Text), DP (Dew
                            #Point), LU (Last Update at weather.com), LF (Last
                            #Fetch from weather.com). Not applicable at command
                            #line when using templates.
    
    
    # variable is given either in format $variable or in ${variable}. Latter
    # allows characters right after the variable and must be used in network
    # stuff because of an argument
    
    # stuff after 'TEXT' will be formatted on screen
    # -- Lua Load -- #
    
    TEXT
    ${if_match ${execi 60 wmctrl -d | grep 'VP:' | awk '{print $6}' | sed 's/,0//'} == 1280}
    ${cpubar cpu1}
    ${else}${if_match ${execi 6 wmctrl -d | grep 'VP:' | awk '{print $6}' | sed 's/,0//'} == 2560}
    ${color red}${cpubar cpu2}
    ${else}${if_match ${execi 6 wmctrl -d | grep 'VP:' | awk '{print $6}' | sed 's/,0//'} == 3840}
    ${color blue}${cpubar cpu0}
    ${else}${if_match ${execi 6 wmctrl -d | grep 'VP:' | awk '{print $6}' | sed 's/,0//'} == 5120}
    ${color white}${cpu cpu1}
    ${else}${endif}${endif}${endif}${endif}
    I'm a super power user

  10. #20
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: HOWTO: Conky Multi-Desktop Configuration.

    Quote Originally Posted by 42dorian View Post
    @mrpeachy, I figured you'd step in on this one. As you know rather well, I'm not all-knowing of the ways of LUA. I only have very basic stuff in my repertoire.

    Question though. Are you referring to changing which functions in Lua are displayed in Conky, depending on which workspace you're on? Or are you referring to changing what the already loaded functions do depending on which workspace you're on?

    The way I see it working, this Multi-Desktop thing, is that in order to get everything to line up properly every time, the entire script you want there in that workspace has to be lined up in a single if_match case. You don't want every little section that changes to be making it's own decisions, you want the entire script to be run at once when the desktop/workspace/veiwport/whatever your WM Calls It changes or is different.

    In LUA, if you don't want one element of the function to run, you leave an "if desknum==x" wrapped around it so it doesn't run unless that's there. I know, however, that certain functions may or may not like that. Hence why I need a LUA consultant on this.
    well usually one lua script has one main function conky_something
    all the other functions you find in a lua script are then in addition to that, but it is the conky_something function that is executed by conky each cycle

    so say you had wlourfs bars etc script and you want to use it with 2 differeny conkies with each conky having a different display....

    you could have just one instance of that script saved and then try and edit it in such a way to add if statements surrounding 2 different settings tables,

    you have conky on one desktop, the script gets fed one lot of settings, you have conky on another desktop the script gets the other set

    the problem is first any editing if a script like that by somone who isnt all that well versed in what the script does could easily break it, and second, you might be able to figure out where to put the if's but go to another script and it will be entirely different

    OR

    you could have 2 versions of the script saves

    bars1.lua and bars2.lua set up as you want them... load them both above TEXT
    then have which one is executed controlled by the conky if_matches
    you would still need to edit the lua scripts to make the names of the main functions different
    in bars1.lua --> function conky_main1()
    in bars2.lua--> function conky_main2()
    Last edited by mrpeachy; January 26th, 2012 at 06:11 AM.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

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