SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#6051 2013-08-27 10:09:43

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

hello

i want to display the current distance earth-moon in lua:

function test()
	intervall=60

	local updates = tonumber(conky_parse('${updates}'))
	if (math.mod(updates, intervall) == 0) then
		sheldon=os.execute("wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O ~/distance -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance")
	
	end
	return sheldon
end

it will not work. do you know why?

Offline

Help fund CrunchBang, donate to the project!

#6052 2013-08-27 12:38:37

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,558

Re: Conky v1.9 Thread

Wodanford wrote:

I have a desktop, with the Asus P8Z77-I Deluxe if that helps.

You can take a look at /etc/modules to see if there is one not getting loaded (should also show as a message when you're booting), or run sensors-detect again to see what it determines you need.

I just did a google search for the module that wasn't loading with the current kernel - the module for my desktop that use to work now requires an additional kernel parameter at boot time to override a new security feature. It's an old (custom build circa 2001) desktop, I wouldn't think a newer one would require that.

You can also check the level of support for your hardware at lm-sensors.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#6053 2013-08-27 14:09:24

Wodanford
Member
From: The Netherlands
Registered: 2013-08-19
Posts: 35

Re: Conky v1.9 Thread

Woah, that looks quite informative. Thank you, I'll look into it.


Silverstone SUGO SG05BB-450 · Asus P8Z77-I Deluxe · Intel Core i5-3570K (lapped)
Intel HD Graphics 4000 ·Crucial 128GB m4 SSD · Crucial BX Tactical 8 GB DDR3-1600
Bluray drive (taken from an Acer Aspire 5940G) · iiyama ProLite B2776HDS
Logitech K230 · Razer Abyssus

Offline

#6054 2013-08-27 14:32:45

chepioq
#! Member
Registered: 2013-01-09
Posts: 78

Re: Conky v1.9 Thread

lionhead wrote:

hello

i want to display the current distance earth-moon in lua:

function test()
	intervall=60

	local updates = tonumber(conky_parse('${updates}'))
	if (math.mod(updates, intervall) == 0) then
		sheldon=os.execute("wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O ~/distance -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance")
	
	end
	return sheldon
end

it will not work. do you know why?

I don't why it's don't work

Just for info, I simplify the wget code, you can use

wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance

instead of

wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O ~/distance -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance

Offline

#6055 2013-08-27 14:43:22

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

chepioq wrote:

I don't why it's don't work

Just for info, I simplify the wget code, you can use

wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance

instead of

wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O ~/distance -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance

unfortunately, it only shows the value: 0

Offline

#6056 2013-08-27 14:57:24

chepioq
#! Member
Registered: 2013-01-09
Posts: 78

Re: Conky v1.9 Thread

lionhead wrote:
chepioq wrote:

I don't why it's don't work

Just for info, I simplify the wget code, you can use

wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance

instead of

wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O ~/distance -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance

unfortunately, it only shows the value: 0

strange, on my PC, in console, wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/a … nTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance return good value :

[dominique@host ~]$ wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance
Distance: 399329 kilometres, 62.6 Earth radii
[dominique@host ~]$ 

Offline

#6057 2013-08-27 16:34:24

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

why won't work this:

#! /bin/bash
dist=`wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance`
echo $dist

at the moment it looks like that the script gives me an empty result. maybe they have problems with their website.

Last edited by lionhead (2013-08-27 16:46:42)

Offline

#6058 2013-08-27 17:20:16

chepioq
#! Member
Registered: 2013-01-09
Posts: 78

Re: Conky v1.9 Thread

lionhead wrote:

why won't work this:

#! /bin/bash
dist=`wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance`
echo $dist

at the moment it looks like that the script gives me an empty result. maybe they have problems with their website.

For me, at this time, your script work.

But this afternoon, when I tested my command line, sometimes that don't work...

May be too many connections to the site...

Offline

#6059 2013-08-27 17:40:16

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

>too many connections

that would be logically. lets wait some hours.

it's to unstable if you grab this data direct from this webpage. it's better to keep a copy on the hdd. similar like this:

#! /bin/bash
wget http://voyager.jpl.nasa.gov/where/index.html -O ~/voyager.html  && 
dist=`cat voyager.html | grep "dist_1_v1 =" | awk '{print $4}' | awk 'sub("......$", "")'` 
echo $dist

Last edited by lionhead (2013-08-27 18:11:51)

Offline

#6060 2013-08-27 23:01:27

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

LUA function 'os.execute' executes OS commands but it returns either '0' if execution succeed or '1' if failed.
If you want result of 'wget' to be passed to variable you need to use this function:

 function os_capture(cmd, raw)
 	local f = assert(io.popen(cmd, 'r'))
 	local s = assert(f:read('*a'))
 	f:close()
 	if raw then return s end
 	s = string.gsub(s, '^%s+', '')
 	s = string.gsub(s, '%s+$', '')
 	s = string.gsub(s, '[\n\r]+', ' ')
 	return s
 end

usage:

sheldon=os_capture("wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance")

Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

#6061 2013-08-28 13:48:53

errorist
#! CrunchBanger
Registered: 2012-05-24
Posts: 100

Re: Conky v1.9 Thread

Hello !

After fiddling around with Conkys positioning/window_typ settings for getting Conky
preserving screen space against covering through maximised windows, I got finally stuck.

Also I mixed something up, concerning the methods for starting apps at the very beginning
of the X start.

And I'm not sure, if it is even possible to get an app started between the start of the X server
and Openbox.
Or does starting Openbox mean the same as starting X ?

My idea was, to start Conky after X, but before Openbox, so that any margin settings in the
rcxml won't affect the position of Conky.

How do you manage that, or am I the last one who has not recognized, that there is no way
to achieve that ?


Cheers,

errorist

Offline

#6062 2013-08-28 19:33:46

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

dk75 wrote:

LUA function 'os.execute' executes OS commands but it returns either '0' if execution succeed or '1' if failed.
If you want result of 'wget' to be passed to variable you need to use this function:

 function os_capture(cmd, raw)
 	local f = assert(io.popen(cmd, 'r'))
 	local s = assert(f:read('*a'))
 	f:close()
 	if raw then return s end
 	s = string.gsub(s, '^%s+', '')
 	s = string.gsub(s, '%s+$', '')
 	s = string.gsub(s, '[\n\r]+', ' ')
 	return s
 end

usage:

sheldon=os_capture("wget -q 'http://www.fourmilab.ch/cgi-bin/Earth/action?opt=-m&img=MoonTopo.evif' -O - |sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep Distance")

this works very well. but i think that it is better to have a temp. copy on the hdd. because it won't work when the webpage (fourmilab.ch) is overloaded. or when they have to much page views (or too many connections).

Offline

#6063 2013-08-29 19:40:10

IndianaIT
New Member
Registered: 2013-08-29
Posts: 5

Re: Conky v1.9 Thread

Hi,

I'm completely new to Conky and trying to play with scripts. I wanted to put my scripts into separate folder, so they don't just clutter my home folder. However conky seems to be hardwired to look for .conkyrc at $HOME/.conkyrc . Is there a way to change it?

I added this line to autostart.

conky -c /home/honza/.conky/.conkyrc

It works, but only when I restart completely or log out and back in.
When I just restart conky, I get this big black window in the upper left corner of the desktop.

Sorry if there is an answer somewhere on the forum. I was not able to find an answer for two days of looking here and on other fora, reading man pages, tutorials and so on. Thanks in advance.

Offline

#6064 2013-08-29 20:04:19

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: Conky v1.9 Thread

Welcome to #! Indiana!

You can kill conky and restart it a couple of ways.
You cant open the run dialog window with Alt+F2 and type in

killall conky && conky -c /home/honza/.conky/.conkyrc

Or you can open a terminal and type the same command.
Using the terminal is very handy for testing also.. it will give any errors that you may have in you conky.

Last edited by falldown (2013-08-29 20:05:56)

Offline

#6065 2013-08-29 20:41:22

IndianaIT
New Member
Registered: 2013-08-29
Posts: 5

Re: Conky v1.9 Thread

falldown wrote:

Welcome to #! Indiana!

You can kill conky and restart it a couple of ways.
You cant open the run dialog window with Alt+F2 and type in

killall conky && conky -c /home/honza/.conky/.conkyrc

Or you can open a terminal and type the same command.
Using the terminal is very handy for testing also.. it will give any errors that you may have in you conky.

Thanks for the welcome falldown.

Actually, my main question was, if/how I can change the default config of conky.
I want it to look for the configuration file in $HOME/.conky/.conkyrc instead of $HOME/.conkyrc

I there a way to achieve this without using the "conky -c [PATH]" every time?

Sorry, my earlier question was unclear. Sometimes my fingers are faster than my brain.

Offline

#6066 2013-08-29 20:59:48

Sector11
Leonardo da Conci
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,443
Website

Re: Conky v1.9 Thread

IndianaIT wrote:

I there a way to achieve this without using the "conky -c [PATH]" every time?

Sorry, my earlier question was unclear. Sometimes my fingers are faster than my brain.

Welcome to IT Indiania#!  -- oops! -- Welcome to #! IndianiaIT  angel

No that will not happen.  Until someone proves me wrong that is.  if ~/.conkyrc does not exist conky starts the free sample at:
/etc/conky/conky.conf <<-- which you don't really want to look at.

You can edit your autostart file ~/.config/openbox/autostart to use a bash script with starting conky: ssc (put that in ~/bin and kat it executable)

#!/bin/sh
# click to start, click to stop

if pidof conky | grep [0-9] > /dev/null
   then
      exec killall conky
   else
      conky -c ~/.conky/.conkyrc &
   exit
fi

now "ssc" will kill the conky is it is running and a second: ssc will start it.

Hope that helps, just remember ssc = StartStopConky


Q&As for Conky v1.9 & v1.10 | Conky Archives | All Conky Threads
.deb file editor | Debian Jessie: BunsenLabs subAlpha & Wally-jr
BL Forum Moderator | LinuxBBQ

Offline

#6067 2013-08-29 21:08:45

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,726

Re: Conky v1.9 Thread

Oh I see..
Conky will always look for a .conkyrc first unless specified with the -c option.

The simplest solution is to delete the default conkyrc and replace it with the conky you are working on.. just rename it .conkyrc.

A lot of us conky addicts have a couple of directories dedicated to conky. This way it is easier to keep track of them.

EDIT: S11 beat me to it.  big_smile

Last edited by falldown (2013-08-29 21:10:25)

Offline

#6068 2013-08-29 22:36:29

Sector11
Leonardo da Conci
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,443
Website

Re: Conky v1.9 Thread

falldown wrote:

A lot of us conky addicts have a couple of directories dedicated to conky. This way it is easier to keep track of them.
EDIT: S11 beat me to it.  big_smile

jajajaja what can I say ...

Say what? ... a couple?  Only a couple?  That's a normal conky user.

Try dozens spread out over two partitions.  cool

And I'm not addicted at all.   wink


Q&As for Conky v1.9 & v1.10 | Conky Archives | All Conky Threads
.deb file editor | Debian Jessie: BunsenLabs subAlpha & Wally-jr
BL Forum Moderator | LinuxBBQ

Offline

#6069 2013-08-30 14:30:56

demifiend
#! Member
From: Pennsylvania
Registered: 2013-08-28
Posts: 75
Website

Re: Conky v1.9 Thread

errorist wrote:

And I'm not sure, if it is even possible to get an app started between the start of the X server
and Openbox.

Or does starting Openbox mean the same as starting X ?

You start X, then you start Openbox. The window manager is a separate program from the X.org display server program.

errorist wrote:

My idea was, to start Conky after X, but before Openbox, so that any margin settings in the
rcxml won't affect the position of Conky.

How do you manage that, or am I the last one who has not recognized, that there is no way
to achieve that ?

It sounds like you want to create a custom X session file that calls Conky before calling Openbox. You'll then have to remove references to Conky from Openbox's autostart file.

Also, did you know that Conky has its own margin settings? The config variables are gap_x and gap_y. If they're set to a non-zero value, that's probably why your conky isn't flush with the edges of your screen.


"I defenestrate people for quoting Nietzsche at dinner." --Tamara Gellion

You can also find me on...
GitHub | Google+ | matthewgraybosch.com | starbreakerseries.com

Offline

#6070 2013-08-31 19:26:09

tty-tourist
#! CrunchBangian
From: within the swirl
Registered: 2013-05-26
Posts: 281

Re: Conky v1.9 Thread

For some time I've used the script below to get conky to show the number new e-mails in my gmail inbox but it no longer works.

This is the script:

#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import sys, imaplib

port = 993
server = 'imap.gmail.com'

username = 'myname@gmail.com'
passwd = 'mypassword'

imap_server = imaplib.IMAP4_SSL(server, port)
try:
    imap_server.login(username, passwd)
except:
    print('??')
    sys.exit( 1 )

typ, data = imap_server.select ('Inbox', True)
if typ == 'OK':
    total = int(data[0])
    typ, data = imap_server.search (None, 'SEEN')
    if typ == 'OK':
        seen = len(data[0].split())
        print('{}'.format(total - seen))

if typ != 'OK':
    print('??')

imap_server.logout()

When I run the script in a terminal I get these errors:

Traceback (most recent call last):
  File "gmail.py", line 12, in <module>
    imap_server = imaplib.IMAP4_SSL(server, port)
  File "/usr/lib/python2.7/imaplib.py", line 1148, in __init__
    IMAP4.__init__(self, host, port)
  File "/usr/lib/python2.7/imaplib.py", line 163, in __init__
    self.open(host, port)
  File "/usr/lib/python2.7/imaplib.py", line 1159, in open
    self.sock = socket.create_connection((host, port))
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 110] Connection timed out

