SEARCH

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

You are not logged in.

#5826 2013-07-24 10:58:22

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

Re: Conky v1.9 Thread

Sector11 wrote:

OK here's one for you dk75 ... can you GAWK, AWK, MAWK this:

${goto 20}SU MO ${color6}${time %b %Y}${color} FR SA
${goto 20}${color}${execpi 7200 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'}${color}

http://s20.postimg.org/yerlp89zd/2013_07_23_14_37_21_199x131_Sector11.jpg

The leading and ending ${color} commands on the second line look useless but in fact in combination with the colour commands "in" the script control the start days, today and end days of the calendar.

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

http://s20.postimg.org/londc5215/2013_07_23_14_47_30_198x139_Sector11.jpg
The last one can be eliminated and added to the next line in the conky but I happen to use it there.

here you go

#!/usr/bin/gawk -f

#####################################################################
#                                                                   #
# ncal2.awk script by dk75                                          #
#                                                                   #
# usage:                                                            #
# ncal -bh | ncal2.awk                                              #
#                                                                   #
#####################################################################

BEGIN	\
{
	day=strftime("%02d")
}

NR>1	\
{
	gsub(/ {3}/," 0 ",$0)
	
	for ( i=1; i<=7; i++ )
		days[NR-1,i]=$(i)
}

END	\
{
	printf "${goto 20} %s %s ${color6}${time %b %Y}${color} %s %s", days[1,1], days[1,2], days[1,6], days[1,7]
	
	for ( i=2; i<NR; i++ )
	{
		if ( i>2 && days[i,1]=="0" )
			break
		
		printf "\n${goto 20}${color3}"
		
		for ( j=1; j<=7; j++ )
		{
			days[i,j]=sprintf("%02d", days[i,j])
			
			if ( days[i,j]=="00" )
				days[i,j]="  "
			
			if ( days[i,j]==day )
				days[i,j]="${color6}"days[i,j]"${color3}"
		
			printf " %s", days[i,j]
		}
	}
	
	printf "${color}\n"
}

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

Be excellent to each other!

#5827 2013-07-24 13:28:08

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Is it possible to caught the record uptime of OS with conky?

I'd be really interested to know how.

Last edited by Nili (2013-07-24 13:33:00)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#5828 2013-07-24 13:53:43

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

Re: Conky v1.9 Thread

do u mean:

${uptime}

or

${uptime_short}

Offline

#5829 2013-07-24 14:39:55

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Thanks but i not thought about it.

Uptime: ${uptime} > [22mins 13secs].
Uptime: ${uptime_short} > [22min].

i mean to catch the longest record uptime of OS:
Record Uptime: [2days 15hrs 6mins 41secs]
Record Uptime: [1month, 2days, 15hrs, 6mins and 41secs]

i used to get it on Windows or mIRC but never on Linux or Conky smile

thanks for your reply.

Last edited by Nili (2013-07-24 14:40:32)


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#5830 2013-07-24 14:46:43

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

Re: Conky v1.9 Thread

i do not think if crunchbang saves this. but correct me smile

Offline

#5831 2013-07-24 14:54:20

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

Re: Conky v1.9 Thread

^^ Probably have to create a log file, parse it, and have conky display the results. Kind of like what's done by some users with vnstat.


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

Offline

#5832 2013-07-24 15:04:14

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

That's right Die Hard,

I'm using Linux Mint 14

I do not know if it stored record uptime somewhere on Mint?

Mint have a tools called HardInfo 0.5.1 but this application not show it, on this application there are much information about the mint system but doesnt have record uptime. If the information recuptime is stored somewhere can be caught with grep, anyway i have no idea sorry, i'm still noob for this things on Linux.

Thanks for your suggestion.


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#5833 2013-07-24 15:07:14

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

Re: Conky v1.9 Thread

dk75 wrote:

here you go

AWESOME --- but with one tiny Oops! that's my fault since I was so careful to explain what things did and why they were there

... I missed this:

 24 Jul 13 | 11:33:50 ~
    $ ncal -bh -3
     June 2013             July 2013            August 2013       
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
                   1      1  2  3  4  5  6               1  2  3  
 2  3  4  5  6  7  8   7  8  9 10 11 12 13   4  5  6  7  8  9 10  
 9 10 11 12 13 14 15  14 15 16 17 18 19 20  11 12 13 14 15 16 17  
16 17 18 19 20 21 22  21 22 23 24 25 26 27  18 19 20 21 22 23 24  
23 24 25 26 27 28 29  28 29 30 31           25 26 27 28 29 30 31  
30                                                                
 
 24 Jul 13 | 11:34:02 ~
    $

Notice how June has 6 lines. July & August shows a blank line in the conky - perfect for spacing.  Adding an image below it and it would need to be adjusted on various months.

TEXT
${color7}${hr 1}${color}
${execpi 7200 ncal -bh | /media/5/Conky/scripts/ncal2.awk}
${color7}${hr 1}${color}
${goto 20}SU MO ${color6}${time %b %Y}${color} FR SA
${goto 20}${color}${execpi 7200 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'}${color}
${color7}${hr 1}${color}

2013_07_24_11_49_07_1920x1080_Sector11.jpg

Can that be fixed?

Still, incredible work dk75 .. as always ..
Second time I've seen an "awk" script!


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

Offline

#5834 2013-07-24 15:28:04

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

Re: Conky v1.9 Thread

PackRat wrote:

^^ Probably have to create a log file, parse it, and have conky display the results. Kind of like what's done by some users with vnstat.

That's an interesting idea ... vnstat  ... maybe there's a program ... so I Googled ... TADA!

Nili wrote:

That's right Die Hard,

I'm using Linux Mint 14

I do not know if it stored record uptime somewhere on Mint?

Mint have a tools called HardInfo 0.5.1 but this application not show it, on this application there are much information about the mint system but doesnt have record uptime. If the information recuptime is stored somewhere can be caught with grep, anyway i have no idea sorry, i'm still noob for this things on Linux.

Thanks for your suggestion.

Look what I found!  "uptimed" --> Nice screenshot there.

It's in the Debian repos: utility to track high uptimes - daemon
Stable - Testing and SID:
uptimed (1:0.3.17-3.1)

Not that I need it, I turn my computer off every night.

Last edited by Sector11 (2013-07-24 15:28:38)


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

Offline

#5835 2013-07-24 17:55:25

Nili
#! Die Hard
From: 127.0.0.1
Registered: 2013-03-20
Posts: 811
Website

Re: Conky v1.9 Thread

Thank you Sector11

Didn't know about uptimed, its also available on Mint Synaptic Package with the latest version.

I'll give a try now.

Thnx man!


# Debian GNU/Linux 8:8.2 (netinst/stable)
# Packages Installed: 541
# Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) i686 GNU/Linux
# Startup finished in 2.850s (kernel) + 6.473s (userspace) = 9.324s

Offline

#5836 2013-07-24 18:31:15

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

Re: Conky v1.9 Thread

Nili wrote:

Thank you Sector11

Didn't know about uptimed, its also available on Mint Synaptic Package with the latest version.

I'll give a try now.

Thnx man!

Actually ... you need to thank PackRat too ... he mentioned vnstat and that got me to thinking ...

vnstat = program = his idea!

You're welcome.

Last edited by Sector11 (2013-07-24 18:31:41)


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

Offline

#5837 2013-07-24 20:30:23

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

Re: Conky v1.9 Thread

Sector11 wrote:
dk75 wrote:

here you go

AWESOME --- but with one tiny Oops! that's my fault since I was so careful to explain what things did and why they were there

... I missed this:
[..]
Notice how June has 6 lines. July & August shows a blank line in the conky - perfect for spacing.  Adding an image below it and it would need to be adjusted on various months.
[..]
Can that be fixed?

I've tought that it need to be deleted so added on "if" statement to do that (you can comment them out if you want - marked):

#!/usr/bin/gawk -f

#####################################################################
#                                                                   #
# ncal2.awk script by dk75                                          #
#                                                                   #
# usage:                                                            #
# ncal -bh | ncal2.awk                                              #
#                                                                   #
#####################################################################

BEGIN	\
{
	day=strftime("%02d")
}

NR>1	\
{
	gsub(/ {3}/," 0 ",$0)
	
	for ( i=1; i<=7; i++ )
		days[NR-1,i]=$(i)
}

END	\
{
	printf "${goto 20} %s %s ${color6}${time %b %Y}${color} %s %s", days[1,1], days[1,2], days[1,6], days[1,7]
	
	for ( i=2; i<NR; i++ )
	{
##############################################################################
		if ( i>2 && days[i,1]=="0" )	# comment out this 2 lines in order to
			break			# not to delete ending empty line with some months
##############################################################################
		printf "\n${goto 20}${color3}"
		
		for ( j=1; j<=7; j++ )
		{
			days[i,j]=sprintf("%02d", days[i,j])
			
			if ( days[i,j]=="00" )
				days[i,j]="  "
			
			if ( days[i,j]==day )
				days[i,j]="${color6}"days[i,j]"${color3}"
		
			printf " %s", days[i,j]
		}
	}
	
	printf "${color}\n"
}

Last edited by dk75 (2013-07-24 20:31:43)


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

#5838 2013-07-24 21:04:23

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

Re: Conky v1.9 Thread

dk75 wrote:

I've tought that it need to be deleted so added on "if" statement to do that (you can comment them out if you want - marked):

OH!!! Nice touch!

Options ... Love options ...

Well done dk75 and thank you!


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

Offline

#5839 2013-07-25 22:04:26

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

Re: Conky v1.9 Thread

I would like my conky to display alsa volume.
I'm using Waldorf that comes with conkky 1.9.0. Read somewhere that it doesn't natively supports detecting alsa.

${mixer 'Master'}

... just gives me zero.

${mixer}

... gives me the same output as pavucontrol that variates a lot from alsa.

${exec amixer get Master | grep -oE "[[:digit:]]*%"}

... gives me the right alsa volume but twice (getting both the left and right volume) like this:

53%
53%

Is this the best way to get alsa volume? If so, how do I get the volume to be output only once?

Thanks!

Last edited by tty-tourist (2013-07-25 22:05:13)


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

Offline

#5840 2013-07-26 04:14:24

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

Re: Conky v1.9 Thread

andreas-r wrote:

I would like my conky to display alsa volume.
I'm using Waldorf that comes with conkky 1.9.0. Read somewhere that it doesn't natively supports detecting alsa.

${mixer 'Master'}

... just gives me zero.

${mixer}

... gives me the same output as pavucontrol that variates a lot from alsa.

${exec amixer get Master | grep -oE "[[:digit:]]*%"}

... gives me the right alsa volume but twice (getting both the left and right volume) like this:

53%
53%

Is this the best way to get alsa volume? If so, how do I get the volume to be output only once?

Thanks!

In conky try the command without quote

${mixer Master}

Offline

#5841 2013-07-26 18:38:44

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

Re: Conky v1.9 Thread

chepioq wrote:

In conky try the command without quote

${mixer Master}

That also just outputs zero regardless of what the alsa volume actually is ...

Last edited by tty-tourist (2013-07-26 18:54:25)


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

Offline

#5842 2013-07-27 12:15:34

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

Re: Conky v1.9 Thread

andreas-r wrote:

I would like my conky to display alsa volume.
I'm using Waldorf that comes with conkky 1.9.0. Read somewhere that it doesn't natively supports detecting alsa.

${mixer 'Master'}

... just gives me zero.

${mixer}

... gives me the same output as pavucontrol that variates a lot from alsa.

${exec amixer get Master | grep -oE "[[:digit:]]*%"}

... gives me the right alsa volume but twice (getting both the left and right volume) like this:

53%
53%

Is this the best way to get alsa volume? If so, how do I get the volume to be output only once?

Thanks!

${exec amixer get Master | grep -oEm1 "[[:digit:]]*%"}

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

#5843 2013-07-27 18:26:32

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

Re: Conky v1.9 Thread

dk75 wrote:
${exec amixer get Master | grep -oEm1 "[[:digit:]]*%"}

Works - thanks a lot!


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

Offline

#5844 2013-07-28 01:18:53

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

Re: Conky v1.9 Thread

Here's a rather "generic conky" - other than my "Sector11.png" logo image, created by an idea and image from falldown, and a 1x1 pixel deepskyblue png it should work on any machine.

2013_07_27_21_32_38_1920x1080_Sector11.jpg

CPU bars built specifically for: monofur:bold:size=10 - add or subtract as requited.

The conky

# killall conky && conky -c /media/5/Conky/S11_TL_Corner.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 #no
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_class Conky
own_window_title S11

# 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

### 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 0 #255

minimum_size 125 00
maximum_width 125

#gap_x 0 # left-right
#gap_y 0 # up-down
gap_x 20 # left-right
gap_y 20 # up-down


alignment tl
##################################left#################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Liberation Sans:size=15
xftfont monofur:bold:size=10

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

### WARNING ### These do NOT play well with /media/5/Conky/LUA/draw-bg.lua ###
draw_shades yes #### <<<--- yes --- To see it easier on light screens.
default_shade_color 000000
draw_outline no #### <<<--- yes --- Amplifies text if yes OJO with changing fonts
default_outline_color 000000
##############################################################################

uppercase no

######################################################  End Font Settings  ###
###  Color Settings  #########################################################
#default_shade_color black
#default_outline_color black

#default_color DCDCDC #220 220 220	Gainsboro
#default_color C0C0C0 #192 192 192 Silver
default_color B0E0E6 #176 224 230 PowderBlue
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 D8BFD8 #216 191 216	Thistle
color3 9ACD32 #154 205  50	YellowGreen
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 5F9EA0 # 95 158 160	CadetBlue
color8 BDB76B #189 183 107	DarkKhaki
color9 CD5C5C #205  92  92	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
#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 1280

# 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

#   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

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

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or it blinks.
##
# lua_load ~/path_to/draw_bg.lua
## TEXT
## ${lua conky_draw_bg 10 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 10 0 0 0 0 0x000000 0.2
#
# TEXT
#

update_interval 1

TEXT
${image /media/5/Conky/images/Sector11.png -p 00,00 -s 125x51}


${alignc}${kernel}
${alignc}${uptime}
${color6}${hr 1}
${font digitalk:size=20}${alignc}${time %T}${font}
${alignc}${time %b}${color}
${execpi 7200 ncal -h | /media/5/Conky/scripts/TL_ncal-h.awk}
${alignc}${color6}${time %Y}${color}
${color6}${hr 1}${color}
Load Avg${alignr}Diskio${image /media/5/Conky/images/deep_skyblue_1.png -p 60,341 -s 1x68}
 1: ${loadavg 1} R:${alignr}${diskio_read /dev/sda}
 5: ${loadavg 2} W:${alignr}${diskio_write /dev/sda}
15: ${loadavg 3} T:${alignr}${diskio /dev/sda}
${color6}${hr 1}${color}
${alignc}Root${alignr}Home
 %${goto 40}${fs_used_perc /}${alignr}${fs_used_perc /home}
Use${goto 40}${fs_used /}${alignr}${fs_used /home}
Tot${goto 40}${fs_size /}${goto 40}${alignr}${fs_size /home}
${goto 5}${color1}${cpubar cpu1 15,125}${voffset -9}${goto 20}${color}CPU 1    ${cpu cpu1} %
${voffset -3}${goto 5}${color1}${cpubar cpu2 15,125}${voffset -9}${goto 20}${color}CPU 2    ${cpu cpu2} %
${voffset -3}${goto 5}${color1}${cpubar cpu3 15,125}${voffset -9}${goto 20}${color}CPU 3    ${cpu cpu3} %
${voffset -3}${goto 5}${color1}${cpubar cpu0 15,125}${voffset -9}${goto 20}${color}CPU Avg  ${cpu cpu0} %

The calendar requested by Inodoro Pereyra, and responded to by Crinos512 with a bash script and dk75 with an awk script shown.

TL_ncal-h.awk

#!/usr/bin/gawk -f
#####################################################################
# ncal.awk script by dk75                                           #
#                                                                   #
# usage:                                                            #
# ncal -h | ncal-h.awk             - Start: Sunday                  #
# ncal -h | ncal-h.awk monday=TRUE - Start: Monday                  #
#                             IE:                                   #
#  ${execpi 7200 ncal -bh | /media/5/Conky/scripts/ncal-h.awk}      #
#                                                                   #
#####################################################################

BEGIN	\
{
	weekend[1]=7
	weekend[2]=1

	if ( ARGV[1]=="monday=TRUE" )
	{
		weekend[1]=6
		weekend[2]=7
	}

	today=strftime("%02d")
}

NR==1	\
{
	month=$1
	year=$2
}

NR>1	\
{
	gsub(/ {4}/," 0 ", $0)
	days[NR-1,1]=$1
	days[NR-1,2]=$2
	days[NR-1,3]=$3
	days[NR-1,4]=$4
	days[NR-1,5]=$5
	days[NR-1,6]=$6
	days[NR-1,7]=$7
}

END	\
{
	#############################################################
	# preparing and formatting data                              #
	#############################################################
	for ( i=1; i<=7; i++ )
	{
		for ( j=2; j<=7; j++ )
		{
			days[i,j]=sprintf("%02d", days[i,j])

			if ( days[i,j]=="00" )
				days[i,j]=".."

			if ( days[i,j]==today )
				days[i,j]="${color6}"days[i,j]"${color}"
			else
				days[i,j]="${color}"days[i,j]"${color}"
		}

		if ( i==weekend[1] )
			days[i,1]="${color5}"days[i,1]"${color}"
		else if ( i==weekend[2] )
			days[i,1]="${color5}"days[i,1]"${color}"
		else
			days[i,1]="${color1}"days[i,1]"${color}"
	}
	# ###########################################################

	#############################################################
	# displaying data                                           #
	#############################################################
	#print "${alignc}${color6}"month"${color}"

	for ( j=0; j<=1; j++ )
	{
		for ( i=1; i<=7; i++ )
		{
			printf "${alignc}%s %s %s %s\n", days[i,1], days[i,2+j], days[i,4+j], days[i,6+j]
		}
	}

	#print "${alignc}${color6}"year"${color}"
}

Now to add stuff specific to my machine.

Last edited by Sector11 (2013-07-28 01:19:53)


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

Offline

#5845 2013-07-28 02:23:51

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

This thread is 78 pages long with 5,845 messages and is a beast to navigate in.  Most everyone does a very good job using thumbnails for images which helps tremendously

What would also help is to cut back on quoting entire messages when responding. When entire messages are quoted it obviously causes longer messages and in turn space and time in reading them

Using ^ to respond to the previous message or @andreas-r (for example) about a specific message and using partial quotes would also help a great deal

Thank you for your understanding and contributions

Note - This is in response to a PM I received about the size of this thread


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#5846 2013-07-28 03:04:17

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

Re: Conky v1.9 Thread

Went back to a vertical conky for xfce setup; pretty standard stuff:

adlwunrG.jpg


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

Offline

#5847 2013-07-28 03:05:25

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

^ Nice one...  smile


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#5848 2013-07-28 05:34:11

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: Conky v1.9 Thread

PackRat wrote:

Went back to a vertical conky for xfce setup; pretty standard stuff:

PackRat, I think that may be my all time favorite you've posted...


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#5849 2013-07-28 13:59:06

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

Re: Conky v1.9 Thread

@jed - thanks

Trying it with a different window manager:

2013_07_28_scrot.jpg


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

Offline

Help fund CrunchBang, donate to the project!

#5850 2013-07-29 05:00:10

farinet
#! Junkie
Registered: 2012-11-03
Posts: 296

Re: Conky v1.9 Thread

Going thru - a, very!, little bit wink - this big thread i realize my questions are absolutely trivial for you, at least i hope:

So, for me, apciacadapter in conky does not work. The output of acpi -V is:

me@mymachine:~$ acpi -a -V
Battery 0: Charging, 99%, charging at zero rate - will never fully charge.
Battery 0: design capacity 6600 mAh, last full capacity 6600 mAh = 100%
Adapter 0: on-line
Thermal 0: ok, 0.0 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 94.0 degrees C
Thermal 0: trip point 1 switches to mode passive at temperature 90.0 degrees C
Cooling 0: Processor 0 of 10

So, for what i see the adapter is recognized. What am i missing in this line in my ~/.conkyrc:

AC adapter:${alignr}${apciacadapter}

?

TIA for any help!

Last edited by farinet (2013-07-29 05:03:18)

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