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)

Similar Messages

  • Help I can't get my images and description from recordset to display in repeat region table

    Hi everyone,
    could somebody please help me, this is my first php and mysql website, I have a web page that is supposed to display a table with 2 rows 3 columns.
    In each column i want an image, a description and a paypal button.
    then i have a repeat region placed around the second row which should display 3 records at a time.
    The recordset worked when I tested it several times, and the paypal button displays in the browser, but the image and the description won't display and the repeat region doesn't work either as only one button paypal button displays.
    I have uploaded the actual page, in the hope that some could take a look and help me to find out what the problem is.
    Thanks

    In the second row, did you mean you want the three fields to display, not three records?  A record is one row of data.
    Start by getting a single row to display, and leave the paypal button out for now.  So that means you will see the first record in your recordset, the image and description.  To view the description, use the data bindings panel, expand the recordset and drag the description field onto the page in the table.  For the image, insert and image placeholder and point the source to a dynamic data source. Again, choose the approprate field from your recordset.
    Once that record is working, add your repeat region and test.
    For the Paypal button, I am not sure if each button will carry the correct information with it in a repeat region.  There has to be a way to dynamicall add the approprate data to the paypal link for each record.  You may want to also incude checkboxes or radio buttons and have only 1 paypal button - but that introduces other issues which we can tackle later.

  • I lost all of my artist names and album names for my iTunes library. They are all now on one album. How can I get the album and artist names back?

    I lost all of my artist names and album names for my iTunes library. They are all now on one album. How can I get the album and artist names back?

    I have a script called ExportImport for this task, but it only runs in Windows.
    In principle something similar should be possible in AppleScript, but I don't currently have access to a Mac to write it myself.
    tt2

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • How can i get the itunes and apps store icon on my ipad desktop?

    How can i get the itunes and apps store icon on my ipad desktop?

    Google are supposed to be working on an iPad maps app.

  • I recently got a new computer and it wont sync with my ipod. How can i get my music and stuff on my computer

    I recently got a new computer and it wont sync with my ipod. How can i get my music and stuff on my computer?

    iPods and other iDevices are not backup or storage devices.
    Copy the ENTIRE iTunes folder (and all other desired data) from the old computer to the new computer.

  • How Can I Get My Ratings and Playlists to Mirror Across Multiple Accounts?

    I'm sharing my music across two accounts on my Mac by placing my iTunes folder in the Shared folder, with an alias to that in each User's Music folder. It works fine, but the User of the other account would like the benefit of all my Playlists, and would especially like to have all My Ratings.
    How can I get My Ratings and Playlists to mirror across multiple accounts? I would've thought simply importing the <iTunes Music Library.xml> file would do it, but since we're both using the same iTunes folder, we must already be using the same XML file, right?

    The answer about where the ratings, etc. are stored is not an easy one, but the best I can figure is that it is a combination of the iTunes Music Library.xml, the iTunes Library file, and the com.apple.iTunes.plist. Apparently, the com.apple.iTunes.plist (in the under User/Library/Preferences) references the other two files. If you close iTunes, take the com.apple.iTunes.plist out of the user's Library/Preferences folder and then reopen iTunes, you will see that all the ratings, play counts, etc. (track information) will have disappeared. If you close iTunes, replace the com.apple.iTunes.plist, then reopen iTunes, the track information will be restored. The playlists, which are not part of the track information, seem to function independently of the com.apple.iTunes.plist, but if you share the whole iTunes folder across accounts, this should include the playlists. When I back up my iTunes library to another folder, I back up a copy of the current com.apple.iTunes.plist from my User/Library/Preference folder. I think that the way this works across multiple accounts is that the com.apple.iTunes.plist reads track information from the other files in the iTunes folder, because if you throw away the com.apple.iTunes.plist from one user account, it affects all the other user accounts sharing the same iTunes folder.

  • I got an iTunes account years ago with an ID and password...them later got a mobile me and password...now I have an iPad and downloaded iCloud and I can't get my movies and tv shows on iPad because different account name and password from my mobile me.

    I can't get my movies and tv shows on iPad now that I have added iCloud. The problem is that my iTunes account has different name and password from my mobile me account.  Can I change my iTunes account name and password so that they will transfer to my iPad with the mobile me / iCloud account? I need to figure out how to make the two accounts one or iCloud has to be able to accept my iTunes account with years of music and movies.

    Hunter of Sock Monsters thanks...I did follow your advise.  I went to the iforgot site and tried answering the secret questions twice.  I got the "wrong answer", so the next time I asked for an email authentication.  I am still waiting. I don't know what the usual time for waiting normally is. I am still waiting for an email reply from three days ago.  I'm not going to hold my breath.  My ipad is out of warranty but I may have to beg for help from support? I'll wait awhile longer.  Maybe there is another thing someone could come up with.  I appreciate your fast reply Hunter.

  • I just switched my phone to a samsung galaxy 3 how can i get my contacts and pictures from Icloud

    i need help how can i get my contacts and photos on my new phone it is a samsung galaxy 3

    Check whether Samsung have any apps for that.

  • I have a macbook pro and I connected a new iphone to my computer. Somehow all my pictures in the iphoto app deleted. How can I get them back, and no I do not have my TimeMachine On. Please help!

    I have a macbook pro and I connected a new iphone to my computer. Somehow all my pictures in the iphoto app deleted. How can I get them back, and no I do not have my TimeMachine On. Please help!

    If you are running Lion then all drivers are distributed through Software Update. You do not need to install anything, other than to install the printer in System Preferences > Print & Scan. If you already added the printer while it was connected using USB, you might want to delete it and set it up again wirelessly to avoid confusion. Or, give them two distinct names e.g. "Photosmart D110 (USB)" and "Photosmart D110 (wireless)".
    All scanning functions are now performed using Preview, but you can also access the scanner through the same Print & Scan preference pane, or with Image Capture.
    This HP document may help explain how driver software is distributed now:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03079365&cc=us&dlc=en&lc=en &product=4144493&tmp_track_link=ot_search#N108

  • I am in Saudi and trying to download navigon middle east. Every time I try to buy the app it will show up, says waiting and disappears. How can I get around it and not get lost on these crazy roads?

    I am in Saudi and trying to download navigon middle east. Every time I try to buy the app it will show up, says waiting and disappears. How can I get around it and not get lost on these crazy roads?

    I recently purchased a second hand new macbook air, although it was second hand to me the previous owner had never actually turned it on.
    Something doesn't make sense here, though I'm not saying the previous owner is lying....
    Time to send your serial # to iTS and let them see what's happening here.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • Adding reminders to my calendar items is no longer an option after the software upgrade.  I also can't get to day and week view, only month view.  What's a possible solution?

    Adding reminders to my calendar items is no longer an option after the software upgrade.  I also can't get to day and week view, only month view.  What's a possible solution?  I'm using Andriod version 4.4.2 with kernal 3.4.0.

        @MaloneTP
    Thanks for keeping me updated!  Do you see the screen options displayed in the following link: http://bit.ly/T2koBL for changing the calendar view options in Kies Air?  Also, let me know if you're able to add a Reminder by following these steps: http://bit.ly/T2l9dY.  Keep me posted.  Thanks!
    AnthonyTa_VZW
    Follow us on Twitter @VZWSupport

  • I ordered Illustrator for another user.  I received an invitation that was accepted, logged in and tried to change the account to the name and email of the person it was ordered for.  How can I get this changed and the invitation sent to the right person?

    I ordered Illustrator via creative cloud for another user.  I received an invitation that was accepted  and tried to change the account to the name and email of the person it was ordered for.  How can I get this changed and the invitation sent to the right person? 

    Cloud as a Gift https://forums.adobe.com/thread/1665610

  • The LCD for my macbook air model number MC965LL/A (purchased 2011) is broken , where  can I get new one and what is the part number for it ?

    The LCD for my macbook air model number MC965LL/A (purchased 2011) is broken , where  can I get new one and what is the part number for it ?

    You can find them at vendors like ifixit and instructions to install.
    http://www.ifixit.com/Mac-Parts/MacBook-Air-13%22-Mid-2011

Maybe you are looking for

  • Complete Button on Purchase Order

    Can anyone tell me when the Complete button becomes active on the purchase order?  We have had a few POs that have gone into Transaction Complete status even though there are no goods receipts against the PO.  It seems that the Complete button only b

  • Correct procedure to transfers Sales Delivery to Sales A/R Invoice

    Hi, Is there someone who can white some code to explain the best way to transfers a Sales Delivery to A/R Invoice with the SDK the same way as Copy To (A/R Invoice) from the Delivery window in SAP ? I've been successful at transfering one by hand sav

  • ATV2 sync from my laptop

    Hi. I have tried to find the answer in other posts with no luck, so here we go: I have just bought the Apple TV 2. gen and it went smooth online wirelessly through my Time Capsule. When trying to connect to my computer I need to type in my Apple ID a

  • Accessory Goods as Free Items

    Dear All, Pls suggest the SAP best practise for the below scenario. We are suppling the material to the customer along with accessroies. As accessory material is not included in the sale order, stock for the same is not getting deducted. Neither BOm

  • Shared Services - CustomClass implementation issues, need help?

    We are attempting to deploy a custom login and custom authentication module to Shared Services, but we are receiving the following error: [2013-11-15T13:43:23.527-05:00] [EPMCSS] [NOTIFICATION:16] [EPMCSS-20007] [oracle.EPMCSS.CSS] [tid: 14] [ecid: d