Can anyone figure out what's wrong, how to fix it - or point me to an alternate script to check mail?

Thanks!

Last edited by tty-tourist (2013-08-31 19:26:39)


"You're just a tourist with a typewriter." - Charlie Meadows, Barton Fink

Offline

#6071 2013-08-31 23:49:50

errorist
#! CrunchBanger
Registered: 2012-05-24
Posts: 100

Re: Conky v1.9 Thread

Hello !

@demifiend : Yes, I know Conkys margin settings, had to fight with them ( and others ),
to get Conky well placed...

The margin settings from Openbox, which I mean here, instead are just for screen space preserving.
And they are set before the autostart runs, so Conky will necessarily conflict with them.

It sounds like you want to create a custom X session file that calls Conky before calling Openbox.
You'll then have to remove references to Conky from Openbox's autostart file.

Yes, something like that. I think, I can do it in the Slim-config, but for now, I have chosen this method:

I've found a way, to place Conky into the preserved screen area, but in a horrible kind of a workaround...


Put this script into your path :

#!/bin/sh
#===================================================================================================
#
# Call this script inside your ~/.config/openbox/autostart.sh after conky is displayed.
#
# You need 3 OB-rcxmls:      rc.xml - The start-rc, don't set any margins here, but
#                                     be sure you have the wanted workspace names set here.
#                                     Tint2 didn't take new workspace names settings from the
#                                     second rc.xml into account.
#
#                       bup_rc.xml -  The backup of the start rc.xml.
#
#                    second_rc.xml -  The rc.xml with the new margin settings, after Conky
#                                     has been displayed.
#
# If you change any names here, also change the names for the related files in ~/.config/openbox/.
# 
# And don't forget to make this script executable.
#
# Use at your own risc !
# 
#===================================================================================================
    
