[SOLVED] Conky, LM-sensors and hwmon

Hi,
I used the guide found at the forum thread http://bbs.archlinux.org/viewtopic.php?id=43397 (post #4) to get my GPU and CPU temperature shown in conky by using LM-sensors. It all works fine, except for a single little error...
My conky-setup for the temperatures says
${color lightgrey} GPU: $color${hwmon 0 temp 1}°C ${color lightgrey}CPU Core 0: $color${hwmon 1 temp 1}°C ${color lightgrey}CPU Core 1: $color${hwmon 2 temp 1}°C
but when showing in conky, the "°C" part becomes "Å°C"??
Can anyone see why this happens? I've attached my whole .conkyrc below:
# set to yes if you want Conky to be forked in the background
background no
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=7
own_window_type desktop
own_window_transparent yes
own_window_colour hotpink
# Text alpha when using Xft
xftalpha 0.8
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 1
# Create own window instead of using desktop (required in nautilus)
own_window yes
# Shows the time range covered by a graph.
show_graph_range yes
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
#minimum_size 280 5
maximum_width 310
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 10
# border margins
#border_margin 2
# border width
border_width 1
# Default colors and also border colors
default_color 424de5
default_shade_color 0b0b0b
default_outline_color white
# Text alignment, other possible values are commented
#alignment top_left
#minimum_size 10 10
gap_x 10
gap_y 0
#alignment top_right
#alignment bottom_left
alignment bottom_right
# Gap between borders of screen and text
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
#${font Dungeon:style=Bold:pixelsize=10}I can change the font as well
#${font Verdana:size=10}as many times as I choose
#${font Perry:size=10}Including UTF-8,
#${font Luxi Mono:size=10}justo como este texto que o google traduz fêz o português
# stuff after 'TEXT' will be formatted on screen
#${font Grunge:size=12}${time %a %b %d}${alignr -25}${time %k:%M}
# Konfiguration fra Arch Forum:
# http://bbs.archlinux.org/viewtopic.php?id=56421
background yes
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
double_buffer yes
draw_outline no
draw_borders no
draw_graph_borders yes
stippled_borders 0
border_margin 0
border_width 0
TEXT
$sysname $kernel on $nodename
#${color lightgrey}Desktop: $color$desktop_name ($desktop/$desktop_number)
${color 00043d}$stippled_hr
${color lightgrey}Uptime:$color $uptime ${color lightgrey}- Load:$color $loadavg
${color lightgrey}CPU Usage:${color #424de5} ${cpu}% ${cpubar}
${color 091124}${cpugraph lightgrey 00043d}
${color lightgrey}RAM Usage:$color $mem/$memmax - $memperc% $membar
${color lightgrey}Swap Usage:$color $swap/$swapmax - $swapperc% $swapbar
${color lightgrey}Processes:$color $processes ${color grey}Running:$color $running_processes
${color 00043d}$stippled_hr
${color lightgrey}Networking (cable) - $color IP: ${addr eth0}
${color lightgrey} Down:$color ${downspeed eth0} k/s${color lightgrey} ${offset 70}Up:$color ${upspeed eth0} k/s
${color 091124}${downspeedgraph eth0 32,150 lightgrey 00043d} $alignr${color 091124}${upspeedgraph eth0 32,150 lightgrey 00043d}
${color lightgrey}Networking (wireless) - $color IP: ${addr wlan0}
${color lightgrey} Down:$color ${downspeed wlan0} k/s${color lightgrey} ${offset 70}Up:$color ${upspeed wlan0} k/s
${color 091124}${downspeedgraph wlan0 32,150 lightgrey 00043d} $alignr${color 091124}${upspeedgraph wlan0 32,150 lightgrey 00043d}
${color lightgrey}Wireless link quality: $color$wireless_link_qual $wireless_link_bar
${color lightgrey}Wireless ESSID: $color${wireless_essid}
${color 00043d}$stippled_hr
${color lightgrey}Battery: $color${battery BAT0} ${battery_bar BAT0}
${color 00043d}$stippled_hr
${color lightgrey}XMMS $xmms2_status
$color$xmms2_elapsed/$xmms2_duration $xmms2_bar
$color$xmms2_smart
${color lightgrey}Mixer: $color${mixer} ${mixerbar}
${color 00043d}$stippled_hr
${color lightgrey}Disk read: $color$diskio_read ${color lightgrey}- Disk write: $color$diskio_write
${color 091124}${diskiograph sda lightgrey 00043d}
${color lightgrey}File systems:
${color lightgrey} / $color${fs_used /}/${fs_size /} ${fs_bar /}
${color lightgrey} data $color${fs_used /mnt/data}/${fs_size /mnt/data} ${fs_bar /mnt/data}
${color lightgrey} vista $color${fs_used /mnt/vista}/${fs_size /mnt/vista} ${fs_bar /mnt/vista}
${color lightgrey} xp $color${fs_used /mnt/xp}/${fs_size /mnt/xp} ${fs_bar /mnt/xp}
${color 00043d}$stippled_hr
${color lightgrey}System temperatures:
${color lightgrey} GPU: $color${hwmon 0 temp 1}°C ${color lightgrey}CPU Core 0: $color${hwmon 1 temp 1}°C ${color lightgrey}CPU Core 1: $color${hwmon 2 temp 1}°C
${color 00043d}$stippled_hr
${color}Name PID CPU% MEM%
${color #308ffd} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color}Mem usage
${color #308ffd} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color lightgrey} ${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color lightgrey} ${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
EDIT: Found the error: I had edited the file in mousepad, which couldn't save the "°"'s right..
Last edited by bozack (2009-09-09 12:45:21)

nTia89 wrote:
try to append in the .conkyrc
the setting:
override_utf8_locale
It didn't work - but I might have to say - my locale is danish (in my locale.gen I have the two lines "da_DK.UTF-8 UTF-8" and "da_DK ISO-8859-1" uncommented)..
Does this make any difference?

Similar Messages

  • [solved] Conky 1.81 and execpi regression (messed up output)?

    Hi all,
    I have a script which dynamically outputs the following lines
    ${font dejavusansmono:size=8}$color1${fs_free_perc /}% free on /$alignr${diskio disk/by-uuid/9f90f2fa-49ce-4fb7-886b-bcebbc2fc231}/s
    $color3${fs_bar 14 /}
    $color1${voffset -20}$alignr${fs_used /}/${fs_size /} $font
    ${font dejavusansmono:size=8}$color1${fs_free_perc /home}% free on /home$alignr${diskio sda6}/s
    $color3${fs_bar 14 /home}
    $color1${voffset -20}$alignr${fs_used /home}/${fs_size /home} $font
    ${font dejavusansmono:size=8}$color1${fs_free_perc /home/data}% free on /home/data$alignr${diskio sda5}/s
    $color3${fs_bar 14 /home/data}
    $color1${voffset -20}$alignr${fs_used /home/data}/${fs_size /home/data} $font
    When I copy the output and paste it into my conky, it shows as expected, but when I run the script via ${execpi 6 /path/to/my/script} it comes out messed up.
    Does anyone else see this? I was going to submit it to conky's bug tracker but a quick look at their sourceforge site doesn't reveal any such.
    Last edited by ngoonee (2011-10-27 00:39:47)

    That work around doesn't work for me, I use this script:
    $ cat diskSpace
    #!/bin/bash
    #: Description : Shows the free space of attached devices for Conky
    ## List of places to be displayed if mounted
    placesDisplayed=/home/tom/.ConkyScripts/placesDisplayed
    ## Go through each place
    while read place
    do
    ## If they exist in mtab then print them and their size
    if [[ $( mount | grep -c $place ) -gt 0 ]]
    then
    printf "%s \${alignr}\${fs_used %s} / \${fs_size %s}\n" $place $place $place
    fi
    done < $placesDisplayed
    and it outputs:
    / ${alignr}${fs_used /} / ${fs_size /}
    /home ${alignr}${fs_used /home} / ${fs_size /home}
    /mnt/Windows ${alignr}${fs_used /mnt/Windows} / ${fs_size /mnt/Windows}
    /media/iphone ${alignr}${fs_used /media/iphone} / ${fs_size /media/iphone}
    Which currently looks like this.
    It does the same thing with your workaround...
    The conky bug tracker is useless, no one has done anything about it in months. Any better work arounds or, even better, how would I go about patching this myself?
    Edit: Ok so I downloaded the source and the change log says that the fix was added in 2009:
    2009-07-18
    * Added compilation switch --enable-xoap to be able to use
    www.weather.com as a source of weather data (this avoids adding
    libxml2 as a required dependency for users that wish to use noaa
    and not weather.com)
    * Added support for X alignment across multi-lined objects (i.e., using
    $alignr with $exec)
    * Disabled OpenMP code until GCC's implementation stabilizes
    * www.weather.com can now be used as well as a source of weather data
    How old is the one in the arch repos?
    Unless this is only fixing alignr before and execp instead of in an execp. (Sorry for the wall of text, I've got to put this somewhere otherwise in another month it'll bug me again until it's fixed).
    Last edited by BaconPie (2010-12-22 12:17:39)

  • Finger print sensor and SimplePass Software is not working

    Hey there,
    I have a HP Pavilion dv7-6c95dx and the finger print sensor and SimplePass Software is not working.  I am unable to find the relevant drivers/etc from the HP website.  Any advise would be appreciated.  The device was purchased in the USA.
    Thanks.
    This question was solved.
    View Solution.

    Hi:
    I believe this driver from the dv7t-7000 will work as well as the security software to register your fingerprint.
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-103013-1&cc=us&dlc=en&lc=en...
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-117897-1&cc=us&dlc=en&lc=en...

  • Is new software around for Ipod Nano 5G with the Nike sensor and Polar wearlink HeartRateMonitor to get spoken feedback on heartrate-zone, so you get a warning if your heartrate is higher or lower than the predefined range.

    I have:
    Ipod Nano 5G with Nike+ sensor and Polar wearlink Heartrate monitor:
    works fine, linking is easy, but....
    Software is rather minimal: Heartrate is on the screen and you get feedback when the center-button is touched.
    To get better results, more functions would be useful, like defining a heartrate zone (like Polar`s own-zone) and automatic spoken feedback if the heartrate is out of the pre-defined range. Also automatic spoken feedback on actual and average heartrate every pre-defined time-interval would be very useful: like the spoken feedback on distance and actual pace I get on my Iphone with Nike+GPS
    Anyone have any suggestions ?

    I have the same issue! I purchased a nano 6th, polar hrm so I could run and receive spoken feedback when my heart rate was outside my preset zone.  My suunto t3 used to beep when outside the preset zones.  Automatic, periodic beeps or spoken feedback is the most important information to receive during exercise. I hope apple can update the software to add this simple yet critical feature.

  • [SOLVED] conky-lua build fails due to toluapp package issues

    I am trying to install conky-lua from AUR on 64 bit Arch and failing miserably.
    When running the following:
    yaourt -Sy conky-lua
    I get the following error:
    /usr/bin/ld: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.2/../../../../lib/libtolua++.a(tolua_is.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.2/../../../../lib/libtolua++.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make[1]: *** [libcairo.la] Error 1
    make[1]: Leaving directory `/tmp/yaourt-tmp-mark/aur-conky-lua/conky-lua/src/conky-1.7.2/lua'
    make: *** [all-recursive] Error 1
    ==> ERROR: Build Failed.
    Aborting...
    Error: Makepkg was unable to build conky-lua package.
    I have read through what search results I can find on the topic (both here and via google) and have attempted to remedy the situation by adding build options to the toluapp build to provide for the conky-lua build. I have tried this by adding CCFLAGS = '-fPIC' to the scons call in the PKGBUILD file, I have also tried editing the config_linux.py file, which sits along side the main build file, to include the -fPIC switch also, which doesn't work either. i.e. I have this in the config_linux.py now:
    CCFLAGS = ['-O2', '-ansi', '-Wall', '-fPIC']
    Which doesn't work, it results in:
    ==> Validating source files with md5sums...
    tolua++-1.0.93.tar.bz2 ... Passed
    config_linux.py ... FAILED
    ==> ERROR: One or more files did not pass the validity check!
    Error: Makepkg was unable to build toluapp package.
    Can someone help me through a build as I have never come across scons before and maybe I am providing directives to the toluapp build incorrectly? I am still thinking in "make" terms...
    I NEED lua in conky
    Thanks in advance
    Regards,
    Kaivalagi
    Last edited by kaivalagi (2009-11-11 07:32:04)

    I was asked by email on what exactly I did to get conky-lua installed and working on 64bit Arch, so I thought I would post my reply below in case it is of help to anyone else. Cheers
    Run "yaourt -S conky-lua". Amongst other things this will try to install a dependancy which you need to mess about with, the package you need to edit is "toluapp".
    When the "toluapp" package is downloaded by yaourt answer y to the edit question and provide something like gedit or kate as the editor to use
    You'll now see the PKGBUILD file in the editor, this doesn't need editing just yet. But if you open file from the editor you'll see the directory thie PKGBUILD is in, and you want to edit the config_linux.py file you'll see there.
    You should see this line in the config_linux.py file:
    CCFLAGS = ['-O2', '-ansi', '-Wall']
    Change it so it is like this:
    CCFLAGS = ['-O2', '-ansi', '-Wall', '-fPIC']
    Now, back to the PKGBUILD file, you'll see this line:
    md5sums=('100aa6907b8108582080b37d79c0afd7' 'bab107cdd2d18d3453a2344341b77c45')
    These checksums line up with tarball and config_linux.py files, and this will stop you're edit from working if not amended because the .py file isn't what it should be, we changed it. So run md5sum against the .py file and update the second checksum in the line appropriately.
    Carry on with the package installation and conky should have lua support
    Last edited by kaivalagi (2010-01-14 08:50:55)

  • Few days before I brought one iphone 5 by second party and this phone make a unlock but it sometime have a cellular network most of time say no service can u solve this problem please and I put serial number it say this phone is replace can u help me for

    Few days before I brought one iphone 5 by second party and this phone make a unlock but it sometime have a cellular network most of time say no service can u solve this problem please and I put serial number it say this phone is replace can u help me for original serial number....

    If Apple's service database says that your iPhone was replaced, then Apple will no longer provide any service for that phone.
    First, get a new SIM from your cell carrier and see if that corrects the problem. If it does not, try the usual steps for addressing software problems: restart, reset, restore.
    http://support.apple.com/kb/HT1430
    http://support.apple.com/kb/HT1414
    If you try restoring from a backup and that doesn't fix the problem, try restoring to factory settings and, if the problem goes away, then sync back your apps and content. You'll lose the app data and settings, but if the problem is due to a corrupt cache or settings file, restoring to factory settings should cure it.
    If none of that helps, your device may have developed a hardware fault. Again, Apple will provide no service for it, so you will need to pay some independent repair shop to fix your iPhone.
    Regards.

  • Can cFP-AI-111 power a sensor and remain IS

    We aree evaluating using Compact FieldPoint in a hazardous environment and have a couple of questions:
    1.Is it possoble for the cFP-AI-111 to power a sensor and remain intrinsically safe? If so, what is required?
    2.Is there a cFP module that will work with a potentiometer and/or Wheston Bridge type sensor?
    Regards,
    Barrett

    Dear Barrett,
    You can power your cFP-AI-111 using Figure 5 from the Operating Instructions. Use a wire to connect V and Vsup, C and COM, and wire your sensor like Figure 5. What do you mean by intrinsically safe? Would this setup work?
    As for the different cFP modules, take a look at the cFP-RTD-124 and the cFP-SG-140. All of the analog input modules can be found here.
    Please let me know if you have any questions. Have a great day!
    Sincerely,
    Marni S.

  • Read sensor and move servo

    Hi!, I have a proble.
    I don´t know how i must do to read sensors and at same time run the servos.
    I upload the program .VI
    http://www.gigasize.com/get.php?d=tg1jvvdzssc
    Thanks
    Attachments:
    servoaungulo6.vi ‏28 KB

    help?

  • Setting up DAQ system for testing (using pressure transducer, linear position sensor and strain gauges)

    Hello,
    I like to get your suggestion in setting up the DAQ system. I am very beginner in this issue.
    These SCXI listed below are what we have in the laboratory. I will use DAQ card 6062E.
    SCXI 1000
    SCXI 1520
    SCXI 1140
    SCXI 1142
    SCXI 1305 , 1302 , 1300
    SCXI 1122
    SCXI 1100
    I will use linear position sensor in my experiment. But I'm not sure which SCXI shoud I connect to this sensor.
    This sensor gives 4-20mA output. it requires +13 to +28Vdc excitation.
    I will use pressure transducer (strain gauge type) which gives 100mV output and requires 10Vdc supply.
    I will use strain gauges 350 ohm.
    Regarding to the number of channels used in my experiment, I will use 1 channel of pressure transducer, 1 channel of linear position sensor and 3 or 4 strain gauges.
    Could you please suggest me which SCXI should be used with pressure transducer, linear position sensor and strain gauges.
    Now I'm thinking to use SCXI 1520 with strain gauges and pressure transducer. Is that ok?
    But I'm not so sure on the linear position sensor which gives current output.
    And regarding to sampling rate, I like to get minimum of 60-70 KS/s for pressure transducer. And around 1KS/s for linear position sensor and 1KS/s for each channel of strain gauge are enough. Can I archieve these sampling rate from the available SCXI modules mentioned before? I attached the datasheet of pressure transducer and linear position sensor for you. Please see attached files.
    I'm reallly look forward for your suggestion.
    Thank you in advance,
    Ganchai.
    Attachments:
    XPM6_mini. pr. transducer.pdf ‏115 KB
    linear-position-sensor.pdf ‏1683 KB

    Hi Ganchai,
    I would recommend the 1520 with a 1314 terminal block for connecting your pressure transducer and strain gauge. It is designed for excitation, bridge completion and has many other features to fit these applications. For your linear position sensor, try using the 1100 module with an additional precision shunt resistor. For example, our 1308 terminal block has built in 249Ohm shunt resistors for taking current inputs for your 1100. These connections should give you the readings you would like.
    As far as sampling rate goes, you should be fine with your requirements. Good luck and I hope you are succesful.
    PBear
    NI RF

  • IPhone Liquid Submersion Sensor and Dead Pixels

    Today I went down to my carrier HQ. (Singtel, Singapore).
    I went to spoke to the person at the iPhone servicing counter.
    He told me that my iPhone Liquid Submersion Sensor has been triggered and it's now out of warranty.
    And my purpose is there, to have my iPhone exchange as my home button is getting unresponsive at times.
    And he told me that this is under Apple policy. When I purchase the phone, the salesperson didn't even told me about the policy and I wasn't aware of that.
    So the main point is my iPhone Liquid Submersion Sensor and I didn't even drop it into any liquid, I don't know why but it's just unfair for me as an end user.
    Question here, will playing apps like Ocarina activate the iPhone LSS? Only my bottom LSS is triggered, the top one isn't.
    Also to recall, at the point when I'm buying my iPhone 3G last year, out of the box there is already a dead pixel and the person refuse to change a new set for me.
    I'm in need of an iPhone urgently, anybody can tell me what to do?

    Ocarina could trigger the water sensor since you could spit into the dock connector while blowing into the mic.

  • I have an optical sensor and two hall effect how can I data log?

    I have built a test rig which consists of a gyroscope.  The gyro is spun up by and electric motor.
    I need to measure the speed of rotation.  I’m using an optical sensor and two Hall
    Effect sensors.  I would like to record the
    output of these and I would like to build in some redundancy because there will
    be another bigger rig that will require more measurement.  E.g. vibration.
    I’m new to data logging so I’m not sure which hardware I
    should be getting.
    Thanks

    analog inputs are the most universal.  with software such as the functions included in the Sound and Vibration Measurement Suite, you can analyze the analog input channel which is connected to your hall effect and optical sensors for frequency and speed.  Vibration specific input cards will power accelerometers.  with the speed and angular position sensors (hall effect and optical) you can combine this information with your vibration sensors to determine the movement of the device with respect to position and speed.  These order analysis functions are part of the Sound and Vibration Measurement Suite. 
    What is more is that the Suite includes an assistant.  The assistant allows for the capture and datalogging of all analog and digital inputs as well as frequency and vibration analysis.  This is all configurable and does not require any LabVIEW programming.  If you decide you want LabVIEW programming, all the functions are there to support LabVIEW as well. 
    Here is the link:
    http://www.ni.com/soundandvibration/
    Preston Johnson
    Principal Sales Engineer
    Condition Monitoring Systems
    Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
    National Instruments
    [email protected]
    www.ni.com/mcm
    www.ni.com/soundandvibration
    www.ni.com/biganalogdata
    512-683-5444

  • WANTED: Test Engineer for CCD/CMOS image sensors and cameras...

    TEST ENGINEER
    Education:  BSEE or equivalent
    Experience:  5+ years experience in Test Engineering.  Preferred experience with Imaging and CCD cameras.  Must have programming experience with labview, and experience with other languages is a plus.  Must be familiar with standard test equipment such as an oscilloscope, parameter analyzer, etc.  Working knowledge of electronic circuits, and familiar with camera parameters.  Experience as a technical lead is a plus. 
    Duties:  Characterize and test CCD/CMOS image sensors and cameras.  Develop test plans, and create automated test systems.  Provide documentation, training and support for systems engineering efforts.  Develop quick solutions for engineering camera development efforts to aid in root cause analysis.
    Located in Milpitas, California, in the heart of the Silicon Valley, Fairchild Imaging is a pioneer in the CCD industry.  We recognize our products are only as good as our people who develop them. We are therefore looking for passionate, innovative people who enjoy the challenges of technology.  We offer competitive salaries, outstanding benefits, a 9/80 work schedule and a fun and creative working environment.
    U.S. Citizenship or permanent residency required. Fairchild Imaging is an equal opportunity employer.

    Visit the Fairchild Imaging Website for details on the company and the products.  Fairchild Imaging makes a wide spectrum of cameras including Aerospace, scientific and  medical and Fairchild Imaging has been producing CCDs since 1975.   Our cameras range in pixels size from below 1meg to over 81 meg with pixels down to 8.75u.  One of our CCDs was used in the Deep Impact project where a camera was fired into a comet which is one of many interesting projects.
    You will be working on a team of 10 dealing with testing of camera systems with responsiblity for test at the wafer level to finished camera.  This is a great opportunity to work with a talented staff with a interesting mix of products.

  • [SOLVED] Conky Mail Notification using a Bash Script

    Hi there, I have conky piped into a dzen panel, and I'm trying to get conky to echo my unread mail count whenever the # is >0. It's just not working for me, and I was wondering what I did incorrectly.
    I have the 3 following files.
    ~/.conkyrc
    background yes
    out_to_console yes
    out_to_x no
    update_interval 1
    TEXT
    ${execi 60 /home/nil/mail-notify}
    ~/mail-notify
    #! /bin/bash
    gmail=$(python /home/nil/gmail.py)
    if [ $gmail -gt 0 ]; then
    echo "$gmail"
    fi
    ~/gmail.py
    #!/usr/bin/env python
    # This is a script that checkes the gmail unread count.
    from urllib.request import FancyURLopener
    username = 'myusername'
    password = 'mypasswd'
    url = 'https://%s:%[email protected]/mail/feed/atom' % (username, password)
    opener = FancyURLopener()
    page = opener.open(url)
    contents = page.read().decode('utf-8')
    ifrom = contents.index('<fullcount>') + 11
    ito = contents.index('</fullcount>')
    unread = contents[ifrom:ito]
    print(unread)
    gmail.py was taken from the archwiki page, and I've confirmed it to be working (I censored my user name and password here). What gmail.py does is output an integer representing your unread mail count.
    Similarly, Conky's code and the mail-notify script run fine. If I rewrite mail-notify's conditional to be "if [ 1 -gt 0 ]; then", then it will successfully output the unread mail count. Hence the problem lies in the scripting of the if condition. mail-notify should run gmail.py, if the output count is >0, then it should echo that number. Else it does nothing. Any help is appreciated!
    Last edited by nil (2013-08-19 23:40:14)

    jasonwryan wrote:Presumably the script is called gmail.py, not gmail1.py?
    Oops, sorry, that was a typo when writing up this post.

  • Hello, I trying to create a program that would run a household furnace. I can't find a way to set timers for the ignitor,flame sensor and blowers. Any thoughts.

    Hello, I'm trying to create a program that would run a household furnace. I can't find a way to set timers foe the ignitor,flame sensor and blowers. Any thoughts would be greatly appreciated. Thanks, primetime

    In the detailed help for the event structure there is a link to caveats and recommendations for using event structures.  It is a good starting point.
    It is courteous to let the Forum know when your questions are related to a school assignment or homework.  We are glad to help you learn LabVIEW, but do not do your homework for you.
    You have learned the major disadvantage of the sequence structure: It must run to completion before anything else can happen.
    If you are building a state machine (typically a while loop with shift registers enclosing a case structure with one case per state) and having trouble with timing, then think about your requirements. Apparently you have some time delays, but under certain conditions you must terminate a delay/wait and do something else.  One way of doing this is to have a Wait state.  The wait state has a short delay, determined by the minimum time you can delay responding to a changed condition, and a check to see if the required elapsed time has occurred.  If the time has not elapsed, the next state is the Wait state again.  The state machine can repeat any state as often as necessary.  So a 15 second delay could be implemented by going to a Wait state with a one second wait 15 times. Any error or new command will see a response in no more than one second.
    Lynn

  • What is the extra slot at the top of the white phone? Is it the proximity sensor and just shows thru the white face?

    What is the extra slot at the top of the white phone? Is it the proximity sensor and just shows thru the white face?

    Perhaps I used that screen name 18 months ago before the iPhone 4 came out and just forgot it. It does show my email address in the profile. I kind a like it so I'll keeping using it. What 18 months can do for your mind.

Maybe you are looking for