SEARCH

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

You are not logged in.

#6801 2013-11-30 15:50:18

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

Re: Conky v1.9 Thread

liquibyte wrote:

What were those twelve steps again?

Totally missed this ... to answer: What 12 steps? ... Conky Anonymous is a 1 step program:

  1. We admitted we were powerless over conky -- and love it.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Help fund CrunchBang, donate to the project!

#6802 2013-12-01 11:43:35

liquibyte
#! Member
From: N42°34'30.2664",W71°59'
Registered: 2013-11-04
Posts: 67
Website

Re: Conky v1.9 Thread

Small but important update.  Apparently, in my quest to stop the second hand drift when smooth ticks were enabled I was making sure that functions that absolutely didn't need to be global weren't.  This broke the suffix for the date and I apologize to anyone that woke up to December 1th.  Boneheaded move on my part really.  If you don't want to mess up any settings you've changed just add this at the beginning of local function draw_suffix.

local days = tonumber(os.date("%e"))

Otherwise here's the way I have it set up.

require 'cairo'
words = {"one ", "two ", "three ", "four ", "five ", "six ", "seven ", "eight ", "nine "}
levels = {"thousand ", "million ", "billion ", "trillion ", "quadrillion ", "quintillion ", "sextillion ", "septillion ", "octillion ", [0] = ""}
iwords = {"ten ", "twenty ", "thirty ", "forty ", "fifty ", "sixty ", "seventy ", "eighty ", "ninety "}
twords = {"eleven ", "twelve ", "thirteen ", "fourteen ", "fifteen ", "sixteen ", "seventeen ", "eighteen ", "nineteen "}
local function digits(n)
  local i, ret = -1
  return function()
    i, ret = i + 1, n % 10
    if n > 0 then
      n = math.floor(n / 10)
      return i, ret
    end
  end
end
level = false
local function getname(pos, dig)
  level = level or pos % 3 == 0
  if(dig == 0) then return "" end
  local name = (pos % 3 == 1 and iwords[dig] or words[dig]) .. (pos % 3 == 2 and "hundred " or "")
  if(level) then name, level = name .. levels[math.floor(pos / 3)], false end
  return name
end
local function numberToWord(number)
    if(number == 0) then return "zero" end
    local vword = ""
    for i, v in digits(number) do
      vword = getname(i, v) .. vword
    end
    for i, v in ipairs(words) do
      vword = vword:gsub("ty " .. v, "ty-" .. v)
      vword = vword:gsub("ten " .. v, twords[i])
    end
    return vword
end
local function boringTime()
	hours = tonumber(os.date("%I"))
	mins = tonumber(os.date("%M"))
	--mins = mins + 0
	hours = hours % 12
	if(hours == 0) then 
		hours, nextHourWord = 12, "one "
	else
		nextHourWord = numberToWord(hours+1)
	end
	local hourWord = numberToWord(hours)
	if(mins == 0) then 
		return hourWord .. "o'clock "
	elseif(mins < 10) then
		return numberToWord(hours) .. "oh " .. numberToWord(mins)
	else
		return numberToWord(hours) .. numberToWord(mins)
	end
end
local function awesomeTime()
    if(hours == 0) then 
        hours, nextHourWord = 12, "one " 
    else
        nextHourWord = numberToWord(hours+1)
    end
    local hourWord = numberToWord(hours)
    if(mins == 0 ) then 
        return hourWord .. "o'clock"
    elseif(mins == 30) then
        return "half past " .. hourWord
    elseif(mins == 15) then
        return "a quarter past " .. hourWord 
    elseif(mins == 45) then
        return "a quarter to " .. nextHourWord 
    else
        if(mins < 30) then
            return numberToWord(mins) .. "past " .. hourWord
        else
            return numberToWord(60-mins) .. "to " .. nextHourWord
        end
    end
end
local function getHourWord()
    return numberToWord(hours)
end
local function getMinuteWord()
    return numberToWord(mins)
end
local function draw_wordTime(co, across, down, font, slant, weight, text, size, wr, wg, wb, wa)
	local bt = boringTime(tostring)
	local at = awesomeTime(tostring)
	cairo_move_to (cr, across, down)
	cairo_set_font_size (cr, size)
	cairo_set_source_rgba (cr, wr, wg, wb, wa)
	cairo_select_font_face (cr, font, slant, weight);
	if text == boringTime then
		cairo_show_text (cr, bt)
	elseif text == awesomeTime then
		cairo_show_text (cr, at)
	end
	cairo_stroke (cr)
end
local function draw_date(co, across, down, font, slant, weight, text, size, dr, dg, db, da)
	cairo_move_to (cr, across, down)
	cairo_set_font_size (cr, size)
	cairo_set_source_rgba (cr, dr, dg, db, da)
	cairo_select_font_face (cr, font, slant, weight);
	cairo_show_text (cr, text)
	cairo_stroke (cr)
end
local function draw_suffix(co, across, down, font, slant, weight, text, suffix, size, sr, sg, sb, sa)
	local days = tonumber(os.date("%e"))
	if days == 1 or days == 21 or days == 31 then
		suffix = 'st'
	elseif days == 2 or days == 22 then
		suffix = 'nd'
	elseif days == 3 or days == 23 then
		suffix = 'rd'
	else
		suffix = 'th'
	end
	cairo_move_to (cr, across, down)
	cairo_set_font_size (cr, size)
	cairo_set_source_rgba (cr, sr, sg, sb, sa)
	cairo_select_font_face (cr, font, slant, weight);
	cairo_show_text (cr, text)
	cairo_show_text (cr, suffix)
	cairo_stroke (cr)
end
local function draw_ring(co, across, down, circrad, rlw, rstart, rend, rr, rg, rb, ra)
	local degrads = math.pi/180
	local start	= rstart*degrads-math.pi/2
	local finish = rend*degrads-math.pi/2
	local xring	= 0+circrad*(math.sin(degrads*rstart))
	local yring	= 0-circrad*(math.cos(degrads*rstart))
	cairo_move_to (cr, across+xring, down+yring)
	cairo_arc (cr, across, down, circrad, start, finish)
	cairo_set_line_width (cr, rlw)
	cairo_set_source_rgba (cr, rr, rg, rb, ra)
	cairo_stroke (cr)