sleep 2s
mv ~/.config/openbox/second_rc.xml ~/.config/openbox/rc.xml 2>/dev/null
sleep 1s
openbox --reconfigure
sleep 1s
mv ~/.config/openbox/rc.xml ~/.config/openbox/second_rc.xml 2>/dev/null
sleep 1s
cp ~/.config/openbox/bup_rc.xml ~/.config/openbox/rc.xml 2>/dev/null
exit 0

The same code as in this script, inside the autostart.sh, with the " && \" line endings, did not work here by me.

The relevant part of the autostart.sh looks like this :

### Group start:
## 1. nitrogen - restores wallpaper
## 2. compositor - start
## 3. sleep - give compositor time to start
## 4. conky start
## 5. saving conkys screen area from covering
## 6. sleep - give script a little time
## 7. tint2 panel
(\
nitrogen --restore && \
cb-compositor --start && \
sleep 2s && \
conky -q -c ~/.config/conky/conkyrc && \
~/bin/second_rcxml.sh && \
sleep 2s && \
tint2 \
) &

## Group start:
## 1. nitrogen - restores wallpaper
## 2. compositor - start
## 3. sleep - give compositor time to start
## 4. tint2 panel
## 5. sleep - give tint2 a little time
## 6. conky start
## 7. saving conkys screen area from covering
#(\
#nitrogen --restore && \
#cb-compositor --start && \
#sleep 2s && \
#tint2 && \
#sleep 2s && \
#conky -q -c ~/.config/conky/conkyrc && \
#~/bin/second_rcxml.sh \
#) &

