Continuous scripts in conky?

I would like to know if there is a way to run scripts that go continuously in conky. For example, I have one that displays the volume in the command line and just remains running, displaying the new volume instantly when I change the volume with the keyboard. Can I have this sort of behavior in conky without too much CPU usage? Right now, I have to wait until conky's update_interval passes until I see any changes. Making the update_interval really small increases my CPU usage by a lot, which I do not want to do.
Here is the volume script I'm talking about:
#1/bin/bash
while true; do sleep 0.1; vol=$(amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "MM" } else { print $2 }}' | head -n 1); echo -n -e '\r'Vol: $vol%; done

I tried using something like that; I even used the exact command you posted, and the problem is that the volume won't update any faster than the rest of conky will.
When I was using xmonad (now dwm), xmobar would use hardly any cpu because I set some plugins (like network status, time, etc.) to update every 30 seconds to a minute, whereas things like volume were updated every half-second. I was hoping I could get something like this with the dwm status bar, that is, all the information in my conkyrc here:
# Conky, a system monitor, based on torsmo
background no
total_run_times 0
#cpu_avg_samples 2
#net_avg_samples 2
#no_buffers yes
out_to_console yes
#out_to_stderr no
update_interval 2
#uppercase no
use_spacer none
TEXT
±${battery_time BAT1}(${battery_short BAT1}) cpu0/1: ${cpu cpu0}% ${cpu cpu1}% mem: $memperc% ($mem) ${exec /home/agi/.bin/volume.sh} ${exec /home/agi/.bin/wireless.sh} ${time %a %b %d %I:%M%P}
but with minimal cpu/memory usage (I usually have 1-3% when idle). Part of the reason I switched to dwm is that it's so light!

Similar Messages

  • Bash Scripting with Conky -- How to implement?

    Hey Folks, my first post here and I'm looking for a bit of help. I've created a bash script to work with conky in which its purpose is to change the color of the battery bar depending on current voltage.
    Here's the bash script:
    #!/bin/bash
    # Change Conky battery color depending on charge
    chrg=`cat /proc/acpi/battery/BAT1/state | grep "remaining capacity" |
    awk '{print $3 }'`
    echo $chrg
    if [ $chrg -lt "3499" ]; then
    ${color red}${battery_percent BAT1}% ${battery_bar 4 BAT1}
    elif [ "$chrg" -lt "5100"]; then
    ${color orange}${battery_percent BAT1}% ${battery_bar 4 BAT1}
    else ${color green}${battery_percent BAT1}% ${battery_bar 4 BAT1}
    fi
    Essentially what it is supposed to do is grab and store the "remaining capacity" and if its lower than a certain point it changes color. What I'm having trouble with is actually implementing the colors into conky. Right now all it is doing is printing the charge as you can see. Any help would be appreciated. Thanks!

    I had this issue, took me three days to solve. Using if_match, put all your if_matches in a line, with each option having its color of choice, then put the bar, or % at the end.  You will need to make sure it is in sequential order so the color will not overlap the color you want for the state in the if_match. I know this is an old thread, I will edit my post when I get on my netbook with the code.
    I found this thread on a google search for bash and conky usages.
    [edit] here was my solution for the if_match using the battery.
    ${if_match ${battery_percent BAT1} <= 49}${color0}${endif}${if_match ${battery_percent BAT1} <= 20}${color9}${endif}${if_match ${battery_percent BAT1} >= 50}${color4}${endif}${battery BAT1} ${alignr}${battery_bar 6,160 BAT1}
    I have my colors set yellow for 49% and below, red 20% and lower, and last green for 50% and higher. Essentially this will pick yellow for under 49% and the if_match for red under 20%, the red will override the yellow, this is why order is important.
    Remember this is all in one line, now there are cleaner ways of setting this up using lua. That is something I am still working on.
    Last edited by mrknify (2014-03-05 17:09:59)

  • Continue script but hang in a speech

    I'm trying to do a script for a campaign in UCCX 7.0.1_Build168, make calls with 'Place Call' phone numbers extracted from a. 'Xml', and when the call is received the delivery to a 'CSQ' to the receiving agent. While waiting for an agent is free, you hear a voice and if the customer hangs over the voiceover script is cut. Was there any solution to this problem that does not affect reports Historical Reports?
    When I create a campaign "subsystem / Outbound" gets the call to the agent in the Cisco Agent, but does not sound the physical device. How I can do to ring the physical device?
    thanks

  • Wait for process before continuing script

    Hey there,
    Just been working on this for a bit now in script editor. I'm still really new to the script editor functions, but would like some direction. If automater is a alternative then please help me understand how to make it work with that.
    Otherwise all help is greatly appreciated!
    Goal of the script:
    1) load disk image. (This works)
    2) open application requiring disk image. (This works)
    3) Check to see in app process is running: running --> wait till it is not, when not running --> eject above disk image
    Code:
    tell application "Finder" -- Note when using tell Finder it gives can't get running of process
              if process "App Process" is not running then
                        set bootDisk to name of startup disk
                        set otherDisks to every disk whose (name is not bootDisk) and (name is not "iTunes") and (name is not "Applications") and (name is not "BOOTCAMP")
                        repeat with myDisk in otherDisks
                                  try
      eject myDisk -- When using tell System Events it give Expected end of line but found identifier on line.
                                  end try
                        end repeat
              end if
    end tell
    Another: Oddly the script will run the app, it throws the error while running, but the app still runs. The disk Image is also gone.
    Thanks again for any helpful comments and direction.
    -- Josh

    Okay, Neil and tw^3, thanks you for your help, I got the effect I wanted cleaned up the code a smidge.
    Code:
    tell application "Finder"
              open document file "DiskImage" of folder "GAMES" of disk "Applications"
        delay 2 & close every window
              open application file "App" of folder "Myth2" of folder "GAMES" of disk "Applications"
    end tell
    delay 4.5
    tell application "System Events"
              repeat
                             if not (exists process "process") then
                                            if exists "DiskName" then
                                                           do shell script "hdiutil detach \"/Volumes/DiskName\""
                      error number -128 --
                end if
                             end if
           if exists (process "process") then
           end if
           delay 10
              end repeat
    end tell
    Last little question about what I have, in the if statement checking if the process does not exist anymore, I put quit after the shell script to eject. but it would just hang there. Would it be better to do a repeat while? or would you just user cancel (error -128) the script from executing like I have it.
    -Josh
    EDIT: made it work better, used a repeat while... and moved the if not exists after the repeat...
    repeat while exists "app process"
    end repeat
    if not (exists process "app process")
    ......blah blah code code
    end if

  • Can't get conky-cli and bash scripts to both display in dwm statusbar!

    I'm trying to configure my dwm status bar to display some simple information using conky-cli and bash scripts. At first I tried just letting conky run the bash scripts (for network and volume state), but this increased my cpu usage by about 5%, which is significant considering I normally have 1-3% usage when idle. Also, I wanted to keep conky because it makes the display of certain information easy, such as cpu & RAM usage.
    The problem is I'm having trouble getting both to display side by side. Here are the relevant parts of my .xinitrc:
    network(){
    iwconfig wlan0 2>&1 | grep -q no\ wireless\ extensions\. && {
    echo wired
    exit 0
    essid=`iwconfig wlan0 | awk -F '"' '/ESSID/ {print $2}'`
    stngth=`iwconfig wlan0 | awk -F '=' '/Quality/ {print $2}' | cut -d '/' -f 1`
    bars=`expr $stngth / 10`
    case $bars in
    0) bar='[-------]' ;;
    1) bar='[#------]' ;;
    2) bar='[##-----]' ;;
    3) bar='[###----]' ;;
    4) bar='[####---]' ;;
    5) bar='[#####--]' ;;
    6) bar='[######-]' ;;
    7) bar='[#######]' ;;
    *) bar='[--!!!--]' ;;
    esac
    echo $essid$bar
    exit 0
    volume(){
    vol=$(amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "MM" } else { print $2 }}' | head -n 1)
    echo Vol: $vol%
    exit 0
    conky | while true; read line; do xsetroot -name "`$line` `volume` `network` `date '+%a %m-%d-%Y %I:%M%p'`"; done &
    exec dwm
    (let me know if it would help to post any other files)
    For some reason when I run this I only get the network/volume scripts and date running, updating every second (I think). The conky line just doesn't show up. I don't know what could be wrong, since I didn't see any error messages.
    An even better solution would be to just have shell scripts to display CPU and MEM usage. I have a dual-core cpu, cpu0 and cpu1. I'd like to see both percentages if possible, or at least a percentage that is an accurate average of the two or something. In conky-cli I have something that shows:
    cpu0/1: xx% xx%
    Also, seeing RAM usage would help a lot. In conky it shows:
    mem: xx% (xxxMB)
    These are the ways I would like to have bash scripts show them, if possible, but I have zero skill in bash programming. I made this an option in case it's easier/cleaner/less resource hungry than a conky solution. Personally, if they're about the same in these aspects, I would prefer something with conky and the shell scripts because conky is so extensible, yet it's only flaw is executing scripts with minimal resource usage.
    Help?

    Thanks. I was thinking of using load average to save a few characters, but I didn't quite understand the numbers. I'll try that once I get to my Linux box, but could you please explain or post a link to something that explains load average (what's low, high, normal, etc.)?
    EDIT: I found a website that explains loadavg. I now have my dwm status bar displaying it perfectly (yay!). Now I just need to add a few more things like battery status, etc. and I might be done. I'll probably post here if I have more questions, though.
    Thanks for your help!
    Last edited by Allamgir (2009-07-18 14:41:11)

  • [Solved] Conky stock ticker script?

    Does anyone have a stock ticker script for Conky?
    Orjanp
    Last edited by orjanp (2009-01-29 22:07:24)

    Why not add an rss feed into conky, here's a link for that. http://howto.wikia.com/wiki/Howto_add_a … nky-rss.sh
    I'm sure there are plenty of stock feeds in rss format around.

  • Makeing the scripts a plugin & sharing is fun!

    Hello world of scripters and fellow adobe enthusiasts. I've been tossing around the idea of making all my scripts into plugins for illustrator, and since they are all done in JS how hard would it be to do this?  Would it only be a matter of downloading eclipse and the SDK with a little copy and pasting and be done or would it mean an entire overhaul of my scripts?
    As for the sharing part I know that some of the scripts I've written I've done so with the help of previously written scripts.  I've gotten a lot of help from on here and I've even helped out a bit when I can.  I think it would be a big help to everyone if we shared some of our favorite scripts so that we can all see little tips and tricks that people have learned over the years.  Some of the things I've learned on here I've learned from looking at other peoples scripts and just going, "Wow I didn't know I could do that".
    I'll go first, this script is the one I created with the help of some of my fellow scripters on here but it is still a big thing for me. When the script is ran it grabs all the files that exist inside the folder that it is pointed to and creates a large list of radio buttons for the user to choose from.  Then if there is a guide box it will center the artwork inside the guide box and resize if needed.  It doesn't sound like much but it has been a big help to all of my fellow artists.
    //Created by Daryl R. Smith
    //This is the tab for Totes
    #target illustrator
    if (app.activeDocument.selection.length > 0)
        var thisDoc = app.activeDocument;
    var w = new Window ("dialog", "Choose Totes Template", undefined, {closeButton: false});
    w.alignChildren = "right";
                  w.onShow = function()
                        for(var i=0; i<totes1.children.length; i++)
                    var thisPanel2 = totes1.children[i]; 
                    thisPanel2.originalLocation = [thisPanel2.location[0], thisPanel2.location[1]]; 
                }//end for
            }//end on show function
    var tpanel = w.add ("tabbedpanel");
    tpanel.size = [400, 520];
    //******************************************************Section to setup the Totes Tab******************************************************************
    //creates the Totes Tab
    var totesTab = tpanel.add ("tab", undefined, "Available Totes");
    totesTab.orientation = "column";
    //Creates first Row Group for Totes, contains panels 1,2 and 3
    var TotesGroup = totesTab.add("group",undefined);
            TotesGroup.orientation = "row";
            TotesGroup.alignChildren = "left";
    //first Totes Panel
    var totes1 = TotesGroup.add ("panel", undefined, "");
    totes1.alignChildren = "left";
    totes1.size = [300,480];
    var docSelection = app.activeDocument.selection;
    var newGroup = app.activeDocument.groupItems.add();
    for ( i = 0; i < docSelection.length; i++ ) {
       var newItem = docSelection[i];
    newItem.moveToEnd( newGroup );
    newItem.name = "Art Item" + ([i]+1);
    newGroup.name = "ArtGroup1";
        //hide this alert, it is for testing the selection length
      // alert (thisDoc.selection.length)
    function GetToteTempNames()
        //Replace this address for the "toteTempPath" to the folder that has all the templates it in it, then the for loop will place them all
        //into a radio button array for the user to choose which one they want.  This updates everytime that this script is ran so if
        //one if removed or added it will show up reducing the amount of required time needed to update the script.
        //when replaced make sure to change the \ marks to / marks or it will not work.
      var toteTempPath = Folder ("S:/Art/ArtDept/  Vitronic Master Templates/STE2 Templates/TOTES & BAGS");  
      var toteTempFiles = toteTempPath.getFiles(); 
      var TotenamesArr = []; 
      for(var i=0; i<toteTempFiles.length; i++){ 
      var thisToteFile = toteTempFiles[i]; 
      TotenamesArr.push(thisToteFile.displayName);
      return TotenamesArr; 
    var totesarr1 = GetToteTempNames();
            for(var i=0; i<totesarr1.length; i++){ 
                var lbl = totes1.add("radiobutton", undefined, totesarr1[i]); 
            var scrl = TotesGroup.add('scrollbar'); scrl.size = [20, 480]; 
            scrl.onChange = scrl.onChanging = function()
            {  //start function
                for(var i=0; i<totes1.children.length; i++)
                {  //start for
                    var thisPanel2 = totes1.children[i]; 
                    var xLoc = thisPanel2.originalLocation[0]; 
                    var yLoc = thisPanel2.originalLocation[1]; 
                    thisPanel2.location=[xLoc, yLoc-((this.value/100) * ((totes1.children.length*27.5) - (scrl.size[1]+5)))]; 
                    // These numbers are my arbitrary way of setting the y location 
                    }//end for loop
                }//end function
           totes1.children[0].value = true;
            var bottombuttons = w.add ("group");
            bottombuttons.orientation = "row"
            var rsize = bottombuttons.add ("panel", undefined, "Resize Artwork?");
    rsize.alignChildren = "left"
    rsize.orientation = "column"
    rsizeyes = rsize.add ("radiobutton", undefined, "Yes");
    rsizeno  = rsize.add ("radiobutton", undefined, "No");
    rsize.children[1].value = true;
    var kbottombuttons = bottombuttons.add ("group", undefined, "")
    kbottombuttons.orientation = "column"
    kbottombuttons.add ("button", undefined, "Ok");
    //********************This section is for the functions to output your choice then run the function depending on the choice you made****************
    if (w.show () == 1)
    var templateselected = selected_rbutton
    var requestedtemplate = selected_rbutton (totalgroups)
    var confirmed = confirm ("You picked [ " + selected_rbutton (totalgroups) +" ]"+ "\nYou picked [ " + questionResize (rsizechoice) + " ] to resize" + "\n" +"\nContinue?");
            confirm.noAsDflt == false;
            if (confirmed == true)
                openTemp ();
                copyandmove ();
                centerArt ();
                resizeart ();
                alert ("You can now save the file");
             } /*end if */ else
             alert ("You chose not to continue, script stopped")
             }//end else
    }//end if OK
    }//end if selection check
    else
        alert("Please select the artwork.");
      } // end else selection check
    //*********This section is for the function to check which option for resize gets pressed and returns the text to a variable for output******************
    var rsizechoice = [rsize]
    function questionResize (rsizechoice)
    {//start function
    //when choice is pressed return choice text for variable output   
    for (var i = 0; i < rsize.children.length; i++)
    if (rsize.children[i].value == true)
    return rsize.children[i].text;
    }//end for
    }//end function QuestionResize
    //***************************************************************This is the section that will center the artwork ******************************************
         var thisDoc = app.activeDocument;
        thisDoc.rulerOrigin = [0,0];  //  Sets the coordinates of the artboard to the lower left hand corner of the document.
        thisDoc.pageOrigin = [0,0];  //  This makes sure a valid reference point is used for different sized documents.
        function centerArt()
           var thisdoc = app.activeDocument; 
            var selecteditem = app.activeDocument.groupItems[0];
            selecteditem.selected = true;
            var hasDocCoords = app.coordinateSystem == CoordinateSystem.ARTBOARDCOORDINATESYSTEM;
            var p = thisdoc.pageItems; 
            for (var i = 0, l = p.length; i < l; i++) { 
                var pID = p[i]; 
                if (pID.guides == true) { 
                    var guideBox = pID 
            var wNum = guideBox.width; 
            var hNum = guideBox.height;
            var swNum = selecteditem.width;
            var shNum = selecteditem.height;
            var sxOffset = (swNum/2);
            var syOffset = (shNum/2);
            var xOffset = (wNum/2);
            var yOffset = (hNum/2);
            var xNum = guideBox.position[0]+xOffset; 
            var yNum = guideBox.position[1]-yOffset;
            var guideXCenter = xNum-sxOffset;
            var guideYCenter = yNum+syOffset;
            var sxNum = selecteditem.position[0]+sxOffset;
            var syNum = selecteditem.position[1]-syOffset;
            //to test your script for position un annotate the two alerts below
                  // alert("GuideBox Data:\nWidth: "+wNum+"\nHeight: "+hNum+"\nX Position: "+xNum+"\nY Position: "+yNum);
                  // alert ("Selected object Data:\nWidth: "+swNum+"\nHeight: "+shNum+"\nX Position: "+sxNum+"\nY Position: "+syNum);
            //changes the position of the selected artwork to the center of the guide box.
            selecteditem.position = [guideXCenter, guideYCenter]   
        }//end centerart
       function resizeart()
      var selecteditem = app.activeDocument.groupItems[0]; 
       if (questionResize (rsizechoice) == "Yes")
            for (var i = 0; i < app.activeDocument.pageItems.length; i++)
                if (app.activeDocument.pageItems[i].guides == true) { 
                    var guideBoxSize = app.activeDocument.pageItems[i]; 
                }  //end if
            }   //end for
            var guideW = guideBoxSize.width; 
            var guideH = guideBoxSize.height;
            var itemW = selecteditem.width;
            var itemH = selecteditem.height;
             //to test your script for resize un annotate the two alerts below
          //  alert ("guide is this tall " + guideH + "\nguide is this wide " + guideW);
          // alert ("item is this tall " + itemH + "\nitem is this wide " + itemW);
            var artWidth = itemW;
            var artHeight =itemH;          
        if (artWidth > artHeight)
               var a = (guideW/artWidth)*100;
               selecteditem.resize(a,a);
        if (artHeight > artWidth)    
               var b = (guideH/artHeight)*100;
               selecteditem.resize(b,b);
    var artWidth2 = selecteditem.width;
    var artHeight2 =selecteditem.height;   
    if (artHeight2 > guideH)
           var c = (guideH/artHeight2)*100;
          selecteditem.resize(c,c);
       if (artWidth2 > guideW)
           var c = (guideW/artWidth2)*100;
          selecteditem.resize(c,c);
         }//end if doresize
    }//end function resizeart
    function savefile ()
        //change this folder location for the "savescript" variable to the one where the location of the save script is located on the server,
        //This save script is for the pallet that will pop up and list the different save options, not the individual save scripts themselves.
            var savescript =  new File("S:/Art/ArtDept/Illustrator JS Palette/Scripts/Art Share Server/Save/Save Option Pallet.jsx");
                savescript.open("r");     
           var bt = new BridgeTalk;
                bt.target = "illustrator";         
           var script = savescript.read();
                savescript.close();              
           bt.body = script;
           bt.send(); 
           return true;
    function copyandmove ()
    var thisDoc = app.activeDocument;  
    var template = app.documents[1];
    var vartwork = app.documents[0];
    var itemToDuplicate = template.pageItems['ArtGroup1']; 
    itemToDuplicate.duplicate( thisDoc, ElementPlacement.PLACEATBEGINNING );
    }//end function copyandmove
    //********************This section is for the functions to check which button gets pressed and returns the text to a variable for output ****************
    //all radiobutton groups must be present in this array
    var totalgroups = [totes1]
    //this function checks each group for the 1 radio button is clicked then returns its text
    function selected_rbutton (totalgroups)
    {//start function to check buttons
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Totes tab buttons
    //when totes1 is pressed return text for output
    for (var i = 0; i < totes1.children.length; i++)
    if (totes1.children[i].value == true)
    return totes1.children[i].text;
    }//end if
    }//end if
    }//end for
    //////////////////////////////////////////////////////////////////////////open template
    function openTemp()
         //change the folder location of the templates here but leave the last section that is black, this will allow the script to open which
         //ever template they chose from the radiobuttons.  This location should be the same as the toteTempPath above but reduces the
         //chance for something to break by pulling the address here again instead of from the variable near the begining of the script.
    var gettotetemp = File("Z:/  Vitronic Master Templates/STE2 Templates/TOTES & BAGS/" + selected_rbutton (totalgroups));
    var template = open(gettotetemp);
    var fileName = app.activeDocument.name
    var saveName = new File ("S:/Art/ArtDept/Extras/Temp Holding Folder" + "/" + fileName);
        saveOpts = new IllustratorSaveOptions();
        saveOpts.compatibility = Compatibility.ILLUSTRATOR15;
        saveOpts.generateThumbnails = true;
        saveOpts.preserveEditability = true;
      return template;
    }//end open temp function

    If you don't want to use IE, which I didn't, you can follow this link and revert back to an older version of FF until a fix or work around is found for the flash issue.
    http://www.mozilla.com/en-US/firefox/all-older.html
    It work for me. Fireforx 3.6.16

  • [SOLVED] Conky lua problem (transparency)

    Hi,
    I'm trying to transfer my conky from Ubuntu to Arch: below is a screenshot of the Ubuntu version (what it should look like).  On Arch I have a solid black background.   If it's relevant, I'm running Archbang rather than pure Arch, so with Openbox.
    My main issue at the moment is the semi-transparency (and I'd like to have the rounded corners too).   I understand that conky 1.8.0 can do transparency, but only with a compositor, and I'd rather keep my system as light as possible.  So I've replaced my conky with 1.7.2 conky-lua from AUR and (don't know if this was necessary) installed cairo and lua from the repos.   Unfortunately the lua script I used on Ubuntu isn't working; when I run conky in the terminal I get the message ".conkyrc: 121: config file error".  At lines 120 and 121 I have my
    lua_load ~/scripts/draw_bg.lua
            lua_draw_hook_pre
    My .conkyrc and lua script are below.  Thanks for looking!
    # conky configuration
    # edited by Mark Buck (Kaivalagi) <[email protected]>
    # set to yes if you want Conky to be forked in the background
    background no
    # 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 Bitstream Vera Sans Mono:size=9
    # Text alpha when using Xft
    xftalpha 0.8
    # Update interval in seconds
    update_interval 1.0
    # This is the number of times Conky will update before quitting.
    # Set to zero to run forever.
    total_run_times 0
    # Use double buffering (reduces flicker, may not work for everyone)
    double_buffer yes
    # Minimum size of text area
    minimum_size 200 700
    maximum_width 200
    # Draw shades?
    draw_shades yes
    # Draw outlines?
    draw_outline no
    # Draw borders around text
    draw_borders no
    draw_graph_borders yes
    # Stippled borders?
    stippled_borders 8
    # border margins
    border_inner_margin 2
    border_outer_margin 2
    # border width
    border_width 1
    # Default colors and also border colors
    default_color white
    default_shade_color black
    default_outline_color white
    # own window options
    own_window yes
    own_window_type desktop
    #own_window_hints undecorated,skip_taskbar
    # Text alignment, other possible values are commented
    #alignment top_left
    alignment top_right
    #alignment bottom_left
    #alignment bottom_right
    # Gap between borders of screen and text
    # same thing as passing -x at command line
    gap_x 5
    gap_y 35
    # 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 right
    # colours
    color1 white
    # light blue
    color2 6892C6
    color3 6892C6
    # green
    color4 78BF39
    # red
    color5 CC0000
    color6 88ff88
    text_buffer_size 2048
    # 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 ~/scripts/draw_bg.lua
    lua_draw_hook_pre
    TEXT
    ${offset -5}${font StyleBats:style=CleanCut:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Weather${font} ${hr}${color1}
    ${execpi 1800 conkyForecast --location=MZXX0003 --template=/home/mark/conky/conkyForecast.template}
    ${goto 25}${color1}${font Bitstream Vera Sans Mono:size=14}${execi 1800 conkyForecast --location=MZXX0003 --datatype=CT}${font}
    ${goto 20}${font ConkyWeather:style=Bold:size=30}${execi 1800 conkyForecast --location=MZXX0003 --datatype=WF} ${goto 120}${font ConkyWindNESW:size=30}${execi 1800 conkyForecast --location=MZXX0003 --datatype=BS}${font}
    ${goto 10}${execi 1800 conkyForecast --location=MZXX0003 --datatype=HT --centeredwidth=4}/${execi 1800 conkyForecast --location=MZXX0003 --datatype=LT --centeredwidth=4} ${goto 100}${execi 1800 conkyForecast --location=MZXX0003 --datatype=WS --imperial} - ${execi 1800 conkyForecast --location=MZXX0003 --datatype=WD}
    $if_mpd_playing${offset -5}${font StyleBats:style=CleanCut:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}Music${font} ${hr}${color1}
    ${font Bitstream Vera Sans:size=9}${color2}MPD:${color6} $mpd_status
    ${color}${texeci 10 /home/mark/conky/composer.sh}
    ${font Bitstream Vera Sans:size=9}$color$mpd_artist
    ${font Bitstream Vera Sans:size=9}$mpd_album
    ${font Bitstream Vera Sans:size=9}$mpd_title
    ${color #ccddff} ${mpd_bar 5, 100}
    $endif
    ${offset -5}${font StyleBats:style=CleanCut:size=12}q ${voffset -2}${font Bitstream Vera Sans Mono:style=Bold:size=11}${color1}System${font} ${hr}${color1}
    ${color2}CPU Temp: ${color}${acpitemp}${color}°${font Bitstream Vera Sans Mono:size=9}
    $color2}CPU1: $color${cpu cpu1}% ${cpubar cpu1 4,65}${font Bitstream Vera Sans Mono:size=9}
    $color2}CPU2: $color${cpu cpu2}% ${cpubar cpu2 4,65}${font Bitstream Vera Sans Mono:size=9}
    ${color2}RAM:$color $mem/$memmax
    ${color2}Root: $color${fs_used /}/${fs_size /}${font Bitstream Vera Sans Mono:size=9}
    ${color2}Home: $color${fs_used /home/}/${fs_size /home/}${font Bitstream Vera Sans Mono:size=9}
    ${color2}Today:${color6}${execi 10 vnstat -i eth0 | grep "today" | awk '{print $5 $6}'}${goto 120}${color1}${execi 10 vnstat -i eth0 | grep "today" | awk '{print $8 $9}'}
    ${color2}Week: ${color6}${execi 10 vnstat -i eth0 -w | grep "current week" | awk '{print $6 $7}'}${goto 120}${color1}${execi 10 vnstat -i eth0 -w | grep "current week" | awk '{print $9 $10}'}
    ${color2}Month: ${color6}${execi 10 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'}${goto 120}${color1}${execi 10 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $9 $10}'}${font}
    ${color2}Battery:$color ${color red}${battery_bar 4,50 BAT0}
    Background by londonali1010 (2009)
    This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish.
    To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
    lua_load ~/scripts/draw_bg.lua
    lua_draw_hook_pre
    Changelog:
    + v1.0 -- Original release (07.10.2009)
    -- Change these settings to affect your background.
    -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
    corner_r=15
    -- Set the colour and transparency (alpha) of your background.
    bg_colour=0x000000
    bg_alpha=0.4
    require 'cairo'
    function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    function conky_draw_bg()
    if conky_window==nil then return end
    local w=conky_window.width
    local h=conky_window.height
    local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    cr=cairo_create(cs)
    cairo_move_to(cr,corner_r,0)
    cairo_line_to(cr,w-corner_r,0)
    cairo_curve_to(cr,w,0,w,0,w,corner_r)
    cairo_line_to(cr,w,h-corner_r)
    cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
    cairo_line_to(cr,corner_r,h)
    cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
    cairo_line_to(cr,0,corner_r)
    cairo_curve_to(cr,0,0,0,0,corner_r,0)
    cairo_close_path(cr)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))
    cairo_fill(cr)
    end
    Last edited by Henry Flower (2010-04-13 04:54:08)

    The error in line 121 is because of lua_draw_hook_pre command must have a function name. In your file, it would be:
    lua_draw_hook_pre draw_bg
    To get the transparency put the command:
    own_window_transparent yes
    I have tried this in an AwesomeWM, with conky 1.8.0 compiled with lua support, and without compositing.

  • Line the script?

    Does Adobe Story have script lining capabilities? I'm looking for a program that will allow you to line a script, just as a continuity/script supervisor would.
    Thanks!

    Sorry. Story does not support that yet.
    --Anubhav

  • Memory Leakage in Conky with Lua

    Hi there, I've been experiencing ongoing memory leakage using my Conky + Lua scripts. It tends to keep accumulating memory until I kill the process and restart it. Highest I've seen it go is 10% of my 4gb of RAM, so it does get to be substantial if unchecked.
    I did google it, and it mentioned something about cairo_destroy(cr), so I inserted it at the end of functions randomly where it made sense (to my limited scripting skills) and where it didn't (just in case), but it didn't seem to make any difference.
    Here is the lua script - it creates rings as % bars, I believe it was taken from somewhere on the arch forums months ago where it was also modified.
    Ring Meters by londonali1010 (2009)
    This script draws percentage meters as rings. It is fully customisable; all options are described in the script.
    To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/rings-v1.2.1.lua
    lua_draw_hook_pre ring_stats
    -- Background settings
    corner_r=20
    main_bg_colour=0x060606
    main_bg_alpha=0.4
    -- Ring color settings
    ring_background_color = 0x000000
    ring_background_alpha = 0.6
    ring_foreground_color = 0x909090
    ring_foreground_alpha = 1
    -- Rings settings
    settings_table = {
    name='cpu',
    arg='cpu2',
    max=100,
    bg_colour=ring_background_color,
    bg_alpha=ring_background_alpha,
    fg_colour=ring_foreground_color,
    fg_alpha=ring_foreground_alpha,
    x=50, y=55,
    radius=31,
    thickness=3,
    start_angle=-180,
    end_angle=0
    name='cpu',
    arg='cpu1',
    max=100,
    bg_colour=ring_background_color,
    bg_alpha=ring_background_alpha,
    fg_colour=ring_foreground_color,
    fg_alpha=ring_foreground_alpha,
    x=50, y=55,
    radius=35,
    thickness=3,
    start_angle=-180,
    end_angle=0
    name='memperc',
    arg='',
    max=100,
    bg_colour=ring_background_color,
    bg_alpha=ring_background_alpha,
    fg_colour=ring_foreground_color,
    fg_alpha=ring_foreground_alpha,
    x=205, y=55,
    radius=32,
    thickness=10,
    start_angle=-180,
    end_angle=-0
    require 'cairo'
    local function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    local function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)
    -- Draw background ring
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
    -- Draw indicator ring
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)
    end
    local function conky_ring_stats()
    local function setup_rings(cr,pt)
    local str=''
    local value=0
    str=string.format('${%s %s}',pt['name'],pt['arg'])
    str=conky_parse(str)
    value=tonumber(str)
    if value == nil then value = 0 end
    pct=value/pt['max']
    draw_ring(cr,pct,pt)
    end
    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    local cr=cairo_create(cs)
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    if update_num>1 then
    for i in pairs(settings_table) do
    setup_rings(cr,settings_table[i])
    end
    end
    cairo_destroy(cr)
    end
    --[[ This is a script made for draw a transaprent background for conky ]]
    local function conky_draw_bg()
    if conky_window==nil then return end
    local w=conky_window.width
    local h=conky_window.height
    local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
    local cr=cairo_create(cs)
    -- local thick=2
    cairo_move_to(cr,corner_r,0)
    cairo_line_to(cr,w-corner_r,0)
    cairo_curve_to(cr,w,0,w,0,w,corner_r)
    cairo_line_to(cr,w,h-corner_r)
    cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
    cairo_line_to(cr,corner_r,h)
    cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
    cairo_line_to(cr,0,corner_r)
    cairo_curve_to(cr,0,0,0,0,corner_r,0)
    cairo_close_path(cr)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(main_bg_colour,main_bg_alpha))
    --cairo_set_line_width(cr,thick)
    --cairo_stroke(cr)
    cairo_fill(cr)
    cairo_destroy(cr)
    end
    function conky_main()
    conky_draw_bg()
    conky_ring_stats()
    cairo_destroy(cr)
    end
    And this is called into conky via:
    background no
    override_utf8_locale no
    use_xft yes
    xftfont Monospace:size=8
    ## orig font cure
    text_buffer_size 2048
    update_interval 1.0
    total_run_times 0
    own_window yes
    own_window_transparent yes
    own_window_type desktop
    own_window_colour 191919
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer yes
    minimum_size 600 90
    maximum_width 320
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    default_color 909090
    default_shade_color fed053
    default_outline_color 7f8f9f
    alignment br
    gap_x 30
    gap_y 50
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    override_utf8_locale no
    color1 fff
    border_inner_margin 5
    border_outer_margin 5
    own_window_argb_visual no
    own_window_argb_value 200
    lua_load ~/.conky/rings.lua
    lua_draw_hook_pre main
    Left out the conky TEXT section unless anybody desperately needs to see that too.
    If anybody can point me in the right direction with this silly thing, that would be appreciated. Thanks!
    Last edited by ugugii (2011-11-16 17:42:00)

    No I meant that the destroy functions should not be in conky_main at all. Why? Because you are using cr as an argument when you have no local cr defined. You are passing the undefined value (nil) to these destroy functions and they do nothing.
    Like I said, I don't use conky or cairo but it is generally a good idea to destroy a resource you create. If you don't you will get memory leaks because "creating" is usually vague language that comes down to allocating memory and "destroy" deallocates memory.
    This line from your own post creates a surface and stores it in the cs variable:
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    Yet you forget to deallocate the surface stored in cs. So add a line like this after each cairo_destroy(cr):
    cairo_surface_destroy(cs)
    I hope that helps.

  • Lua Scripts

    I hate to post such a seemingly mundane question but I can't seem to find my answer anywhere. I've tried other forums and I've tried google. I was hoping there was a conky specific thread here but I couldn't find one so I posted here.
    Anyway, I've been revamping my conky and I copy/pasted one I found online as a model for me to modify. It has circle graphs and a large analog clock so it obviously has lua scripts associated with it. The lua parts aren't showing up. To be safe I've made sure that lua is installed as well as all dependecies. I installed all conky dependencies too just for the hell of it. I've also made sure that I'm calling the lua scripts from the right directory, and yes, I've restarted conky many times. Here are the files:
    Conky
    # Conky settings #
    background no
    update_interval 1
    cpu_avg_samples 2
    net_avg_samples 2
    override_utf8_locale yes
    double_buffer yes
    no_buffers yes
    text_buffer_size 2048
    #imlib_cache_size 0
    temperature_unit fahrenheit
    # Window specifications #
    own_window yes
    own_window_type override
    own_window_transparent #000000
    own_window_transparent yes
    own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
    border_inner_margin 0
    border_outer_margin 5
    minimum_size 250 300
    maximum_width 250
    alignment tr
    gap_x 10
    gap_y 0
    # Graphics settings #
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders yes
    # Text settings #
    use_xft yes
    xftfont caviar dreams:size=8
    xftalpha 0.5
    uppercase no
    temperature_unit celsius
    default_color FFFFFF
    # Lua Load #
    lua_load ~/.openbox/conky/conky_blue/clock_rings.lua
    lua_draw_hook_pre clock_rings
    TEXT
    # Time and date
    ${voffset 7}${font Radio Space:size=16}${color 0ABFFF}${time %A}${font}$color${font Radio Space:size=38}${goto 167}${voffset -8} ${time %e}${font}
    ${font Radio Space:size=18}${voffset -30}${time %b}${font}${voffset -3} ${font Radio Space:size=20}${time %Y}${font}${color 0ABFFF} ${hr 1}
    # Battery Circle
    ${color FFFFFF}${goto 209}${voffset 34}${battery_percent}%
    ${color 0ABFFF}${goto 202}${voffset 25}Battery
    # CPU usage
    ${color #0ABFFF}${hr 1}$color
    ${color #0ABFFF}${voffset 6}Temp: $color ${acpitemp}°C
    ${color #0ABFFF}${voffset 6}Processes:$color $processes
    ${color #0ABFFF}${voffset 6}Running: $color $running_processes${goto 116}${voffset 8}${cpu cpu0}% ${color 0ABFFF}${goto 116}${voffset 13}CPU1$color${goto 191}${voffset -12}${cpu cpu1}% ${color 0ABFFF}${goto 191}${voffset 12}CPU2$color
    ${color #0ABFFF}${voffset -12}FREQ:$color ${freq}MHz
    ${color #0ABFFF}${voffset 6}Load:$color ${loadavg}
    # Network
    ${color 0ABFFF}${voffset 2}${hr 1}
    ${color 0ABFFF}essid: $color$alignr${wireless_essid wlan0}
    ${color 0ABFFF}wlan0: $color$alignr${addr wlan0}
    ${color 0ABFFF}Current: $color${alignr}${execi 10 /sbin/iwconfig wlan0|grep Rate|cut -d"M" -f1|cut -b20-24} Mbits/sec
    ${color 0ABFFF}eth0: $color$alignr${addr eth0}
    ${color #0ABFFF}Down: $color${downspeed wlan0} k/s ${alignr}${color #0ABFFF}Up:$color ${upspeed wlan0} k/s
    ${downspeedgraph wlan0 30,120 000000 0ABFFF} ${alignr}${upspeedgraph wlan0 30,120 000000 0ABFFF}$color
    ${color #0ABFFF}Total:$color ${totaldown wlan0} ${alignr}${color #0ABFFF}Total:$color ${totalup wlan0}
    # DISK/RAM/SWAP usage
    ${color 0ABFFF}${voffset 2}${hr 1}
    ${color FFFFFF}${goto 7}${voffset 39}${fs_used_perc /}%
    ${color 0ABFFF}${goto 7}DISK
    ${color FFFFFF}${goto 102}${voffset -27}${memperc}%
    ${color 0ABFFF}${goto 102}RAM
    # Running processes
    ${color 0ABFFF}${voffset 2} ${hr 1}
    ${color #0ABFFF}${voffset 5}NAME${goto 122}PID${goto 163}CPU%${goto 210}MEM%$color${voffset 5}
    ${top name 1}${goto 115}${top pid 1}${goto 160}${top cpu 1}${goto 205}${top mem 1}
    ${top name 2}${goto 115}${top pid 2}${goto 160}${top cpu 2}${goto 205}${top mem 2}
    ${top name 3}${goto 115}${top pid 3}${goto 160}${top cpu 3}${goto 205}${top mem 3}
    ${top name 4}${goto 115}${top pid 5}${goto 160}${top cpu 5}${goto 205}${top mem 5}
    # Computer info
    ${color 0ABFFF}${voffset 2}${hr 1}${voffset 5}
    ${color 0ABFFF}Hostname:$color${alignr}${nodename}
    ${color 0ABFFF}OS:$color${alignr}${pre_exec cat /etc/issue.net} $machine
    ${color 0ABFFF}Kernel:$color${alignr}${kernel}$color
    ${color 0ABFFF}${font Radio Space:size=20}ARCH${color FFFFFF}LINUX
    ${color 0ABFFF}${voffset -10}${hr 1}
    Lua
    # Clock Rings by Linux Mint (2012) reEdited by Altin.
    # This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script.
    # This script is based off a combination of my clock.lua script and my rings.lua script.
    # IMPORTANT: If you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away.
    # The if statement on line 324 uses a delay to make sure that this doesn't happen.
    # It calculates the length of the delay by the number of updates since Conky started.
    # Generally, a value of 5s is long enough, so if you update Conky every 1s,
    # use update_num>5 in that if statement (the default).
    # If you only update Conky every 2s, you should change it to update_num>3;
    # conversely if you update Conky every 0.5s, you should use update_num>10.
    # ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it,
    # otherwise the update_num will not be reset and you will get an error.
    # To call this script in Conky, use the following in your conkyrc:
    # lua_load ~/.fluxbox/conky/conky_blue/clock_rings.lua
    # lua_draw_hook_pre clock_rings
    # Changelog:
    # * v1.0 --> Original release (30.09.2009)
    # * v1.1p --> Jpope edit londonali1010 (05.10.2009)
    # * vX 2011mint --> reEdit despot77 (18.02.2011)
    # * vX 2012 --> Altin reEdit (22.07.2012)
    # * Added weather function (Accu Weather)
    # * Added battery monitoring
    # * Syslog monitoring
    # * Running processes monitoring
    # * Rearanged rings
    # * Exctra network functions/monitoring
    # * Changed Fonts
    settings_table = {
    -- Edit this table to customise your rings.
    -- You can create more rings simply by adding more elements to settings_table.
    -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
    name='time',
    -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
    arg='%I.%M',
    -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
    max=12,
    -- "bg_colour" is the colour of the base ring.
    bg_colour=0xffffff,
    -- "bg_alpha" is the alpha value of the base ring.
    bg_alpha=0.15,
    -- "fg_colour" is the colour of the indicator part of the ring.
    fg_colour=0x0ABFFF,
    -- "fg_alpha" is the alpha value of the indicator part of the ring.
    fg_alpha=0.3,
    -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
    x=100, y=175,
    -- "radius" is the radius of the ring.
    radius=50,
    -- "thickness" is the thickness of the ring, centred around the radius.
    thickness=5,
    -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
    start_angle=0,
    -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
    end_angle=360
    name='battery_percent',
    arg='',
    max=100,
    bg_colour=0xffffff,
    bg_alpha=0.2,
    fg_colour=0x0ABFFF,
    fg_alpha=0.8,
    x=222, y=110,
    radius=27,
    thickness=5,
    start_angle=-90,
    end_angle=270
    name='time',
    arg='%M.%S',
    max=60,
    bg_colour=0xffffff,
    bg_alpha=0.1,
    fg_colour=0x0ABFFF,
    fg_alpha=0.4,
    x=100, y=175,
    radius=66,
    thickness=5,
    start_angle=0,
    end_angle=360
    name='time',
    arg='%S',
    max=60,
    bg_colour=0xffffff,
    bg_alpha=0.1,
    fg_colour=0x0ABFFF,
    fg_alpha=0.6,
    x=100, y=175,
    radius=72,
    thickness=5,
    start_angle=0,
    end_angle=360
    name='time',
    arg='%d',
    max=31,
    bg_colour=0xffffff,
    bg_alpha=0.1,
    fg_colour=0x0ABFFF,
    fg_alpha=0.8,
    x=100, y=175,
    radius=80,
    thickness=5,
    start_angle=-90,
    end_angle=90
    name='time',
    arg='%m',
    max=12,
    bg_colour=0xffffff,
    bg_alpha=0.1,
    fg_colour=0x0ABFFF,
    fg_alpha=1,
    x=100, y=175,
    radius=86,
    thickness=5,
    start_angle=-90,
    end_angle=90
    name='cpu',
    arg='cpu0',
    max=100,
    bg_colour=0xffffff,
    bg_alpha=0.3,
    fg_colour=0x0ABFFF,
    fg_alpha=0.8,
    x=145, y=337,
    radius=25,
    thickness=5,
    start_angle=-90,
    end_angle=180
    name='cpu',
    arg='cpu1',
    max=100,
    bg_colour=0xffffff,
    bg_alpha=0.3,
    fg_colour=0x0ABFFF,
    fg_alpha=0.8,
    x=220, y=337,
    radius=25,
    thickness=5,
    start_angle=-90,
    end_angle=180
    name='fs_used_perc',
    arg='/',
    max=100,
    bg_colour=0xffffff,
    bg_alpha=0.2,
    fg_colour=0x0ABFFF,
    fg_alpha=0.8,
    x=35, y=590,
    radius=25,
    thickness=5,
    start_angle=-90,
    end_angle=180
    name='memperc',
    arg='',
    max=100,
    bg_colour=0xffffff,
    bg_alpha=0.2,
    fg_colour=0x0ABFFF,
    fg_alpha=0.8,
    x=130, y=590,
    radius=25,
    thickness=5,
    start_angle=-90,
    end_angle=180
    name='swapperc',
    arg='',
    max=100,
    bg_colour=0xffffff,
    bg_alpha=0.2,
    fg_colour=0x0ABFFF,
    fg_alpha=0.8,
    x=220, y=590,
    radius=25,
    thickness=5,
    start_angle=-90,
    end_angle=172
    -- Use these settings to define the origin and extent of your clock.
    clock_r=65
    -- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.
    clock_x=100
    clock_y=175
    show_seconds=true -- Change to true if you want the seconds hand
    require 'cairo'
    function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    function window_background(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']
    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)
    -- Draw background ring
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
    -- Draw indicator ring
    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)
    end
    function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys
    secs=os.date("%S")
    mins=os.date("%M")
    hours=os.date("%I")
    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12
    -- Draw hour hand
    xh=xc+0.76*clock_r*math.sin(hours_arc)
    yh=yc-0.72*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
    cairo_stroke(cr)
    -- Draw minute hand
    xm=xc+0.98*clock_r*math.sin(mins_arc)
    ym=yc-1.02*clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    -- Draw seconds hand
    if show_seconds then
    xs=xc+1.1*clock_r*math.sin(secs_arc)
    ys=yc-clock_r*math.cos(secs_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xs,ys)
    cairo_set_line_width(cr,1)
    cairo_stroke(cr)
    end
    end
    function conky_clock_rings()
    local function setup_rings(cr,pt)
    local str=''
    local value=0
    str=string.format('${%s %s}',pt['name'],pt['arg'])
    str=conky_parse(str)
    value=tonumber(str)
    pct=value/pt['max']
    draw_ring(cr,pct,pt)
    end
    -- Check that Conky has been running for at least 5s
    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    local cr=cairo_create(cs)
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    if update_num>5 then
    for i in pairs(settings_table) do
    setup_rings(cr,settings_table[i])
    end
    end
    draw_clock_hands(cr,clock_x,clock_y)
    end
    To be honest I'm not even sure what to look for. I'm not sure that it's a problem with the code because as I've said, I copy/pasted as a template for modifying. Thanks for reading.
    EDIT: I've been starting conky from a different directory instead of starting it with ~/.conkyrc and I just copied the conky I'm using to ~/.conkyrc and killed/restarted it and noticed this error:
    Conky: /home/'user'/.conkyrc: 53: no such configuration: 'lua_load'
    Conky: /home/'user'/.conkyrc: 54: no such configuration: 'lua_draw_hook_pre'
    cat: /etc/issue.net: No such file or directory
    Conky: desktop window (c1) is root window
    Conky: window type - override
    Conky: drawing to created window (0x1000001)
    Conky: drawing to double buffer
    The top two lines seem to be the most relevant but I'm not sure what to do about it.
    Last edited by xworld (2012-12-28 01:06:01)

    ::facepalm::
    No I didn't. Although I just tried now and it failed. It said I needed toluapp before I could install conky-lua. The trouble is that when I try to install toluapp it fails. I looked in the AUR page and it shows that it's out of date. Is there a workaround for this?
    EDIT: Here's the error if it helps.
    ==> Making package: toluapp 1.0.93-5 (Thu Dec 27 21:23:18 UTC 2012)
    ==> Checking runtime dependencies...
    ==> Checking buildtime dependencies...
    ==> Retrieving Sources...
    -> Downloading tolua++-1.0.93.tar.bz2...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 160k 100 160k 0 0 80172 0 0:00:02 0:00:02 --:--:-- 88576
    -> Found config_linux.py
    ==> Validating source files with md5sums...
    tolua++-1.0.93.tar.bz2 ... Passed
    config_linux.py ... Passed
    ==> Extracting Sources...
    -> Extracting tolua++-1.0.93.tar.bz2 with bsdtar
    ==> Starting build()...
    scons: Reading SConscript files ...
    scons: warning: The Options class is deprecated; use the Variables class instead.
    File "/home/lucid/conf/pkgs/tmp/toluapp/src/tolua++-1.0.93/SConstruct", line 19, in <module>
    ('********* tolua is ', 'bin/tolua++_bootstrap')
    scons: warning: The env.Copy() method is deprecated; use the env.Clone() method instead.
    File "/home/lucid/conf/pkgs/tmp/toluapp/src/tolua++-1.0.93/src/tests/SCsub", line 2, in <module>
    scons: done reading SConscript files.
    scons: Building targets ...
    gcc -o src/bin/tolua.o -c -O2 -ansi -Wall -fPIC -Iinclude src/bin/tolua.c
    src/bin/tolua.c: In function 'add_extra':
    src/bin/tolua.c:70:2: warning: implicit declaration of function 'luaL_getn' [-Wimplicit-function-declaration]
    gcc -o src/bin/toluabind_default.o -c -O2 -ansi -Wall -fPIC -Iinclude src/bin/toluabind_default.c
    gcc -o src/lib/tolua_event.o -c -O2 -ansi -Wall -fPIC -Iinclude src/lib/tolua_event.c
    src/lib/tolua_event.c: In function 'storeatubox':
    src/lib/tolua_event.c:26:3: warning: implicit declaration of function 'lua_getfenv' [-Wimplicit-function-declaration]
    src/lib/tolua_event.c:31:4: warning: implicit declaration of function 'lua_setfenv' [-Wimplicit-function-declaration]
    gcc -o src/lib/tolua_is.o -c -O2 -ansi -Wall -fPIC -Iinclude src/lib/tolua_is.c
    gcc -o src/lib/tolua_map.o -c -O2 -ansi -Wall -fPIC -Iinclude src/lib/tolua_map.c
    src/lib/tolua_map.c: In function 'tolua_bnd_setpeer':
    src/lib/tolua_map.c:266:2: warning: implicit declaration of function 'lua_setfenv' [-Wimplicit-function-declaration]
    src/lib/tolua_map.c: In function 'tolua_bnd_getpeer':
    src/lib/tolua_map.c:274:2: warning: implicit declaration of function 'lua_getfenv' [-Wimplicit-function-declaration]
    src/lib/tolua_map.c: In function 'tolua_usertype':
    src/lib/tolua_map.c:398:2: warning: passing argument 2 of 'tolua_newmetatable' discards 'const' qualifier from pointer target type [enabled by default]
    src/lib/tolua_map.c:28:12: note: expected 'char *' but argument is of type 'const char *'
    src/lib/tolua_map.c: In function 'tolua_beginmodule':
    src/lib/tolua_map.c:414:19: error: 'LUA_GLOBALSINDEX' undeclared (first use in this function)
    src/lib/tolua_map.c:414:19: note: each undeclared identifier is reported only once for each function it appears in
    src/lib/tolua_map.c: In function 'tolua_module':
    src/lib/tolua_map.c:448:19: error: 'LUA_GLOBALSINDEX' undeclared (first use in this function)
    src/lib/tolua_map.c: In function 'tolua_dobuffer':
    src/lib/tolua_map.c:699:36: warning: value computed is not used [-Wunused-value]
    scons: *** [src/lib/tolua_map.o] Error 1
    scons: building terminated because of errors.
    ==> ERROR: A failure occurred in build().
    Aborting...
    Last edited by xworld (2012-12-28 03:24:41)

  • I dont have any Add-ons with my FireFox. After upgrade to the latest version 26.0 I'm keep getting Script error "chrome://global/content/binding/popup.xml:580"

    Quite frequently I'm keep getting the error like "Script is not responding....I dont have any Add-ons with my FireFox. After upgrade to the latest version 26.0 I'm keep getting Script error "chrome://global/content/binding/popup.xml:580" Stop or Continue Script.
    Currently I don't have any Add-Ons installed in my FireFox, so I can suspect any Add-ons.
    I'm facing this issue only after the upgrade to 26.0 recently.

    Ifound this article:
    https://support.mozilla.org/pt-BR/questions/746499
    in this article the problem is similar not the same, but sdmitch16 had a intersting idea disable the chrome options
    and i search more in the internet i also found this:
    https://support.mozilla.org/pt-BR/questions/760704

  • Powershell - Need help combining multiple commands (?) into one script

    Scenario:
    When a user is terminated from our company, I run these scripts separately:
    1. I use the script below in Windows Powershell ISE to launch an entry box so I can enter in the username@domain and get a list of distribution groups the termed employee currently manage export to a CSV file on my desktop:
    Add-PSSnapin quest.activeroles.admanagement
    $USerID = Read-host "Enter in Username@domain. Example: [email protected]"
    connect-QADService -service blah.dc1.cba.corp -UseGlobalCatalog
    get-qadgroup -ManagedBy $UserID -Verbose | select Name,Type,DN | export-csv -
    NoTypeInformation "$home\desktop\$UserID.csv" -Verbose -Force
    2. I launch Powershell as an Administrator and run the following to activate Exchange Management in Powershell and to give me access to the entire forest of accounts:
    Add-PSSnapin -name "Microsoft.Exchange.Management.PowerShell.E2010"
    Set-AdServerSettings -ViewEntireForest $true
    3. Next, I run this script to remove the former owner's write permissions from the list of distribution lists they managed in the above CSV file:
    import-csv -Path "<PATH>" | Foreach-Object {Remove-ADPermission -Identity $_.Name -
    User '<domain\username>' -AccessRights WriteProperty -Properties “Member” -
    Confirm:$false}
    4. I run this script to show the new owner of the DLs, allow DL management via Webmail and add info in the Notes section on the DLs:
    import-csv -Path "<PATH>" | Foreach-Object {set-Group -Identity $_.Name -ManagedBy
    "<domain\username>" –Notes “<Enter Here>”}
    5. I run this script to allow management via Outlook and to automatically check the box in Active Directory "Manager can update membership list" under the Managed By tab within the Group's Properties:
    import-csv -Path "<PATH>" | Foreach-Object {Add-ADPermission -Identity $_.Name -User
    ‘<domain\username’ -AccessRights WriteProperty -Properties “Member”}
    Is there a way I can combine this into one Powershell script or two, at the most instead of having to copy and paste 6 different times and use two programs (Powershell and Powershell ISE)? 

    Rhys, again, thanks to your script, I was able to add even more to it to run nicely in PowerShell ISE (running as an Administrator):
    The following happens in the script below in this order:
    1. The script allows searching across multiple e-mail domains that we manage in Exchange
    2. It prompts for entry of the old owner's ID, the new owner's ID and notes that I want to add to the DLs.
    3. It exports a copy of lists owned by the old owner to a CSV file on my desktop.
    4. Powershell pauses and allows me to modify the old owner's.CSV file so I can remove any lists that should not be transferred, save the changes to the CSV file and click continue in Powershell ISE. If all lists should be transferred to the new owner, I
    would simply not edit the CSV export and click OK in Powershell ISE.
    5. Powershell ISE updates the DLs from the CSV export using the information I entered in the entry boxes.
    6. Powershell sleeps for about 1 minute after updating the DLs to allow Active Directory to register the changes. Then, Powershell ISE exports a copy of the lists transferred to the new owner to a <newownerID>.csv file on my desktop. This allows me
    to compare the CSV files (which should have the same exact lists on them) and make sure all of the lists were successfully transferred.
    7. If the lists are not the same because Active Directory didn't update in time while the file csv export was running for the new owner, I can run the script again with the exception of using the newownerID for the entry boxes in Step 2 (Notes don't matter
    as we won't execute any additional steps after capturing the updated export). You would simply select Cancel during the pause window that comes after the export completes to prevent the script from continuing a second time and overwriting your previous entries.
    8. You can now compare the updated newowner.csv to the oldowner.csv file on your desktop. 
    Add-PSSnapin -name "Microsoft.Exchange.Management.PowerShell.E2010"
    Add-PSSnapin quest.activeroles.admanagement
    Set-AdServerSettings -ViewEntireForest $true
    connect-QADService -service xyz-fakeserver.corp -UseGlobalCatalog
    Do {
       $FormerOwner = Read-host "Enter in former DL owner as Username@domain."
       $UserID = Read-host "Enter in new DL owner as Username@domain."
       $Notes = Read-host "Enter in Notes for DL"
       Try {
          get-qadgroup -ManagedBy $FormerOwner -Verbose -ErrorAction Stop | select Name | export-csv -NoTypeInformation "$home\desktop\$FormerOwner.csv" -Verbose -Force
    Read-Host 'Edit <FormerOwner>.CSV file on desktop to remove groups that should stay with current owner, save changes and press Enter or click OK to continue script. If all groups need to be transferred to new owner, do not modify CSV file and press Enter
    or click OK to continue.' 
    import-csv -Path "$home\desktop\$FormerOwner.csv"
    $UserList = import-csv "$home\desktop\$FormerOwner.csv"
    $Userlist | Foreach-Object {
             Remove-ADPermission -Identity $_.Name -User $FormerOwner -AccessRights WriteProperty -Properties “Member” -Confirm:$false
             set-Group -Identity $_.Name -ManagedBy $UserID –Notes $Notes
             Add-ADPermission -Identity $_.Name -User $UserID -AccessRights WriteProperty -Properties “Member”
    Start-Sleep -s 60
    get-qadgroup -ManagedBy $UserID -Verbose -ErrorAction Stop | select Name | export-csv -NoTypeInformation "$home\desktop\$UserID.csv" -Verbose -Force
          $Flag = $True
       } Catch {
          Write-Host "Invalid username or user not found, please try again"
    } While (!$Flag)

  • I keep getting 'unresponsive script' pop up which slows firefox n thunderbird, is this a bug?

    Both thinderbird n firefox for desktop slow down, then i get a pop up saying unresponsive script with options to 'stop script' or 'continue script'

    hi Honna,
    I'm sorry you are having this problem. here is a link to a forum post with additional suggestions from our top forum contributors that night help:
    https://support.mozilla.org/en-US/questions/909934
    -michelle

  • Inventory "ALL Devices" view contain scripts that hogs the browser

    We have a large deployment of Spiceworks on approx 3300 devices. Everytime I open Inventory > All Devices, my browser goes max CPU executing some kind of script on frontend. Everything on server side is OK (near 0% CPU).
    Steps to reproduce:
    1. Open Inventory > All Devices of 3300 devices.2. All Devices pane appears hanged on browser. After 3.5 minutes, it will be shown correctly.3. Search for a single device on the search bar. Click on the Asset name to open the asset. The asset is shown together with All Devices pane on top and will also hang the browser. After 3.5 minutes, it will be shown correctly.4. Everytime I lookup a single asset, it takes 3-4 minutes to open.5. When using Firefox, browser will prompt whether I would like to Stop Script or Continue Script. Then I press Stop Script, things works faster that way.
    This topic first appeared in the Spiceworks Community

    We have a large deployment of Spiceworks on approx 3300 devices. Everytime I open Inventory > All Devices, my browser goes max CPU executing some kind of script on frontend. Everything on server side is OK (near 0% CPU).
    Steps to reproduce:
    1. Open Inventory > All Devices of 3300 devices.2. All Devices pane appears hanged on browser. After 3.5 minutes, it will be shown correctly.3. Search for a single device on the search bar. Click on the Asset name to open the asset. The asset is shown together with All Devices pane on top and will also hang the browser. After 3.5 minutes, it will be shown correctly.4. Everytime I lookup a single asset, it takes 3-4 minutes to open.5. When using Firefox, browser will prompt whether I would like to Stop Script or Continue Script. Then I press Stop Script, things works faster that way.
    This topic first appeared in the Spiceworks Community

Maybe you are looking for

  • Agents cannot login in UCCX 8.5

    Hi All, I have UCCX 8.5, once the Agents want to login they get the following error: "Login failed due to a configuration error. Please ask you system  administrator to associate your phone with the RM JTAPI Provider user ID  according to the instruc

  • BBM display picture is blurry! Can not rotate and zoom. Update please

    Hi.. Please help me.. I just bought blackberry q10 but I really don't like how the BBM works. How to fix a blurry display picture on bbm? I'm using blackberry for a long time and I need to share and update my pictures to my family and my friends whic

  • "ipad software update server could not be contacted" error.... any help?

    Hi, Im getting an "ipad software update server could not be contacted" error. Is it a fault on my end or is it Apple which are still having problems and have disconnected their servers until it's fixed? Thanks

  • All help posted for Firefox cannot load websites but other programs can fail, now what?

    I have tried all the things listed but they made no difference at all. I have no problem with IE. I have been to this site before and it is a bookmarked site. This problem only came with the last update that never saved any of my search engines eithe

  • Printing bullets problem

    Hi I love iWeb, however there are some problems I get aproblem printing my pages from the browser (Safari/firefox etc). It does not look good, but when I print from iWeb it is fine. if you look at: http://www.gestalthuset.se/Ledarutvecklingsprogram.h