SEARCH

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

You are not logged in.

#7051 2014-02-05 14:01:14

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Offline

Help fund CrunchBang, donate to the project!

#7052 2014-02-05 14:24:45

Snap
#! Die Hard
Registered: 2013-10-22
Posts: 567

Re: Conky v1.9 Thread

Thank you, sir! Errrm... Sirs!  tongue

Offline

#7053 2014-02-05 17:00:12

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

"That you S11?"
       "Yes mrpeachy."
"GET OUT!"

Offline

#7054 2014-02-05 19:20:36

Snap
#! Die Hard
Registered: 2013-10-22
Posts: 567

Re: Conky v1.9 Thread

Aye aye sir!  tongue

Offline

#7055 2014-02-06 10:22:13

iami
Member
Registered: 2013-09-06
Posts: 44

Re: Conky v1.9 Thread

I've got a question considering conditionally running lua scripts.

I know conky has build in conditions like if_exists ect... but as far as i know lua scrips always get loaded. I'm asking this because i would like to have a different network skin when i'm on eth/wlan or both. And i'm using conky to draw graphs. Can it be done in conky, for example "if on eth0 -> run graph_eth.lua" "if on wlan0 -> run graph_wlan.lua"  "if on eth0 and wlan -> run graph_both.lua" . Or has this conditional checking have to be done in conky itself and just make 1 conky file for them all?

Thanks in advance

Offline

#7056 2014-02-06 10:35:06

Snap
#! Die Hard
Registered: 2013-10-22
Posts: 567

Re: Conky v1.9 Thread

Interesting question. Tuned in for the reply too.

Offline

#7057 2014-02-06 10:44:34

Snap
#! Die Hard
Registered: 2013-10-22
Posts: 567

Re: Conky v1.9 Thread

I'm using a gmail python script I got from Arpinux to check/count/display the emails in conky. I have three different accounts (personal and business) so I have configured three different scripts. I have null idea of python scripting, but surely there's a way to merge the three scripts in a single one. Copying and pasting the same thing three times in a row is just enough? Nevertheless, valid or not, surely there are better and cleaner ways to achieve this. Any tips or howtos, please?

Here's the script:

import os
import string

#Enter your username and password below within double quotes
# eg. username="username" and password="password"
username="your_user_name"
password="your_password"

com="wget -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"

temp=os.popen(com)
msg=temp.read()
index=string.find(msg,"<fullcount>")
index2=string.find(msg,"</fullcount>")
fc=int(msg[index+11:index2])

if fc==0:
   print "0 new"
else:
   print str(fc)+" new"

Thanks.

Last edited by Snap (2014-02-06 10:45:18)

Offline

#7058 2014-02-06 13:15:54

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

#!/usr/bin/env python2

import os
import string

def check_mail(username, password):

    com="wget -O - 'https://"+username+":"+password+"@mail.google.com/mail/feed/atom' --no-check-certificate"

    temp=os.popen(com)
    msg=temp.read()
    index=string.find(msg,"<fullcount>")
    index2=string.find(msg,"</fullcount>")
    fc=int(msg[index+11:index2])

    print "\n"+username
    if fc==0:
       print "0 new"
    else:
       print str(fc)+" new"

def main():
    #enter credentials here
    check_mail(username1, password1)

if __name__ == "__main__":
    main()

Last edited by easysid (2014-02-06 13:24:38)

Offline

#7059 2014-02-06 17:01:01

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

${if_up wlan0}do wlan0 stuff
do wlan0 stuff
do wlan0 stuff${if_up eth0}do eth0 stuff
do eth0 stuff
do etho stuff${endif}${endif}

Last edited by Sector11 (2014-02-06 17:06:35)

Offline

#7060 2014-02-06 20:43:03

iami
Member
Registered: 2013-09-06
Posts: 44

Re: Conky v1.9 Thread

@sector11: thanks for the reply, apparently my laptop has no problems having a wlan + eth connection at the same time.

Currently i'm using:
${if_existing /proc/net/route enp8s0} instead of ${if_up enp8s0} because the eth (enp8s0) keeps up even if no cable is pugged in.  I already have the if else structure (ugly code tbh) but was just wondering if there were build-ins/tricks to conditionally run .lua files. I will look into mrpeachys guide and do it in the lua file itself (if i can work it out that is)  smile

Last edited by iami (2014-02-06 20:43:37)

Offline

#7061 2014-02-06 20:56:31

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

Offline

#7062 2014-02-06 21:02:50

iami
Member
Registered: 2013-09-06
Posts: 44

Re: Conky v1.9 Thread

Last edited by iami (2014-02-07 13:56:59)

Offline

#7063 2014-02-10 15:51:35

jinnainishida
New Member
Registered: 2014-02-10
Posts: 2

Re: Conky v1.9 Thread

Hello to everyone big_smile

Im just wondering if it is possible to write the networking part in conky without using concrete names of the interfaces. For example instead of using ${totaldown eth1} ill tell conky somehow that firtst it should look into /sys/class/net/ and replace "eth1" with all names inside that specific folder. My goal is to write a more flexible config so everytime a new interface is connected, or the interface name changes, I dont have to rewrite anything.

Thanks!

Offline

#7064 2014-02-10 17:37:59

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

Offline

#7065 2014-02-10 18:14:38

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

Re: Conky v1.9 Thread

like

${execpi 60 ip -oneline link | mawk '!/state DOWN/ && !/loopback/ {gsub(/:/,"",$2); print $2}' | xargs -I {} vnstat -i {} --oneline | mawk -F";" '{gsub(/ /,""); gsub(/\.[0-9][0-9]/,""); print $2,$6"/"$11}'}

Offline

#7066 2014-02-10 20:04:12

jinnainishida
New Member
Registered: 2014-02-10
Posts: 2

Re: Conky v1.9 Thread

OKej. I thought that it wont work without getting hands dirty with scripting big_smile
Soo ... Im going to study those commands a bit and if I come out with something promising Ill post it here so maybe it will be usefull for someone.

Thank you very much!

Offline

#7067 2014-02-10 20:10:03

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

Offline

#7068 2014-02-14 18:51:21

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

Re: Conky v1.9 Thread

i want to create a backup file (to display when the webpage is not avaiable). it creates an image but the file is empty (0 byte).

os.execute("cp --no-clobber -u "..img_file.." "..backup_file.."''")

edit: i solved the problem. smile it missed a whitespace at the end. now the size of the backup file is a bit differened then before smile

Last edited by lionhead (2014-02-15 08:21:01)

Offline

#7069 2014-02-15 16:53:46

kosmos890
#! Member
Registered: 2012-05-01
Posts: 76

Re: Conky v1.9 Thread

execi 300 udisks --show-info /dev/sda | grep temp | cut -c 52-53

Offline

#7070 2014-02-15 17:46:26

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

${execi 300 udisks --show-info /dev/sda | grep temp | cut -c 52-53}

Offline

#7071 2014-02-18 12:18:08

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Offline

#7072 2014-02-19 15:41:34

Muttley Black
#! Member
Registered: 2014-01-23
Posts: 61
Website

Re: Conky v1.9 Thread

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
background yes
use_xft yes
xftfont Liberation Sans:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
#own_window_argb_visual yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 200
maximum_width 240
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color 656667
default_shade_color 000000
default_outline_color 828282
alignment top_right
gap_x 12
gap_y 56
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
##############################################
#  Output
##############################################
TEXT
S Y S T E M    I N F O
${hr} 
Kernel:${alignr}${kernel}
Host:$alignr$nodename
Uptime:$alignr$uptime
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Linux usage:$alignr${fs_used /}/${fs_size /}
Home usage:$alignr${fs_used /home}/${fs_size /home}
CPU usage:$alignr${cpu cpu0}%
CPU temp:$alignr${execi 10 sensors | grep ^temp1 | tail -n 1 |awk '{print $2}'}


S H O R T C U T    K E Y S
${hr}
Alt+F2$alignr Run Dialog
Alt+F3$alignr Alt Menu
Super+Space$alignr Main Menu
Super+Tab$alignr Client Menu
Super+t$alignr Terminal
Super+f$alignr File Manager
Super+e$alignr Editor
Super+m$alignr Media Player
Super+w$alignr Web Browser
Super+h$alignr Task Manager
Super+l$alignr Lock Screen
Super+v$alignr Volume Control
Super+x$alignr Logout
PrtSc$alignr Screenshot


D A T E
${hr}
${alignr}${time %a,}${color}${time %e %B %G}

Last edited by Muttley Black (2014-02-19 15:44:50)

Offline

#7073 2014-02-19 17:19:20

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Last edited by Sector11 (2014-02-19 17:21:54)

Offline

#7074 2014-02-21 14:59:19

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

Re: Conky v1.9 Thread

my lua-script does not load when i start the computer. does conky uses log-files?

Offline

Help fund CrunchBang, donate to the project!

#7075 2014-02-21 17:48:29

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

this is how i get timed things to run at startup

--stuff that is outside of running functions is loaded the first time the script is run
dosomething=1

function main()
--stuff inside running functions is activated every conky cycle
count=conky cycles
timer=based on conky cycles

if timer==0 or dosomething==1 then
--do the stuff
dosomething=nil--turn off dosomething otherwise dosomething remains 1 and times=d section will run every conky cycle
end--timed section

end--main function

as far as log files, lua can easily read and write to files in your filesystem

edit - @lionhead, just saw your pm, but thought i would answer here

Last edited by mrpeachy (2014-02-21 17:59:57)

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.
Server: bleh

Debian Logo