The description you can find in the comment header of the script.

Of course, you could instead edit the rc.xml (two times), but I believe, the mvs and the cp
are faster done than the text matchings and replacings.

Tint2 behaves a little stubborn here, it just takes the desktop names from the initial rc.xml (But in the OB rc.xml comments, it is stated, that you have to log out and in, to change the desktop names, so this might be the problem.).

Just make sure, you have your desktop names set in the first rc.xml, where you have set no margins.

With the commented group, everything inside the group after Tint2 will not get executed !

But is this really the only solution, doesn't there exist a more natural one ?


The Conky own_window_typ panel issue I solved through eliminating the color settings, and placing OBs dock, where Conky shall reside.

Hope, this is of use for anyone...


Cheers,

errorist

Last edited by errorist (2013-09-01 10:53:42)

Offline

#6072 2013-09-01 01:42:48

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,558

Re: Conky v1.9 Thread

IndianaIT wrote:

Actually, my main question was, if/how I can change the default config of conky.
I want it to look for the configuration file in $HOME/.conky/.conkyrc instead of $HOME/.conkyrc

I there a way to achieve this without using the "conky -c [PATH]" every time?

you can create a symlink in your /home/<username>

ln -s $HOME/.conky/.conkyrc $HOME/.conkyrc

Using only "conky" as the command will follow the symlink to your custom file while "conky" for any other users (if they exist for that computer) will start the default conkyrc

