Author Topic: Conky one line changes  (Read 2499 times)

VastOne

  •      v-ger
  • Posts: 3773
    • View Profile
    • VSIDO Community
Conky one line changes
« on: March 09, 2014, 01:42:21 AM »
I loathe conky... I think it gets way too much attention on distros and takes away from what the distro is actually about.  I am glad that is not the case here

I do use conky, the one line top conky has been my simple use for it for years... I have recently made a change that people who use gmail may (or may not) care about...  I used to use to conky's but have now combined them to one ... here is what it looks like



This is how it is done ... three files

.conkyrc - NOTE you will need to edit this and change -WYOURZIPCODE to your zip code so it looks like -W42056 (or yours)

Code: [Select]
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on VSIDO
 
# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_type normal
#own_window_transparent no
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
 
# fiddle with window
use_spacer right

# Use Xft?
use_xft yes
xftfont Liberation Sans:size=14.2
xftalpha 0.9
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# 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 1024 0
#maximum_width 1024

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
own_window_argb_visual yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi

# Stippled borders?
stippled_borders 0

# border margins
# border_margin 0

# border width
border_width 1

# Default colors and also border colors
#default_color grey
#color2=white
#color3=grey
#default_shade_color black
#default_outline_color grey
own_window_colour 000000

# Text alignment, other possible values are commented
#alignment top_middle
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 0
gap_y 5
minimum_size 1200 29
maximum_width 1200
# 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 none

# lua_load ~/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
# ${color 7D8C93}Wyatt ${color 55688A} ${execi 600 inxi -W63882 | cut -c31-34}°
TEXT
${image $HOME/images/vsidoorb_blk.png -s 42x42 -p 1,-1}        ${voffset 6}${color 7D8C93} $kernel ${color 73AEB4} ${color lime green}${uptime_short} ${color 73AEB4} C ${color 7D8C93}${cpu cpu0}%  ${color 73AEB4}M ${color 7D8C93}${memperc}% ${mem} / ${memmax}  ${color 73AEB4} HD ${color 7D8C93} ${execi 5 hddtemp -n /dev/sda}° ${color 73AEB4}N${color 7D8C93}  ${voffset 1}${downspeedgraph wlan0 12,85 000000 ff0000}  ${upspeedgraph wlan0 12,85 000000 00ff00}${color lime green}   ${time %I:%M%P}${color 7D8C93} ${color 55688A} OD ${execi 600 inxi -WYOURZIPCODE | cut -c31-34}°

.conkyrc2  -  NOTE You will need to edit this and change yourgmailusername yourpassword to your gmail login name and your gmail password

Code: [Select]
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on VSIDO
 
# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_type normal
#own_window_transparent no
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
 
# fiddle with window
use_spacer right

# Use Xft?
use_xft yes
xftfont Liberation Sans:size=14.2
xftalpha 0.9
text_buffer_size 4096

# Update interval in seconds
update_interval 1

# 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 236 400
maximum_width 236
#maximum_width 1024

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi

# Stippled borders?
stippled_borders 0

# border margins
# border_margin 0

# border width
border_width 1

# Default colors and also border colors
#default_color grey
#color2=white
# color3=grey
#default_shade_color black
#default_outline_color grey
# own_window_colour 070809

# Text alignment, other possible values are commented
#alignment top_middle
#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 190
gap_y -15

# 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 none
TEXT

${color 7D8C93}${voffset 5}G-Mail  - ${execpi 15 python ~/gmail_parser.py yourgmailusername yourpassword 3}

gmail_parser.py

Code: [Select]
## check-gmail.py -- A command line util to check GMail -*- Python -*-
## modified to display mailbox summary for conky

# ======================================================================
# Copyright (C) 2006 Baishampayan Ghose <b.ghose@ubuntu.com>
# Modified 2008 Hunter Loftis <hbloftis@uncc.edu>
# Time-stamp: Mon Jul 31, 2006 20:45+0530
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
# ======================================================================

import sys
import urllib             # For BasicHTTPAuthentication
import feedparser         # For parsing the feed
from textwrap import fill

_URL = "https://mail.google.com/gmail/feed/atom"

uname = sys.argv[1]
password = sys.argv[2]
maxlen = sys.argv[3]

urllib.FancyURLopener.prompt_user_passwd = lambda self, host, realm: (uname, password)

def auth():
    '''The method to do HTTPBasicAuthentication'''
    opener = urllib.FancyURLopener()
    f = opener.open(_URL)
    feed = f.read()
    return feed


def readmail(feed, maxlen):
'''Parse the Atom feed and print a summary'''
atom = feedparser.parse(feed)
print '${color3} %s new email(s)\n' % (len(atom.entries))
# for i in range(min(len(atom.entries), maxlen)):
# print '${color2}%s' % fill(atom.entries[i].title,38)
#uncomment the following line if you want to show the name of the sender
# print '          ${color2}%s' % atom.entries[i].author
# if len(atom.entries) > maxlen:
# print ' ${color}more...'

if __name__ == "__main__":
    f = auth()  # Do auth and then get the feed
    readmail(f, int(maxlen)) # Let the feed be chewed by feedparser

Final Notes - On VSIDO most of these files are already there so you will need to rename as you see fit

gmail_parser.py needs to be executable and relies on this file python-feedparser

Code: [Select]
sudo apt-get install python-feedparser
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1754
    • View Profile
Re: Conky one line changes
« Reply #1 on: March 09, 2014, 02:54:28 AM »
Looks good.

although, in case anyone tries a copy anf paste, shouldn't

Code: [Select]
${execi 600 inxi -YOURZIPCODE | cut -c31-34}°
be

Code: [Select]
${execi 600 inxi -W YOURZIPCODE | cut -c31-34}°
to get local weather conditions?

I don't have inxi on this particular computer, otherwise I would verify it myself.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

lwfitz

  • DEFCON 1
  • Posts: 1733
  • sudo rm -rf /
    • View Profile
Re: Conky one line changes
« Reply #2 on: March 09, 2014, 03:07:33 AM »
VastOne I was just thinking maybe we could remove all unnecessary apps and just have a conky os?  :D

VastOne

  •      v-ger
  • Posts: 3773
    • View Profile
    • VSIDO Community
Re: Conky one line changes
« Reply #3 on: March 09, 2014, 03:08:36 AM »
^ I saw that one coming all the way from Cali!   ???  :-*
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

VastOne

  •      v-ger
  • Posts: 3773
    • View Profile
    • VSIDO Community
Re: Conky one line changes
« Reply #4 on: March 09, 2014, 03:13:03 AM »
Looks good.

although, in case anyone tries a copy anf paste, shouldn't

Code: [Select]
${execi 600 inxi -YOURZIPCODE | cut -c31-34}°
be

Code: [Select]
${execi 600 inxi -W YOURZIPCODE | cut -c31-34}°
to get local weather conditions?

I don't have inxi on this particular computer, otherwise I would verify it myself.

Thanks!  You are correct, and it has been corrected... when i copied n pasted, I did it in haste and wasted it ...  ::)
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

lwfitz

  • DEFCON 1
  • Posts: 1733
  • sudo rm -rf /
    • View Profile
Re: Conky one line changes
« Reply #5 on: March 09, 2014, 03:56:14 AM »
^ I saw that one coming all the way from Cali!   ???  :-*


And I want ALL the credit  :-X