end
local function draw_hand(co, across, down, circrad, hlw, hx, hy, hr, hg, hb, ha)
	if hx==nil or hy==nil then
	    hx=0
	    hy=0
	else
		hx=hx
		hy=hy
	end
	xhours = 0+circrad*math.sin(hours_arc)
	yhours = 0-circrad*math.cos(hours_arc)
	xmins = 0+circrad*math.sin(mins_arc)
	ymins = 0-circrad*math.cos(mins_arc)
	xsecs = 0+circrad*math.sin(secs_arc)
	ysecs = 0-circrad*math.cos(secs_arc)
	xdsecs = 0+circrad*math.sin(dsecs_arc)
	ydsecs = 0-circrad*math.cos(dsecs_arc)
	cairo_move_to (cr, across, down)
	cairo_line_to (cr, across+hx, down+hy)
	cairo_set_line_width (cr, hlw)
	cairo_set_source_rgba (cr, hr, hg, hb, ha)
	cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT)
	cairo_stroke (cr)
end
local function draw_ticks(co, across, down, circrad, rstart, rend, angle, tlw, tr, tg, tb, ta)
	local i = 0
	local ticks = rend / angle
	local degrads = math.pi/180
	local start	= rstart*degrads-math.pi/2
	local finish = rend*degrads-math.pi/2
	local xtick	= 0+circrad*(math.sin(degrads*rstart))
	local ytick	= 0-circrad*(math.cos(degrads*rstart))
	cairo_move_to (cr, across+xtick, down+ytick)
	while i < ticks do
		cairo_arc (cr, across, down, circrad, (((angle * i)-(tlw/4))*(2*math.pi/360))-(math.pi/2), (((angle * i)+(tlw/4))*(2*math.pi/360))-(math.pi/2))
		i = i + 1
--[[An odd side effect if you move the following line outside of the next 'end'
statement is that the tick marks will turn into lines instead of dots]]
		cairo_set_line_width (cr, tlw)
		cairo_set_source_rgba (cr, tr, tg, tb, ta)
		cairo_stroke (cr)
	end
	--cairo_set_line_width (cr, tlw)
end
local function draw_desktop (co, across, down, font, slant, weight, desk, size, dskr, dskg, dskb, dska)
	local desk = tonumber(conky_parse("${desktop}"))
	for desk in tonumber do tonumber = desk end
	cairo_set_source_rgba (cr, dskr, dskg, dskb, dska)
	cairo_move_to (cr, across, down)
	cairo_select_font_face (cr, font, slant, weight);
	cairo_set_font_size (cr, size)
	cairo_show_text (cr, desk)
end
dsecs = os.date("%S") --Define deciseconds as seconds (HAS TO BE GLOBAL OUTSIDE FUNCTION, DON'T MOVE)
function round(num)
	local floor = math.floor(num)
	local ceiling = math.ceil(num)
	if (num - floor) >= 0.5 then
		return ceiling
	end
	return floor
end
function conky_draw_superclock()
	if conky_window == nil then return end
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
	cr = cairo_create(cs)
--------SET HORIZONTAL AND VERTICAL POSITION RELATIVE TO CONKY WINDOW-----------
	across = 200
	down = 200
--------SET THE CLOCK RADIUS----------------------------------------------------
	circrad = 60
--------TURN ON AND OFF THE PARTS OF THE DATE-----------------------------------
	show_weekday	= true
	show_month		= true
	show_days		= true
	show_year		= true
--------TURN ON AND OFF SMOOTH TICKS FOR THE SECONDS HAND-----------------------
	show_smooth		= true
--------TURN ON AND OFF ALL SECONDS FUNCTIONS FOR THE CLOCK---------------------
	show_seconds	= true
--------TURN ON AND OFF THE CLOCK HANDS-----------------------------------------
	show_hands		= true
--------TURN ON AND OFF AM OR PM------------------------------------------------
	show_ampm		= true
--------TURN ON AND OFF WORD TIME-----------------------------------------------
	show_wordtime	= true
--------TURN ON AND OFF THE PIPS------------------------------------------------
	show_pips		= true
--------TURN ON AND OFF THE SOLID RINGS-----------------------------------------
	show_rings		= true
--------TURN ON AND OFF THE MOVING RINGS----------------------------------------
	show_moving		= true
--------TURN ON AND OFF THE DESKTOP INDICATOR-----------------------------------
	show_desk		= true
--------TURN ON AND OFF THE CLOCKS HOURS TICK MARKS-----------------------------
	--show_hticks		= true
--------TURN ON AND OFF THE CLOCKS MINUTES TICK MARKS---------------------------
	show_mticks		= true
--------TURN ON AND OFF THE CLOCKS SECONDS TICK MARKS---------------------------
	show_sticks		= true
--------DEFINE THE DATE AND TIME------------------------------------------------
	local update_interval = conky_set_update_interval(0.1)
	local secs = os.date("%S")
    local mins = os.date("%M")
    local hours = os.date("%l")
    local ampm = os.date("%p")
	local weekday = os.date("%A")
	local days = os.date("%e")
	local month = os.date("%B")
	local year = os.date("%Y")
--------MAKE DECISECONDS BEHAVE-------------------------------------------------
	if dsecs ~= secs then
		round(dsecs)
		dsecs = dsecs + 0.1
		if dsecs >= 60 then
			dsecs = 0
		elseif dsecs <= 0 then
			dsecs = 0
			dsecs = dsecs+60
		end
	end
	--print(dsecs) --Turn this on if you want to debug dsecs in a terminal
--------DEFINE THE ARCS---------------------------------------------------------
	dsecs_arc = (2*math.pi/60)*dsecs
    secs_arc = (2*math.pi/60)*secs
    mins_arc = (2*math.pi/60)*mins+secs_arc/60
    hours_arc = (2*math.pi/12)*hours+mins_arc/12
    dsecsperc = ((dsecs/60)*100)*(360/100)
	secsperc = ((secs/60)*100)*(360/100)
	minsperc = ((mins/60)*100)*(360/100)+secs_arc
	hoursperc	= ((hours/12)*100)*(360/100)+mins_arc*4.75 --this seems to be a hack but it works
--------HOURS HAND--------------------------------------------------------------
	if show_hands then
		draw_hand(0, across, down, circrad+30+6, 6, xhours, yhours, 0.4, 0.4, 0.4, 0.5)
	end
--------HOURS RINGS-------------------------------------------------------------
	if show_rings then
		draw_ring(0, across, down, circrad+30, 8, 0, 360, 0.4, 0.4, 0.4, 0.5)
	end
	if show_moving then
		draw_ring(0, across, down, circrad+30, 8, hours_arc-(hoursperc/60), hoursperc, 0.4, 0.4, 0.4, 0.6)
	end
--------HOURS PIP---------------------------------------------------------------
	if show_pips then
		draw_ring(0, across, down, circrad+30, 8, hoursperc-1.8, hoursperc+1.8, 0.6, 0.6, 0.6, 1.0)
	end
--------HOURS TICK MARKS--------------------------------------------------------
	--[[if show_hticks then
		draw_ticks(0, across, down, circrad+40, 0, 360, 90, 2, 1.0, 1.0, 1.0, 0.5)
	end]]
--------MINUTES HAND------------------------------------------------------------
	if show_hands then
		draw_hand(0, across, down, circrad+40+6, 4, xmins, ymins, 0.5, 0.5, 0.5, 0.5)
	end
--------MINUTES RINGS-----------------------------------------------------------
	if show_rings then
		draw_ring(0, across, down, circrad+40, 8, 0, 360, 0.5, 0.5, 0.5, 0.5)
	end
	if show_moving then
		draw_ring(0, across, down, circrad+40, 8, mins_arc-(minsperc/60), minsperc, 0.5, 0.5, 0.5, 0.6)
	end
--------MINUTES PIP-------------------------------------------------------------
	if show_pips then
		draw_ring(0, across, down, circrad+40, 8, minsperc-1, minsperc+1, 0.8, 0.8, 0.8, 1.0)
	end
--------MINUTES TICK MARKS------------------------------------------------------
	if show_mticks then
		draw_ticks(0, across, down, circrad+20, 0, 360, 30, 2, 1.0, 1.0, 1.0, 0.9)
	end
--------SECONDS HAND------------------------------------------------------------
	if show_seconds then
		if show_hands then
			if show_smooth then
				draw_hand(0, across, down, circrad+50-24, 2, xdsecs, ydsecs, 0.6, 0.6, 0.6, 0.5)
			end
			if not show_smooth then
				draw_hand(0, across, down, circrad+50-24, 2, xsecs, ysecs, 0.6, 0.6, 0.6, 0.5)
			end
		end
--------SECONDS RINGS-----------------------------------------------------------
		if show_rings then
			draw_ring(0, across, down, circrad+50, 8, 0, 360, 0.6, 0.6, 0.6, 0.5)
		end
		if show_moving then
			if show_smooth then
				draw_ring(0, across, down, circrad+50, 8, dsecs_arc-(dsecsperc/60), dsecsperc, 0.6, 0.6, 0.6, 0.6)
			end
			if not show_smooth then
				draw_ring(0, across, down, circrad+50, 8, secs_arc-(secsperc/60), secsperc, 0.6, 0.6, 0.6, 0.6)
			end
		end
--------SECONDS PIP-------------------------------------------------------------
		if show_pips then
			if show_smooth then
				draw_ring(0, across, down, circrad+50, 8, dsecsperc-0.3, dsecsperc+0.3, 1.0, 1.0, 1.0, 1.0)
			end
			if not show_smooth then
				draw_ring(0, across, down, circrad+50, 8, secsperc-0.3, secsperc+0.3, 1.0, 1.0, 1.0, 1.0)
			end
		end
--------SECONDS TICK MARKS------------------------------------------------------
		if show_sticks then
			draw_ticks(0, across, down, circrad+60, 0, 360, 6, 2, 1.0, 1.0, 1.0, 0.7)
		end
	end
--------DESKTOP INDICATOR-------------------------------------------------------
	if show_desk then
		draw_desktop (0, across-10, down+10, "virgo01", 0, 0, desk, 32, 0.6, 0.6, 0.6, 1.0)
	end
--------DAY OF THE WEEK---------------------------------------------------------
	if show_weekday then
		draw_date(0, across-185, down-140, "virgo01", 0, 0, weekday, 34, 0.5, 0.5, 0.5, 1.0)
	end
--------MONTH-------------------------------------------------------------------
	if show_month then
		draw_date(0, across-185, down+215, "virgo01", 0, 0, month, 34, 0.5, 0.5, 0.5, 0.8)
	end
--------DAY---------------------------------------------------------------------
	if show_days then
		draw_suffix(0, across, down+255, "virgo01", 0, 0, days, suffix, 34, 0.5, 0.5, 0.5, 0.8)
	end
--------YEAR--------------------------------------------------------------------
	if show_year then
		draw_date(0, across-185, down+255, "virgo01", 0, 0, year, 34, 0.6, 0.6, 0.6, 0.5)
	end
--------WORD TIME---------------------------------------------------------------
	if show_wordtime then --valid values are boringTime and awesomeTime 
		draw_wordTime(0, across-185, down+155, "virgo01", 0, 0, boringTime, 20, 0.6, 0.6, 0.6, 0.8)
	end
--------AM / PM-----------------------------------------------------------------
	if show_ampm then
		draw_date(0, across-185, down+180, "virgo01", 0, 0, ampm, 20, 0.6, 0.6, 0.6, 0.8)
	end
	cairo_destroy(cr)
	cairo_surface_destroy(cs)
end

Offline

#6803 2013-12-01 12:16:09

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

Re: Conky v1.9 Thread

Naik wrote:

Hello!

I am not sure whteher this is the right place to ask because i seem to have a little scripting problem, but since it is specially conky related i will give it a go:

according to a script i found on cmdfu i made this

#!/bin/bash
#
# Get a BOFH excuse

tel=$(telnet towel.blinkenlights.nl 666 2>/dev/null | tail -2)
echo $tel
exit

and it works well in terminal.
But when i try to call it in conky using:

${scroll 37${execpi 1800 sh ~/scripts/telnet.sh}}
conky wrote:

connected to towel.blinkelights.nl Escape character is "*]".

Does anyone know what went wrong there?

greetz -naik

First of all, BOFH message contains various control characters for the terminal, like clearing the terminal, because it would contain lines like "Connecting to host" and so on.

And then, you runned it by ${execpi} Conky object.
"i" stands for interval in which it should run, but "p" stands for "parse". Meaning that Conky reads every word from it and try to execute it as Conky objects - not really what you should do with this particular string.

I've used this by the way (omitting control characters from BOFH message):

${scroll 32 ${execi 300 telnet towel.blinkenlights.nl 666 2>/dev/null | mawk 'NR==8'} }

as you can see, BOFH line is number 8... way more lines was before and was cleared by control characters.

Last edited by dk75 (2013-12-01 13:36:17)


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

#6804 2013-12-01 13:11:52

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

Re: Conky v1.9 Thread

I really wish I knew what you know dk75.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6805 2013-12-01 13:58:46

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

Re: Conky v1.9 Thread

I know nothing, but uncle man and uncle Google are my friends.

PS: try it in terminal

echo "\x1bc\nUncle \x1b[102;31;1m man \x1b[0m and uncle \x1b[103;31;1m Google \x1b[0m are my friends." && sleep 5 && echo "\x1bc"

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

#6806 2013-12-01 15:10:06

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

Re: Conky v1.9 Thread

dk75 wrote:

I know nothing, but uncle man and uncle Google are my friends.

PS: try it in terminal

echo "\x1bc\nUncle \x1b[102;31;1m man \x1b[0m and uncle \x1b[103;31;1m Google \x1b[0m are my friends." && sleep 5 && echo "\x1bc"
 01 Dec 13 | 12:03:10 ~
    $ echo "\x1bc\nUncle \x1b[102;31;1m man \x1b[0m and uncle \x1b[103;31;1m Google \x1b[0m are my friends." && sleep 5 && echo "\x1bc"
\x1bc\nUncle \x1b[102;31;1m man \x1b[0m and uncle \x1b[103;31;1m Google \x1b[0m are my friends.
\x1bc
 
 01 Dec 13 | 12:03:28 ~
    $ 

What ever it is ... I don't think it works.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6807 2013-12-01 16:54:46

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

@ dk75: thanks for the tipp! a single "p" was the problem... It is more than obvious but i never thought of it!


*kaum macht man es richtig, funktioniert es sofort*

Offline

#6808 2013-12-01 18:17:45

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

Re: Conky v1.9 Thread

Sector11 wrote:
dk75 wrote:

I know nothing, but uncle man and uncle Google are my friends.

PS: try it in terminal

echo "\x1bc\nUncle \x1b[102;31;1m man \x1b[0m and uncle \x1b[103;31;1m Google \x1b[0m are my friends." && sleep 5 && echo "\x1bc"
 01 Dec 13 | 12:03:10 ~
    $ echo "\x1bc\nUncle \x1b[102;31;1m man \x1b[0m and uncle \x1b[103;31;1m Google \x1b[0m are my friends." && sleep 5 && echo "\x1bc"
\x1bc\nUncle \x1b[102;31;1m man \x1b[0m and uncle \x1b[103;31;1m Google \x1b[0m are my friends.
\x1bc
 
 01 Dec 13 | 12:03:28 ~
    $ 

That was for ZSH.

That's more universal (at least it works for ZSH, BASH and DASH):

echo $'\33c\nUncle \33[102;31;1m man \33[0m and uncle \33[103;31;1m Google \33[0m are my friends.' && sleep 5 && echo $'\33c'

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

#6809 2013-12-02 01:12:44

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

Re: Conky v1.9 Thread

dk75 wrote:

That was for ZSH.

That's more universal (at least it works for ZSH, BASH and DASH):

cool  cool  cool


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6810 2013-12-02 13:30:09

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

Re: Conky v1.9 Thread

back to an old old conky ascii style:screen_pyr.jpg
ConkyFiglet:

background yes
own_window_colour grey10
use_xft yes
xftfont Inconsolata:size=8
xftalpha 0.1
update_interval 2.0
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 345 400
maximum_width 345 ##largeur
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color slategrey
default_shade_color red
default_outline_color green
alignment tl
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer yes
###  LUA Settings  ###########################################################
lua_load ~/.conky/script/draw_bg.lua

TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
${color green2}${exec figlet C R U N C H}
${color}
+----> $sysname $kernel $machine
|
+----+ Allumé depuis: ${color green2}$uptime${color}
|    | ${time %A,} ${time %e %B %G} ${color green2}${time %H:%M %p}${color}
|    .${stippled_hr 1}.
|   
+----> ${color green2}${fs_used /} of ${fs_size /}${color} | SDA1
|
|    .${stippled_hr 1}.
|    | Total DL:${color green2}${totaldown eth0} @ ${downspeedf eth0}kb/s${color}
|    ^
+----+ ${color 1E90FF}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq}${color}
|    v
|    | Total UL:${color green2}${totalup eth0} @ ${downspeedf eth0}kb/s${color}
|    .${stippled_hr 1}.
|
|    .${stippled_hr 1}.
|    | Top CPU : ${color green2}${top name 1}${top cpu 1}%${top mem 1}%${color}
|    ^ 
+----+ Top Mem : ${color green2}${top_mem name 1}${alignr}${cpu cpu0}%${top_mem mem 1}%${color}
|    v
|    | Connections: ${color green2}${tcp_portmon 32768 61000 count}${color}
|    .${stippled_hr 1}.
|
+----+ CPU Usage: ${color green2}${cpu cpu1}%${color}
|    | Processes: ${color green2}$processes total, $running_processes running${color}
|    .${stippled_hr 1}.
\
+----+${font :size=7,weight:bold}${color}${offset 10}IP${alignr}--destination-port:
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  0}${alignr 1}${tcp_portmon 1 65535 rport  0}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  1}${alignr 1}${tcp_portmon 1 65535 rport  1}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  2}${alignr 1}${tcp_portmon 1 65535 rport  2}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  3}${alignr 1}${tcp_portmon 1 65535 rport  3}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  4}${alignr 1}${tcp_portmon 1 65535 rport  4}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  5}${alignr 1}${tcp_portmon 1 65535 rport  5}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  6}${alignr 1}${tcp_portmon 1 65535 rport  6}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  7}${alignr 1}${tcp_portmon 1 65535 rport  7}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  8}${alignr 1}${tcp_portmon 1 65535 rport  8}
${font :size=7,weight:normal}${color}${tcp_portmon 1 65535 rip  9}${alignr 1}${tcp_portmon 1 65535 rport  9}
${voffset -30}

Last edited by ragamatrix (2013-12-02 13:33:33)

Offline

#6811 2013-12-02 16:57:27

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

Re: Conky v1.9 Thread

ragamatrix wrote:

back to an old old conky ascii style

Which only goes to prove that conky can be elegant in the old-school format!

Nice one!  Consider it C4'd.

What did you get that wall?  My wife likes it!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6812 2013-12-02 17:18:00

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

Re: Conky v1.9 Thread

Sector11 wrote:
ragamatrix wrote:

back to an old old conky ascii style

Which only goes to prove that conky can be elegant in the old-school format!

Nice one!  Consider it C4'd.

What did you get that wall?  My wife likes it!

Thanks Sector11 I may-be found the wall here I can't find the picture, but I made a post on #! forum fr to post your current background for sharing the taste of the day... I post it for you there : pyramides
wink

Last edited by ragamatrix (2013-12-02 17:18:30)

Offline

#6813 2013-12-02 17:33:04

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

Re: Conky v1.9 Thread

ragamatrix wrote:

Thanks Sector11 I may-be found the wall here I can't find the picture, but I made a post on #! forum fr to post your current background for sharing the taste of the day... I post it for you there : pyramides
wink

https://www.tineye.com - to find images.

I added the link to the image at the #!-fr forums you posted and it found:

https://www.tineye.com/search/f5cd31682 … 0313ca0aa/
Link is good until 5 Dec 2013

Thanks for the image and the conky!

Last edited by Sector11 (2013-12-02 17:45:51)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6814 2013-12-03 17:44:50

CSCoder4ever
BL Keyboard Troll
From: /dev/zero
Registered: 2013-09-03
Posts: 2,256

Re: Conky v1.9 Thread

I can't believe I didn't post in here yet  8o
well, I've decided to rewrite my conky
scrot_12_3_13.png
here's the code:

double_buffer yes
background yes
use_xft yes
xftfont Bitstream Vera Sans Mono:size=10
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager
minimum_size 250 50
maximum_width 250
minimum_width 250
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
border_margin 6
border_width 1
default_color slategrey
default_shade_color lightgrey
default_outline_color green
alignment top_right
gap_x 20
gap_y 20
no_buffers yes
uppercase no
TEXT

${color}date: ${color green}${time %a,} ${time %B%e %G}
${color}time: ${color green}${time %H:%M:%S}
${color}uptime:${color green} $uptime

${color}ram: used | total perc
${color green} $mem | $memmax $memperc%
${color}Active processes: ${color green} $processes

${color}cpu:
${color}Core0: ${color green} ${cpu cpu0}%
${color}Core1: ${color green}${cpu cpu1}%
${color}hz: ${color green} ${freq}Mhz

${color}Storage: free | total
/ ${color green}${fs_free /} | ${fs_size /}

${color}Network: down | up
${color}eth0:
${color green}${downspeed eth0}/s | ${upspeed eth0}/s

${color}wlan0:
${color green}${downspeed wlan0}/s | ${upspeed wlan0}/s

I can share my desktop's version if anyone would like that too.

Last edited by CSCoder4ever (2013-12-03 17:48:13)

Offline

#6815 2013-12-03 21:56:38

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

Re: Conky v1.9 Thread

CSCoder4ever wrote:

I can't believe I didn't post in here yet  8o

Aaaaaaaaaaaa new blood - love it!  Welcome to the conky thread CSCoder4ever.

A tip:

at the bottom of that conky test this, humour me:

${color}Core0: ${color green}${cpu cpu1}%
${color}Core1: ${color green} ${cpu cpu2}%

${color}  Avg: ${color green}${cpu}%
${color}  Avg: ${color green}${cpu cpu0}%

Intel talks 'Cores' --- AMD talks 'CPU' and conky talks ${cpu}

BUT ${cpu} or ${cpu cpu0} - doesn't matter which - is the "average" of your two 'Cores' or my three 'CPUs'

Conky Objects - variables below TEXT

cpu     (cpuN)
     CPU usage in percents. For SMP machines, the CPU number can be provided as an argument. ${cpu cpu0} is the total usage, and ${cpu cpuX} (X >= 1) are individual CPUs.

Try it and stress them out ... you'll see 'average'  big_smile

EDIT:

This:

${color}date: ${color green}${time %a,} ${time %B%e %G}
${color}time: ${color green}${time %H:%M:%S}

could be:

${color}date: ${color green}${time %a, %B%e %G}
${color}time: ${color green}${time %T}

... Just for info

Desktop?  Yes please...

Last edited by Sector11 (2013-12-03 22:05:06)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6816 2013-12-04 00:38:04

CSCoder4ever
BL Keyboard Troll
From: /dev/zero
Registered: 2013-09-03
Posts: 2,256

Re: Conky v1.9 Thread

Well we learn something new everyday!  8o
I decided to redo it because my first conky was a mess of code, and I have a new laptop coming, so... hence the new look tongue

anyways, here's my desktop's conky ( or crunch pro! )
halfscrot_12_3_13.png?noCache=1386116848

and the code:

double_buffer yes
background yes
use_xft yes
xftfont Bitstream Vera Sans Mono:size=10
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager
minimum_size 250 50
maximum_width 250
minimum_width 250
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
border_margin 6
border_width 1
default_color slategrey
default_shade_color lightgrey
default_outline_color green
alignment top_right
gap_x 20
gap_y 20
no_buffers yes
uppercase no
TEXT

${color}date: ${color green}${time %a,} ${time %B%e %G}
${color}time: ${color green}${time %H:%M:%S} ${color green}
${color}uptime:${color green} $uptime ${color green}

${color}ram: used | total perc
${color green} $mem | $memmax $memperc%
${color}Active processes: ${color green} $processes

${color}cpu:
${color}Core0: ${color green} ${cpu cpu1}%
${color}Core0 Temp: ${color green} ${exec sensors | awk '/Core 0/ {print substr($3,2,4)}'} C
${color}Core1: ${color green}${cpu cpu2}%
${color}Core1 Temp: ${color green} ${exec sensors | awk '/Core 1/ {print substr($3,2,4)}'} C
${color}Core2: ${color green} ${cpu cpu3}%
${color}Core2 Temp: ${color green} ${exec sensors | awk '/Core 2/ {print substr($3,2,4)}'} C
${color}Core3: ${color green}${cpu cpu4}%
${color}Core3 Temp: ${color green} ${exec sensors | awk '/Core 3/ {print substr($3,2,4)}'} C
${color}hz: ${color green} ${freq}Mhz

${color}gpu:
${color}GPU0 load: ${color green}${execi 1 aticonfig --odgc | egrep -i "load|temperature" | xargs echo | awk '{print $4 "" ""}'}
${color}GPU0 temp:         ${color green} ${execi 1 aticonfig --odgc --odgt --adapter=0 | egrep -i "load|temperature" | xargs echo | awk '{print "" $9 ""}'} C

${color}Storage: free | total
/ ${color green}${fs_free /} | ${fs_size /}
${color}/media/sdb1 ${color green}${fs_free /media/sdb1} | ${fs_size /media/sdb1}
${color}/media/sdc1 ${color green}${fs_free /media/sdc1} | ${fs_size /media/sdc1}

${color}Network: down | up
${color}eth0:
${color green}${downspeed eth0}/s | ${upspeed eth0}/s

${color}wlan0:
${color green}${downspeed wlan0}/s | ${upspeed wlan0}/s

Offline

#6817 2013-12-04 03:31:37

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

Re: Conky v1.9 Thread

CSCoder4ever wrote:

Well we learn something new everyday!  8o
I decided to redo it because my first conky was a mess of code, and I have a new laptop coming, so... hence the new look tongue

Good stuff!  I like it ... love that wall too ... would be better in blue  big_smile

Any day we learn something new is a good day.  Sometimes I have two or three bad days in a row but not often.

It's a struggle but I try.   smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6818 2013-12-09 15:08:10

crunchbawks
Member
Registered: 2013-11-20
Posts: 28

Re: Conky v1.9 Thread

Sector SR71 Funky on Conky as usual. What a master.

Offline

#6819 2013-12-09 16:27:30

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

Re: Conky v1.9 Thread

crunchbawks wrote:

Sector SR71 Funky on Conky as usual. What a master.

Thank you for the kind words.  Just sharing with others have shared.

here's another ...  Mk32 over on the Ubuntu forums brought up vnstats in conky.  Very handy app for people that have monthly upload|download limits.  And conky handles it great.  Here's the post I put up over on the orange side:

Mk32, over on the Ubuntu Forum conky thread, got me thinking about vnstat and conky again.  I knew I had an old conky here that read a bit more than just the common stuff ... so with a little trick I picked up from Habitual regarding ${date} and a lot of trial and error (bash is still a big mystery to me), plus an old conky from "giovanni" that displayed month data using 'tail' and 'head'.

Putting all that together and I have a way to read back on 'vnstat -d', and 'vnstat -m'
2013_12_08_22_17_48_1920x1080_Sector11.jpg <-- 08 Dec 2013 -- 09 Dec 2013 --> 2013_12_09_13_18_06_132x604_Sector11.jpg
Pretty neat if I do say so ... not all my work, a combination of stuff from various sources.

Also for "last Week", 7, 6, 5 Dec and Nov, Oct & Sep I'm using ${pre_exec} ... since vnstat isn't updating those any more ... it's just historical data for display purposes.

Here's the test conky seen on the left:

# killall conky && conky -c /media/5/conky/test_vnstat.conky &
# pkill -xf "conky -c /media/5/conky/test_vnstat.conky" &

###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title A vnstat test

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes # Options: yes or no

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 255

minimum_size 120 0  ##420 420   ## width, height
 maximum_width 120     ##420       ## width

gap_x 10		### left &right
gap_y 10		### up & down

alignment tl
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=12
#xftfont White Rabbit:size=9

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades yes
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

default_color DCDCDC # Gainsboro
color0 B0E0E6 # PowderBlue
color1 778899 # LightSlateGray
color2 D8BFD8 # Thistle
color3 9ACD32 # YellowGreen
color4 FFA07A # LightSalmon
color5 FFDEAD # NavajoWhite
color6 00BFFF # DeepSkyBlue
color7 5F9EA0 # CadetBlue
color8 BDB76B # DarkKhaki
color9 CD5C5C # IndianRed
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 6144

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable the image cache.

imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.2}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.2
#lua_draw_hook_post draw_bg 20 0 0 0 0 0x000000 0.2
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.2}
##
#
############### V9000 ########################################################
#starts the lua weather data gathering function, call once at top of conkyrc
#lua_load ~/v9000/v9000.lua
#lua_draw_hook_post weather
#lua_load /media/5/Conky/templates/cF-2013.template.lua
#######################################################  End LUA Settings  ###

update_interval 1
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.5}\
${alignc}${color6}${membar 0,10} Net Stats ${membar 0,10}${color}
Now: tx ↑ ${upspeed eth0}
${color0}Now: rx ↓ ${downspeed eth0}${color}
${alignc}${color5}${membar 0,100}${color}
${color5}${exec date --date="0 day" | awk '{print $3" "$2}'}${alignr}${execpi 300 vnstat | grep "today" | awk '{print $8" "$9}'}${color}
tx ↑${alignr}${execpi 300 vnstat | grep "today" | awk '{print $5" "$6}'}
${color0}rx ↓${alignr}${execpi 300 vnstat | grep "today" | awk '{print $2" "$3}'}${color}
${color5}${pre_exec date --date="-1 day" | awk '{print $3" "$2}'}${alignr}${pre_exec vnstat | grep "yesterday" | awk '{print $8" "$9}'}${color}
tx ↑${alignr}${pre_exec vnstat | grep "yesterday" | awk '{print $5" "$6}'}
${color0}rx ↓${alignr}${pre_exec vnstat | grep "yesterday" | awk '{print $2" "$3}'}${color}
${color5}${pre_exec date --date="-2 day"|awk '{print $3" "$2}'}${alignr}${exec vnstat -d | tail -n 5 | head -n 1 | awk '{print $8" "$9}'}${color}
tx ↑${alignr}${pre_exec vnstat -d | tail -n 5 | head -n 1 | awk '{print $5" "$6}'}
${color0}rx ↓${alignr}${pre_exec vnstat -d | tail -n 5 | head -n 1 | awk '{print $2" "$3}'}
${color5}${pre_exec date --date="-3 day"|awk '{print $3" "$2}'}${alignr}${exec vnstat -d | tail -n 6 | head -n 1 | awk '{print $8" "$9}'}${color}
tx ↑${alignr}${pre_exec vnstat -d | tail -n 6 | head -n 1 | awk '{print $5" "$6}'}
${color0}rx ↓${alignr}${pre_exec vnstat -d | tail -n 6 | head -n 1 | awk '{print $2" "$3}'}
${alignc}${color5}${membar 0,100}${color}
${color5}Curr Wk${alignr}${execpi 300 vnstat -w | grep "current week" | awk '{print $9" "$10}'}${color}
tx ↑${alignr}${execpi 300 vnstat -w | grep "current week" | awk '{print $6" "$7}'}
${color0}rx ↓${alignr}${execpi 300 vnstat -w | grep "current week" | awk '{print $3" "$4}'}${color}
${color5}Last Wk${alignr}${pre_exec vnstat -w | grep "last week" | awk '{print $9" "$10}'}${color}
tx ↑${alignr}${pre_exec vnstat -w | grep "last week" | awk '{print $6" "$7}'}
${color0}rx ↓${alignr}${pre_exec vnstat -w | grep "last week" | awk '{print $3" "$4}'}${color}
${alignc}${color5}${membar 0,100}${color}
${color5}${time %b %y}${alignr}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $9" "$10}'}${color}
tx ↑${alignr}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $6" "$7}'}
${color0}rx ↓${alignr}${execi 300 vnstat -m | grep "`date +"%b %y"`" | awk '{print $3" "$4}'}
${color5}${pre_exec date --date="-1 month" +"%b %y"}${alignr}${pre_exec vnstat -m | tail -n 4 | head -n 1 | awk '{print $9" "$10}'}${color}
tx ↑${alignr}${pre_exec vnstat -m | tail -n 4 | head -n 1 | awk '{print $6" "$7}'}
${color0}rx ↓${alignr}${pre_exec vnstat -m | tail -n 4 | head -n 1 | awk '{print $3" "$4}'}
${color5}${pre_exec date --date="-2 month" +"%b %y"}${alignr}${exec vnstat -m | tail -n 5 | head -n 1 | awk '{print $9" "$10}'}${color}
tx ↑${alignr}${pre_exec vnstat -m | tail -n 5 | head -n 1 | awk '{print $6" "$7}'}
${color0}rx ↓${alignr}${pre_exec vnstat -m | tail -n 5 | head -n 1 | awk '{print $3" "$4}'}
${color5}${pre_exec date --date="-3 month" +"%b %y"}${alignr}${exec vnstat -m | tail -n 6 | head -n 1 | awk '{print $9" "$10}'}${color}
tx ↑${alignr}${pre_exec vnstat -m | tail -n 6 | head -n 1 | awk '{print $6" "$7}'}
${color0}rx ↓${alignr}${pre_exec vnstat -m | tail -n 6 | head -n 1 | awk '{print $3" "$4}'}
${alignc}${color5}${membar 0,100}${color}

On the right is my regular conky (See: Desktop #1) that has been tweaked a bit through the process as well.

NOTE: Your mileage will vary with this conky vnstat code.  I have edited my ~/.vnstatrc file to get rid of the ' before the year: Dec '13 - Mine displays: Dec 13  That ' messes things up in bash  big_smile

# date output formats for -d, -m, -t and -w
# see 'man date' for control codes
#DayFormat    "%x"
DayFormat    "%d/%m/%y"
MonthFormat  "%b %y"
#TopFormat    "%x"
TopFormat    "%d/%m/%y"

Last edited by Sector11 (2013-12-09 16:40:24)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6820 2013-12-09 18:35:54

tamikan
#! Die Hard
Registered: 2012-09-20
Posts: 777

Re: Conky v1.9 Thread

MWLEv1ds.png
code:

##############################################
#  Global settings
##############################################
background yes
use_xft yes
xftfont Droid Sans:size=11
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
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 yes
draw_graph_borders no
default_color 000000
default_shade_color 000000
default_outline_color 828282
alignment mr
gap_x 10
gap_y 0
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
##############################################
#  Output
##############################################
TEXT
S Y S T E M    I N F O
${hr}
Time:$alignr${time %r}
Date:$alignr${time %A, %B %d, %Y}
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Disk usage:$alignr${fs_used /}/${fs_size /}
CPU usage:$alignr${cpu cpu0}%
Battery:$alignr${battery_percent}%
Weather:$alignr${execi 3600 ~/.scripts/weather.sh "EUR|UK|UK118|Amersham"}
E-mail(s):$alignr ${execi 3600 ~/.scripts/gmail}
IP address:$alignr ${exec sudo ifconfig | grep 192.168.1| awk '{print $2}'| sed 's/addr://'}

T Y P I C A L    S H O R T C U T S
${hr}
Alt+F2:$alignr Run Program
Alt+F4:$alignr Close Window
Alt+Tab:$alignr Switch Window
Super+D:$alignr Show Desktop
Super+L:$alignr Lock Screen

P E R S O N A L    S H O R T C U T S
${hr}
Alt+F3:$alignr Dynamic Menu
Play/Pause:$alignr VMware Player
Super+Space:$alignr Root Menu
Super+E:$alignr Editor
Super+I/N:$alignr Network Manager
Super+W:$alignr Web Browser
Super+F:$alignr File Manager
Super+G:$alignr Google Docs
Super+P:$alignr Screenshot Area
Super+R:$alignr Resources
Super+S:$alignr Screen Layout
Super+T:$alignr Terminal
Super+U:$alignr System Upgrade
Super+M:$alignr Media Player
Super+Q:$alignr Force Quit

T I L I N G     S H O R T C U T S
${hr}
Super+A:$alignr Maximize All
Super+H:$alignr Maximize Horizontal
Super+V:$alignr Maximize Vertical
Super+C:$alignr Move To Center
Super+Arrow:$alignr Move Window
Alt+Super+Arrow:$alignr Resize Window

M E M O
${hr}
zip -r name.zip /folder:$alignr compress
tar -xvf:$alignr Uncompress tarball
tar -zxvf:$alignr Uncompress gzipped tarball
rpm -ivh FILE --nodeps --force:$alignr LV
rsync -aAXv /source /dest:$alignr Clone
grub-install --root-directory=.$alignr /dev/sdx
blkid device:$alignr UUID

Top things ]:D
dwb | Firefox Nightly | sakura | emacs | moc | #! | Arch | Doing 1 thing @ the time | Music from the 90s

Offline

#6821 2013-12-16 17:17:14

Deegan
Member
From: Italy Varese
Registered: 2011-11-19
Posts: 36

Re: Conky v1.9 Thread

Hi ragamatrix  wink

You can pass me the .conkyrc and  script to have this conky?

eyy4.jpg

Thanks   big_smile

Offline

#6822 2013-12-17 16:12:01

murak
#! Member
From: Sweden
Registered: 2009-05-29
Posts: 86

Re: Conky v1.9 Thread

Ok so I have been trying to get a basic calendar up and running in conky that I copied from another thread. I want the current date to have another color than the rest of the dates. I get two squares in the middle of the current date. Any ideas?

My conky:

background yes
use_xft yes
xftfont Sans:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 200
maximum_width 200
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 979797
default_shade_color black
default_outline_color white
color3 979797
color4 AntiqueWhite4
alignment top_right
gap_x 12
gap_y 12
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
text_buffer_size 2048 
max_user_text 65000


TEXT
${font sans-serif:bold:size=8}DATE ${hr 2}
${font sans-serif:size=26}${alignc}${time %H:%M}${font}
${alignc}${time %A %d %B}

${voffset 4}${alignc 7}${execpi 60 VinDSL_Cal= date +'%B${offset 6}%Y'}
${voffset 2}${execpi 60 VinDSL_Cal= cal | sed '1d' | sed -e 's/'`date | awk '{print $3}'`'/\$\{color4}'`date | awk '{print $3}'`'\$\{color3}/' | sed 's/^/${offset 36}${color3}/'} $color

${font sans-serif:bold:size=8}SYSTEM ${hr 2}
${font sans-serif:normal:size=8}$sysname $kernel $alignr $machine
Host:$alignr$nodename
Uptime:$alignr$uptime
${font sans-serif:normal:size=8}Battery: $alignr ${battery}
${battery_bar BAT0}

${font sans-serif:bold:size=8}i5 3320M ${hr 2}
${font sans-serif:normal:size=8}Core frequency $color $alignr ${freq_g (1)} GHz
Core 1 temp: $alignr ${hwmon 0 temp 1} C
Core 2 temp: $alignr ${hwmon 2 temp 1} C
CPU1: ${cpu cpu1}% ${cpubar cpu1}
CPU2: ${cpu cpu2}% ${cpubar cpu2}
CPU3: ${cpu cpu3}% ${cpubar cpu3}
CPU4: ${cpu cpu4}% ${cpubar cpu4}
${cpugraph cpu1}

${font sans-serif:bold:size=8}SSD & RAM ${hr 2}
${font sans-serif:normal:size=8}RAM $alignc $mem / $memmax $alignr $memperc%
$membar
SWAP $alignc ${swap} / ${swapmax} $alignr ${swapperc}%
${swapbar}
${font sans-serif:normal:size=8}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /}%
${fs_bar /}


${font sans-serif:bold:size=8}NETWORK ${hr 2}
${font sans-serif:normal:size=8}ID:$alignr${wireless_essid wlan0}
Signal: $alignr ${wireless_link_qual_perc wlan0}%
IP address: $alignr ${addr wlan0}
${downspeedgraph wlan0}
${font sans-serif:normal:size=8}Down:   (Tot: ${totaldown wlan0}) $alignr${downspeed wlan0}/s
${upspeedgraph wlan0}
${font sans-serif:normal:size=8}Up:       (Tot: ${totalup wlan0}) $alignr ${upspeed wlan0}/s

#${font sans-serif:bold:size=8}TOP PROCESSES ${hr 2}
#${font sans-serif:normal:size=8}${top_mem name 1}${alignr}${top mem 1} %
#${top_mem name 2}${alignr}${top mem 2} %
#$font${top_mem name 3}${alignr}${top mem 3} %

#${execi 300 date +"%B %Y"}.

Print screen:

HFiqsCx.png


CrunchBang Linux 11 "Waldorf" 64-bit - Thinkpad X230 / i5 3320M / 16Gb ram / 240Gb Sandisk Extreme II

Offline

#6823 2013-12-17 19:13:06

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

Re: Conky v1.9 Thread

murak wrote:

Ok so I have been trying to get a basic calendar up and running in conky that I copied from another thread. I want the current date to have another color than the rest of the dates. I get two squares in the middle of the current date. Any ideas?

Are you using a mono font for your calendar?  Too small I can't see it, very important to do so.

I've had problems with 'cal' in the past and switched to ncal

Two layouts

${hr}
${goto 20}${color6}SU MO ${color5}${time %b %Y}${color6} FR SA
${goto 20}${color}${execpi 86400 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | sed ':a;N;$!ba;s/\n/\n${goto 20}/g'}
${hr}
${goto 20}${color5}${time %b}             ${time %Y}
${goto 20}${color6}SU MO TU WE TH FR SA
${goto 20}${color}${execpi 600 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color6}&${color}/' | sed ':a;N;$!ba;s/\n/\n${goto 20}/g'}
${hr}

2013_12_17_16_00_35_373x780_Sector11.jpg

I recommend using ${goto} vs ${offset} (personal opinion)
- it is always 100% vs ${offset}'s dependency of "where you start it from

Anyway
For the calendar line:
1. - first colour command ( ${color} ) sets the colour for the days up and including yesterday
2. - the middle two colour commands ( ${color6}&${color} ) - the first sets the colour for today, the second for the rest of the month - I have it to match the beginning of the month.
3. - the ${goto 20} near the end needs to match the ${goto} before the calendar is called to match the lines.

I don't understand this line:

${execpi 60 VinDSL_Cal= date +'%B${offset 6}%Y'}

using CPU resources where the ${time %B    %Y} command is built in.
exec, execi, execpi commands are the same with the warning:
- exec     command     Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch.

Another tip:
Change: ${cpugraph cpu1}
to: ${cpugraph cpu0}
to get a graph showing the average of your two cores - 4 cpus

Last edited by Sector11 (2013-12-17 19:27:43)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#6824 2013-12-17 21:05:15

murak
#! Member
From: Sweden
Registered: 2009-05-29
Posts: 86

Re: Conky v1.9 Thread

Sector11 wrote:

Are you using a mono font for your calendar?  Too small I can't see it, very important to do so.

I've had problems with 'cal' in the past and switched to ncal

Two layouts *SNIPP*

Thanks a lot! Your example code did it!

I thought I was using a mono font (the default sans-serif) but it sure looks better when I use Courier instead smile Is there like a list of mono fonts that are already in #! (that don't have to be downloaded) ?

MimFTObl.jpg


CrunchBang Linux 11 "Waldorf" 64-bit - Thinkpad X230 / i5 3320M / 16Gb ram / 240Gb Sandisk Extreme II

Offline

Be excellent to each other!

#6825 2013-12-17 22:17:30

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

Re: Conky v1.9 Thread

murak wrote:

Thanks a lot! Your example code did it!

I thought I was using a mono font (the default sans-serif) but it sure looks better when I use Courier instead smile Is there like a list of mono fonts that are already in #! (that don't have to be downloaded) ?

Looks good!

I'm not aware of a list as such but you could get font-manager or gnome-specimen - both in the repos.

Gnome specimen will allow "mono" as a search ... you'll miss a few as not all mono fonts have mono in the name ie: Courier

2013_12_17_19_09_53_724x544_Sector11.jpg

Last edited by Sector11 (2013-12-17 22:18:55)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

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: acrobat

Debian Logo