@errorist - I cannot remember since I don't use openbox, but does the openbox dock respect the openbox margin settings, or does it have its own placement policy? If it has its own placement policy, you can place the openbox dock on the edge where you want the conky displayed, then try:

own_window_type dock

in your .conkyrc.

That's how I have mine set up in fluxbox -

August_1375899194_1600x900.jpg

Take note that when conky is placed in the dock, the "alignment", "gap_x" and "gap_y" are ignored so you will need to use "offset" or "goto" to set a margin between your conky and the screen edge.

Last edited by PackRat (2013-09-01 01:44:00)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#6073 2013-09-01 10:47:01

errorist
#! CrunchBanger
Registered: 2012-05-24
Posts: 100

Re: Conky v1.9 Thread

@PackRat : Yes, the OB dock has its own settings for the positioning, very much like
Conky, taking TopLeft, Bottom and such.

So the "own_window_typ dock" will also work with the OB dock, like "own_window_typ panel".
I've chosen the "own_window_typ panel", because in the Conky config-settings, they say :

Panel windows reserve space along a desktop edge, just like panels and taskbars,
preventing maximized windows from overlapping them. The edge is chosen
based on the alignment option.

That's what I'm looking for, but I haven't noticed any reserving.
And I don't know which settings at all there might help.

For the OB dock, you have to take the OB margin settings, so that you normally
lock out Conky from its own area.

To avoid that behaviour, I've taken the workaround with the 3 rc.xmls I've posted above.

PackRat wrote:

Take note that when conky is placed in the dock, the "alignment", "gap_x" and "gap_y"
are ignored so you will need to use "offset" or "goto" to set a margin between your
conky and the screen edge.

Funny, how the inner settings of Conky are diffusing over the borders with some
"own_window_*" settings.

But my positioning problems have been solved, will look also at the more abstruse
seeming settings in the future...

Nice Fluxbox set up, Fluxbox is also my number one *box, but I decided to use
Openbox despite its restrictions, so I will not get too lost in customisation.


Cheers,

errorist

Offline

#6074 2013-09-01 12:02:07

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

andreas-r wrote:

For some time I've used the script below to get conky to show the number new e-mails in my gmail inbox but it no longer works.

Find out what Python versions you have in system

find /usr/bin -regex ".*python..."

and then change first line of your scrip to one lower than current python2.7, like

#!/usr/bin/env python2.6

if it throw same error, change to another lower one

If that not helps, contact author of the script, at https://github.com/vosh/scripts/blob/master/.gmail.py


Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

Help fund CrunchBang, donate to the project!

#6075 2013-09-01 12:34:14

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

is there a possiblity to build multi-dimensional arrays in lua? or is this the right way?

colorname4="blau"
colorname5="schwarz"
colorname6="weiß"

if string.find(uebergabe,"gold") ~= nil or string.find(uebergabe,colorname1) ~= nil then
colorCode=0xFFD700
elseif string.find(uebergabe,"yellow") ~= nil or string.find(uebergabe,colorname2) ~= nil then
colorCode=0xFFFF00
elseif string.find(uebergabe,"red") ~= nil or string.find(uebergabe,colorname3) ~= nil  then
colorCode=0xFF0000
elseif string.find(uebergabe,"blue") ~= nil or string.find(uebergabe,colorname4) ~= nil  then
colorCode=0x0000FF
elseif string.find(uebergabe,"black") ~= nil or string.find(uebergabe,colorname5) ~= nil  then
colorCode=0x000000
elseif string.find(uebergabe,"white") ~= nil or string.find(uebergabe,colorname6) ~= nil  then
colorCode=0xFFFFFF

else
colorCode=uebergabe
end

return colorCode
end

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo