SEARCH

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

You are not logged in.

#6976 2014-01-30 23:59:14

mikaere66
New Member
Registered: 2014-01-28
Posts: 4

Re: Conky v1.9 Thread

mrpeachy wrote:

i wonder what kind of journey my dial scrip has been through to end up in mikaere66's conky
I like how it looks cool

I found it in the Third Party Theme Pack that I downloaded for Conky Manager O:)


There are only 10 types of people in this world: those who understand binary & those who don't!

Offline

Help fund CrunchBang, donate to the project!

#6977 2014-01-31 01:07:29

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

Re: Conky v1.9 Thread

@ sjv047

Here's a conky running mounted.lua that should work for you.  You'll have to adjust the lines and calls though.

# killall conky && conky -c /media/5/Conky/Chronograph_mrpeachy.conky &
# killall conky && conky -c /media/5/Conky/S11_Mounted.conky &
# /media/5/Conky/SSC/ssc-Chronograph_mrpeachy.conky & &
# Thank you - mrpeachy

###  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 000000
own_window_class Conky
own_window_title S11

### 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 120

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


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

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

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

# 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 no
default_shade_color black

draw_outline no # amplifies text if yes
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 #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 256

# 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

##############################################  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.3}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------conky -c /media/5/Conky/Chronograph_mrpeachy.conky &------------------
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.5
#lua_draw_hook_post draw_bg 20 0 0 0 0 0x000000 0.5
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.3}
##
#
################### chronograph-mrpeachy #######################################
#lua_load /media/5/Conky/LUA/chronograph-mrpeachy.luaconky -c /media/5/Conky/Chronograph_mrpeachy.conky &
#lua_load /media/5/Conky/LUA/chronograph-mrpeachy_24.lua
#lua_draw_hook_post main
#lua_draw_hook_pre main

### v9000 Weather ############################################################
#lua_load ~/v9000/v9000.lua
#lua_draw_hook_pre weather
#lua_draw_hook_post weather
#lua_load /media/5/Conky/LUA/crono_mrp.template.lua
############################################################ v9000 Weather ###
### mount.lua ################################################################
lua_load /media/5/Conky/LUA/mounted.lua
### mount.lua ### INSTRUCTIONS ##############################################
#load script
#lua_load ~/path_to/mounted.lua
# first lua command below text:
# ${lua get_mounted_data interval}, where interval is a number.  This starts data gathering
# to get output:
# ${lua mount partition_number data_type}, where partition number is a number
# data_type can be
# total - showsconky -c /media/5/Conky/Chronograph_mrpeachy.conky & total number of partitions mounted, requires a partition_number
#       - - also, use 1, could be used in an if_match
# fsys - shows filesystem
# size - shows space used in appropriate units
# free - shows free space in appropriate units
# use% - shows % used
# mount - shows mountpoint

################################################################ mount.lua ###
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.5}
TEXT
${lua get_mounted_data 3}${lua conky_draw_bg 20 0 0 0 0 0x000000 0.1}\
${execi 1800 wget http://themoneyconverter.com/rss-feed/CAD/rss.xml -O /media/5/Conky/convert/cad.txt}\
${execi 1800 wget http://themoneyconverter.com/rss-feed/USD/rss.xml -O /media/5/Conky/convert/usd.txt}\
${color1}${cpubar cpu4 0,340}${color}
 ${color3}Hosted by: ${color}${nodename}${goto 160}${color3}for the past: ${color}${uptime_short}
${alignc}${color3}Kernel: ${color}${kernel}
${alignc}${color3}CPU Usage ${color7}1: ${color}${if_match ${cpu cpu1} < 10}  ${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100} ${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif} %\
 ${color7}2: ${color}${if_match ${cpu cpu2} < 10}  ${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100} ${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif} %\
 ${color7}3: ${color}${if_match ${cpu cpu3} < 10}  ${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100} ${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif} %\
 ${color7}Avg: ${color}${if_match ${cpu cpu0} < 10}  ${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100} ${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif} %
 ${color3}CPU: ${color}${platform f71882fg.2560 temp 1}°${goto 120}${color3}SDA: ${color}${execi 15 hddtemp -n /dev/sda}°${goto 222}${color3}GPU: ${color}${nvidia temp}° ${alignr 5}${color3}MB: ${color}${platform f71882fg.2560 temp 2}°
 ${color3}RAM:  ${color}${mem} / ${memmax} / ${memperc}%${alignr 5}${color3}Swap:  ${color}${swap} ${color}/ ${color}${swapmax}
 ${color3}SDA:  ${color7}Read:  ${color}${diskio_read /dev/sda}${goto 240}${color7}Write:  ${color}${diskio_write /dev/sda}
 ${color3}eth-0 ${color7}Down:  ${color}${downspeedf eth0}${goto 240}${color7}Up:  ${color}${upspeedf eth0}
${voffset -5} ${color1}${hr}
${font monofur:bold:size=12} ${color6}CAD = ${color7}${execi 1800 grep " Argentine Peso" /media/5/Conky/convert/cad.txt | cut -c 40-46} ${color6}ARS\
${alignr 5}${color6}USD = ${color7}${execi 1800 grep " Argentine Peso" /media/5/Conky/convert/usd.txt | cut -c 45-51} ${color6}ARS
       ${color7}${execi 1800 grep " United States Dollar" /media/5/Conky/convert/cad.txt | cut -c 40-46} ${color6}USD\
${alignr 5}${color7}${execi 1800 grep " Canadian Dollar" /media/5/Conky/convert/usd.txt | cut -c 45-51} ${color6}CAD${font}
 ${color1}${hr}
${font monofur:bold:size=12}${alignc}${color6}Mounted System${color}${font}

 ${color6}FSYS${color} = ${lua mount 1 total}${goto 80}${color8}SIZE${goto 115}${color7}FREE${goto 160}${color1}USED${goto 210}${color}MOUNT POINT
${voffset -5} ${color1}${stippled_hr 5 1}${color}

1 ${color6}${lua mount 1 fsys 10}${goto 80}${color8}${lua mount 1 size}${goto 115}${color7}${lua mount 1 free}${goto 160}${color1}${lua mount 1 use%}${goto 210}${color}${lua mount 1 mount}
6 ${color6}${lua mount 6 fsys 10}${goto 80}${color8}${lua mount 6 size}${goto 115}${color7}${lua mount 6 free}${goto 160}${color1}${lua mount 6 use%}${goto 210}${color}${lua mount 6 mount}
4 ${color6}${lua mount 4 fsys 10}${goto 80}${color8}${lua mount 4 size}${goto 115}${color7}${lua mount 4 free}${goto 160}${color1}${lua mount 4 use%}${goto 210}${color}${lua mount 4 mount}
5 ${color6}${lua mount 5 fsys 10}${goto 80}${color8}${lua mount 5 size}${goto 115}${color7}${lua mount 5 free}${goto 160}${color1}${lua mount 5 use%}${goto 210}${color}${lua mount 5 mount}


3 ${color6}${lua mount 3 fsys 10}${goto 80}${color8}${lua mount 3 size}${goto 115}${color7}${lua mount 3 free}${goto 160}${color1}${lua mount 3 use%}${goto 210}${color}${lua mount 3 mount}
2 ${color6}${lua mount 2 fsys 10}${goto 80}${color8}${lua mount 2 size}${goto 115}${color7}${lua mount 2 free}${goto 160}${color1}${lua mount 2 use%}${goto 210}${color}${lua mount 2 mount}

HDDTEMP is easy:  Answer: Yes, 0, Yes, OK, OK

dpkg-reconfigure hddtemp

I'm using METHOD 3 - platform for sensors.

2014_01_30_21_48_06_1920x1080_Sector11.jpg


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

Offline

#6978 2014-01-31 01:50:09

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

Re: Conky v1.9 Thread

@Sector11 - what do you get when you do df in a terminal?
did you do anything to your system to make df give you names rather than uuid's?

Offline

#6979 2014-01-31 02:21:03

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

Re: Conky v1.9 Thread

mrpeachy wrote:

@Sector11 - what do you get when you do df in a terminal?
did you do anything to your system to make df give you names rather than uuid's?

Actually that might be another Oops! by me, I was in SID at the time.

#! shows: 2014_01_30_22_58_54_960x600_Sector11.jpg

SID shows:  2014_01_30_23_08_19_441x292_Sector11.jpg

I did nothing special.  sad

Maybe you could use: inxi

 30 Jan 14 | 23:16:09 ~
    $ inxi -plu
Partition: ID: / size: 20G used: 4.5G (25%) fs: ext4 dev: /dev/sda6 
           label: N/A uuid: 6131ebd8-b61d-4571-bcde-ab410f7fbd49
           ID: /media/CB-R1 size: 20G used: 4.5G (24%) fs: ext4 dev: /dev/sda1 
           label: N/A uuid: 12560fd1-25a5-4c93-b409-a66e32a319df
           ID: /media/CB-H2 size: 20G used: 1.8G (10%) fs: ext4 dev: /dev/sda2 
           label: N/A uuid: 51766402-83a0-4d92-936f-99f5e0d3a664
           ID: /media/5 size: 197G used: 43G (23%) fs: ext4 dev: /dev/sda5 
           label: N/A uuid: 3139da3e-24b0-4b50-ae55-59a9cf65635e
           ID: /media/8 size: 181G used: 60M (1%) fs: ext4 dev: /dev/sda8 
           label: N/A uuid: db0e1f7d-793d-49c3-a24d-9b700b2aedd5
           ID: /home size: 20G used: 2.3G (12%) fs: ext4 dev: /dev/sda7 
           label: N/A uuid: 0e371125-e089-4758-93c9-ed9474044abb
           ID: swap-1 size: 2.15GB used: 0.00GB (0%) fs: swap dev: /dev/sda3 
           label: N/A uuid: c76b0149-7c0f-4e62-8fb9-97fd04b0e89f
 
 30 Jan 14 | 23:16:45 ~
    $

Just a thought.

Last edited by Sector11 (2014-01-31 02:28:25)


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

Offline

#6980 2014-01-31 02:37:21

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

Re: Conky v1.9 Thread

mikaere66 wrote:
mrpeachy wrote:

i wonder what kind of journey my dial scrip has been through to end up in mikaere66's conky
I like how it looks cool

I found it in the Third Party Theme Pack that I downloaded for Conky Manager O:)

What's the name of the lua file that runs that Temp guage?


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

Offline

#6981 2014-01-31 02:40:23

Zbot
New Member
Registered: 2014-01-28
Posts: 6

Re: Conky v1.9 Thread

I have a question, been looking around for a solution to, I am just starting out tweaking conky and I wanted to put a little place with notes in it. I have the following code worked out,

N O T E S
${hr}
${execi 60 cat /home/zbot/notes/NOTE_TO_SELF.txt}

The problem is if the note is too long it cuts off, is there a better way to do this that I am just missing?
(PS, I have a script that auto updates the note since I work in the terminal a lot, very useful to jot down things on the fly)

Cheers.

Offline

#6982 2014-01-31 04:10:31

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

Re: Conky v1.9 Thread

here is something to try...a tweaked version of mounted.lua
run it in the same way as the original mounted.lua except you have to specify which method you want in the data gathering line

${lua get_mounted_data 5 inxi}

either inxi or df (not in quotes)

mounted.lua

better code a few posts down!

i had to manually calculate the amount of space free (subtract used from total), so i dont know if inxi would use different units for used and total

EDIT - i havnt taken into account decimal places, so the free calculation wont work exactly
EDIT2 - fixed! big_smile

Screenshot_from_2014_01_30_22_19_58.jpg

Last edited by mrpeachy (2014-02-01 17:58:40)

Offline

#6983 2014-01-31 04:18:16

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

Re: Conky v1.9 Thread

Sector11 wrote:
mikaere66 wrote:
mrpeachy wrote:

i wonder what kind of journey my dial scrip has been through to end up in mikaere66's conky
I like how it looks cool

I found it in the Third Party Theme Pack that I downloaded for Conky Manager O:)

What's the name of the lua file that runs that Temp guage?

i took a look in that archive, the file is buried in there somewhere

/home/mcdowall/Downloads/Deluxe_Conky_Theme_Pack.cmtp/home/.conky/.scripts_orange/scale.lua

i am named at the top smile

Last edited by mrpeachy (2014-01-31 04:28:41)

Offline

#6984 2014-01-31 11:21:13

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

Re: Conky v1.9 Thread

mrpeachy wrote:

i took a look in that archive, the file is buried in there somewhere

/home/mcdowall/Downloads/Deluxe_Conky_Theme_Pack.cmtp/home/.conky/.scripts_orange/scale.lua

i am named at the top smile

As you should be... imaging alllllllll those conkys in one spot.  big_smile
I gotta look at them

@ mikaere66 - Thanks for the link.


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

Offline

#6985 2014-01-31 11:49:22

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

Re: Conky v1.9 Thread

Zbot wrote:

The problem is if the note is too long it cuts off, is there a better way to do this that I am just missing?
(PS, I have a script that auto updates the note since I work in the terminal a lot, very useful to jot down things on the fly)

Cheers.

Hi Zbot ...

Cut off how, in number of lines or width?

Do you have: minimum_size or maximum_width set?

This works for me:

TEXT
${lua conky_draw_bg 10 0 0 0 0 0xffffff 0.2}\
N O T E S
${hr}
${execi 60 cat /home/sector11/Tazer.txt|fold -s -w80}

2014_01_31_08_22_00_1920x1080_Sector11.jpg
Flowed right off the bottom of the screen ... so I reduced text size and increased the fold

TEXT
${lua conky_draw_bg 10 0 0 0 0 0xffffff 0.2}\
N O T E S
${hr}
${execi 60 cat /home/sector11/Tazer.txt|fold -s -w80}

2014_01_31_08_25_53_333x885_Sector11.jpg

NOTE:  At times when you change a conky it needs to be killed and restarted for it to display properly!


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

Offline

#6986 2014-01-31 11:51:11

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

Re: Conky v1.9 Thread

mrpeachy wrote:

here is something to try...a tweaked version of mounted.lua
run it in the same way as the original mounted.lua except you have to specify which method you want in the data gathering line

${lua get_mounted_data 5 inxi}

either inxi or df (not in quotes)

i had to manually calculate the amount of space free (subtract used from total), so i dont know if inxi would use different units for used and total

EDIT - i havnt taken into account decimal places, so the free calculation wont work exactly
EDIT2 - fixed! big_smile

http://s10.postimg.org/nw7a4ay9h/Screenshot_from_2014_01_30_22_19_58.jpg

Oooooooo sometimes being lat for the party means the bugs have been sprayed...

I'll have to try that. BRB


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

Offline

#6987 2014-01-31 12:11:52

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

Re: Conky v1.9 Thread

mrpeachy wrote:

here is something to try...a tweaked version of mounted.lua

OK, works  ... with bugs or I missed something.
New mounted: inxi ·  ·  ·  ·  ·  New: df ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  Old mounted
2014_01_31_08_47_16_352x336_Sector11.jpg 2014_01_31_08_47_48_352x336_Sector11.jpg 2014_01_31_08_51_55_352x336_Sector11.jpg

The new mounted with df seems to have a problem ... maybe a SID thing ... let me check #! Waldorf (Stable) ... BRB

I'm back ... I'm getting the same on Waldorf:
2014_01_31_09_13_07_352x336_Sector11.jpg 2014_01_31_09_14_51_352x336_Sector11.jpg 2014_01_31_09_05_35_352x336_Sector11.jpg

I'll be plugging inxi in I think  big_smile

Last edited by Sector11 (2014-01-31 12:37:32)


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

Offline

#6988 2014-01-31 16:08:38

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

Re: Conky v1.9 Thread

Sector11 wrote:
mrpeachy wrote:

here is something to try...a tweaked version of mounted.lua

OK, works  ... with bugs or I missed something.
New mounted: inxi ·  ·  ·  ·  ·  New: df ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  Old mounted
http://s20.postimg.org/eacdvcebt/2014_01_31_08_47_16_352x336_Sector11.jpg http://s20.postimg.org/rfrw1g87d/2014_01_31_08_47_48_352x336_Sector11.jpg http://s20.postimg.org/mv5pmioi1/2014_01_31_08_51_55_352x336_Sector11.jpg

The new mounted with df seems to have a problem ... maybe a SID thing ... let me check #! Waldorf (Stable) ... BRB

I'm back ... I'm getting the same on Waldorf:
http://s20.postimg.org/i1lyhns09/2014_01_31_09_13_07_352x336_Sector11.jpg http://s20.postimg.org/6dwi0us95/2014_01_31_09_14_51_352x336_Sector11.jpg http://s20.postimg.org/u65tcdua1/2014_01_31_09_05_35_352x336_Sector11.jpg

I'll be plugging inxi in I think  big_smile

what bugs are you seeing?
do you have the original mounted.lua you could post
i overwrote mine!

Offline

#6989 2014-01-31 20:01:54

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

Re: Conky v1.9 Thread

ok, so now im a little more awake, i see that i have switched around fsys name and mount point in the inxi
and i think i should be using df -h for the df not just df

ill fix both of those in a second and post updated code!

--partitions for conky by mrpeachy
start_mount=1
function conky_get_mounted_data(interval,command)
--print (interval, command)
local updates=tonumber(conky_parse("${updates}"))
timer=(updates % interval)
if timer==0 or start_mount==1 then
fsys={}
size={}
used={}
avail={}
uperc={}
mount={}
data={}
if command =="df" then
	local file = io.popen("df -h")
		for line in file:lines() do
			if string.find(line,"/dev/s")~=nil then
			local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
			table.insert(fsys,fs)
			local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
			table.insert(size,sz)
			local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
			table.insert(used,us)
			local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
			table.insert(avail,av)
			local s,f,up=string.find(line,"%s*([%d]*)%%%s",f)
			table.insert(uperc,up)
			local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
			table.insert(mount,mn)
			end	
		end
	file:close()
elseif command =="inxi" then
	local file = io.popen("inxi -plu")
		for line in file:lines() do
			if line:find("ID:") then
			n=0
				for i in string.gmatch(line, "%S+") do --Where "%S+" is the string pattern.
				n=n+1
					if i:find("ID") then
					data[1]=n
					end
					if data[1] then
						if n==data[1]+1 then
						table.insert(mount,i)
						elseif n==data[1]+3 then
						table.insert(size,i)
						elseif n==data[1]+5 then
						table.insert(used,i)
						elseif n==data[1]+6 then
						local s,f,up=string.find(line,"%((.*)%)")
						table.insert(uperc,up)
						elseif n==data[1]+10 then
						table.insert(fsys,i)
						end
					end--if data[1]
				end--for i in string
			end--if line find	
		end--for line in line
	file:close()
	for i=1,#fsys do
	local sz=size[i]
	local szl=string.len(sz)
	local us=used[i]
	local usl=string.len(us)
	local f,s,szn=sz:find("^([%d%p]+).*")
	local f,s,usn=us:find("^([%d%p]+).*")
	local f,s,suf=sz:find("%d+(%a+).*")
	local av=tonumber(szn)-tonumber(usn)
	table.insert(avail,av..suf)	
	end
end--command type
start_mount=nil
end--timed section
return ""
end

function conky_mount(n,d,c)--n=partition_number,d=data_type,c=number of characters to return
d=tostring(d)
n=tonumber(n)
c=tonumber(c) or 0
if d=="total" then
data=#fsys or 1
elseif d=="fsys" then
data=fsys[n] or ""
	if c~=0 then
	data=string.sub(data,1,c) or ""
	end
elseif d=="size" then
data=size[n] or ""
elseif d=="used" then
data=used[n] or ""
elseif d=="free" then
data=avail[n] or ""
elseif d=="use%" then
data=uperc[n] or ""
elseif d=="mount" then
data=mount[n] or ""
	if c~=0 then
	data=string.sub(data,1,c) or ""
	end
else
data="check data type"
end
return data
end--end main function

require 'cairo'
function conky_mbar(m,x,y,w,h,c)
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)
local cr = cairo_create(cs)
--################################
local m=tonumber(m)
if m<=#fsys then
local x=tonumber(x)+0.5
local y=tonumber(y)+0.5
local w=tonumber(w) or 100
local h=tonumber(h) or 20
local c=tonumber(c) or 0xffffff
local perc=tonumber(string.sub(uperc[m],1,string.len(uperc[m])-1))
local blen=(w/100)*perc
cairo_set_source_rgba(cr,((c/0x10000) % 0x100)/255,((c/0x100) % 0x100)/255,(c % 0x100)/255,1)
cairo_set_line_width (cr,h)
cairo_rectangle (cr,x,y,blen,h)
cairo_fill (cr)
--cairo_set_source_rgba(cr,1,1,1,1)
cairo_set_line_width (cr,1)
cairo_rectangle (cr,x,y,w,h)
cairo_stroke (cr)
end
--################################
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end--end main function

remember to select the method in the data gathering setup line

${lua get_mounted_data 5 df}

df or inxi

Last edited by mrpeachy (2014-01-31 20:07:03)

Offline

#6990 2014-01-31 20:17:13

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

Re: Conky v1.9 Thread

mrpeachy wrote:

what bugs are you seeing?
do you have the original mounted.lua you could post
i overwrote mine!

lol  lol  lol  I am not alone!

mounted.lua (new one here is: mounted_2.lua - convenient for 2 options)

--[[partitions for conky by mrpeachy

##instructions
##load script
lua_load ~/lua/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number.  This starts data gathering
## to get output:
## ${lua mount partition_number data_type text_length}, where partition number is a number
## text_length is optional, lets you specify the max number of characters the function returns. only affects fsys and mount data options
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint

TEXT
CPU %: ${cpu cpu0} ${lua get_mounted_data 10}
TOTAL PARTITIONS MOUNTED: ${lua mount 1 total}
FSYS${goto 100}SIZE${goto 200}USED%${goto 300}MOUNT
${lua mount 1 fsys}${goto 100}${lua mount 1 size}${goto 200}${lua mount 1 use%}${goto 300}${lua mount 1 mount 10}
${lua mount 2 fsys}${goto 100}${lua mount 2 size}${goto 200}${lua mount 2 use%}${goto 300}${lua mount 2 mount 10}
${lua mount 3 fsys}${goto 100}${lua mount 3 size}${goto 200}${lua mount 3 use%}${goto 300}${lua mount 3 mount 10}
${lua mount 4 fsys}${goto 100}${lua mount 4 size}${goto 200}${lua mount 4 use%}${goto 300}${lua mount 4 mount 10}

]]

conky_start=1
function conky_get_mounted_data(interval)
local updates=tonumber(conky_parse("${updates}"))
timer=(updates % interval)
if timer==0 or conky_start==1 then
fsys={}
size={}
used={}
avail={}
uperc={}
mount={}
local file = io.popen("df -h")
	for line in file:lines() do
		if string.find(line,"/dev/")~=nil then
		local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
		table.insert(fsys,fs)
		local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(size,sz)
		local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(used,us)
		local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(avail,av)
		local s,f,up=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(uperc,up)
		local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
		table.insert(mount,mn)
		end
	end
file:close()
conky_start=nil
end--timed section
return ""
end

function conky_mount(n,d,c)--n=partition_number,d=data_type,c=number of characters to return
d=tostring(d)
n=tonumber(n)
c=tonumber(c) or 0
if d=="total" then
data=#fsys or 1
elseif d=="fsys" then
data=fsys[n] or ""
	if c~=0 then
	data=string.sub(data,1,c) or ""
	end
elseif d=="size" then
data=size[n] or ""
elseif d=="used" then
data=used[n] or ""
elseif d=="free" then
data=avail[n] or ""
elseif d=="use%" then
data=uperc[n] or ""
elseif d=="mount" then
data=mount[n] or ""
	if c~=0 then
	data=string.sub(data,1,c) or ""
	end
else
data="check data type"
end
return data
end--end main function

Last edited by Sector11 (2014-01-31 20:17:41)


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

Offline

#6991 2014-01-31 21:02:02

Zbot
New Member
Registered: 2014-01-28
Posts: 6

Re: Conky v1.9 Thread

Thanks, Sector11, the fold command was what I was looking for. I do have maximum width set up, but the fold command fixes the notes. Not worried about this particular file running off the screen since it is mostly for immediate notes and is easily cleared.

Zbot

Offline

#6992 2014-01-31 21:30:03

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

Re: Conky v1.9 Thread

mrpeachy wrote:

ok, so now im a little more awake, i see that i have switched around fsys name and mount point in the inxi
and i think i should be using df -h for the df not just df

ill fix both of those in a second and post updated code!

I like this ... since I use inxi a lot with "aliases":

## Short ##
alias S11='inxi -F -c5'				## not filtered
alias s11='inxi -Fz -c5'			## filtered
## Full ##
alias SYS='inxi -ACDfGIpluNrsSt cm3 -c5 -v7'	 	## not filtered
alias sys='inxi -zACDfGIpluNrsSt cm3 -c5 -v7'		## Filtered
## Pieces ##
alias aud='inxi -A -c5'					# Audio
alias cpu='inxi -C -c5'					# CPU
alias hdd='inxi -Dd -c5'				# Hard drive
alias mac='inxi -M -c5'					# Machine
alias nwk='inxi -N -c5'					# Network
alias par='inxi -plu -c5'				# Partitions
alias sen='inxi -s -c5'					# Sensors
alias vid='inxi -Gxx -c5'				# Graphics

alias sensen='sensors && inxi -s -c5'		# lm & inxi sensors

love that sensen one:

 31 Jan 14 | 18:12:39 ~
    $ sensen -c5
acpitz-virtual-0
Adapter: Virtual device
temp1:        +30.0°C  (crit = +110.0°C)

k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +34.0°C  (high = +70.0°C)

f71862fg-isa-0a00
Adapter: ISA adapter
+3.3V:        +3.52 V  
in1:          +1.35 V  
in2:          +1.51 V  
in3:          +0.87 V  
in4:          +0.00 V  
in5:          +0.00 V  
in6:          +0.00 V  
3VSB:         +3.39 V  
Vbat:         +3.02 V  
fan1:        2581 RPM
fan2:           0 RPM  ALARM
fan3:           0 RPM  ALARM
temp1:        +42.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +255.0°C, hyst = +251.0°C)  sensor = transistor
temp2:        +37.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +100.0°C, hyst = +96.0°C)  sensor = thermistor
temp3:       +127.0°C  (high = +70.0°C, hyst = +68.0°C)  ALARM (CRIT)
                       (crit = +85.0°C, hyst = +83.0°C)  sensor = transistor

Sensors:   System Temperatures: cpu: 42.0C mobo: 37.0C gpu: 46C 
           Fan Speeds (in rpm): cpu: 2581 fan-2: 0 fan-3: 0 
 
 31 Jan 14 | 18:12:42 ~
    $ 

I will definitely  be using the "inxi" version  tongue

The latest mounted_2.lua and the old mounted.lua
2014_01_31_18_04_34_352x336_Sector11.jpg 2014_01_31_18_05_25_352x336_Sector11.jpg 2014_01_31_18_07_01_352x336_Sector11.jpg

Last edited by Sector11 (2014-01-31 21:38:30)


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

Offline

#6993 2014-01-31 21:57:19

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

Re: Conky v1.9 Thread

@ Zbot

Hey, not a problem.  I didn't even think about the fold option I just included it automatically as I use it with a few things conky.

There has to be a command, app or a way to "trim" TEXT files ...

open notes.txt
if more than 30 lines
trim to 30
save note.txt
else
close notes.txt
end

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

Offline

#6994 2014-01-31 22:50:55

Zbot
New Member
Registered: 2014-01-28
Posts: 6

Re: Conky v1.9 Thread

Sector11 wrote:

@ Zbot

Hey, not a problem.  I didn't even think about the fold option I just included it automatically as I use it with a few things conky.

There has to be a command, app or a way to "trim" TEXT files ...

open notes.txt
if more than 30 lines
trim to 30
save note.txt
else
close notes.txt
end

Hmm, I may write a little C program that handles my notes in this way. Package it up with the Conky scripts and I have something basic that I imagine might be pretty useful for some people. A little note app that self limits its own size for use with Conky. Will work on this over the weekend if I have time and will report. Will report back here if I come up with anything useful.

Offline

#6995 2014-02-01 04:38:40

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,591

Re: Conky v1.9 Thread

How do I make an exceptionally song/album name scroll in conky?

Offline

#6996 2014-02-01 04:44:41

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

Re: Conky v1.9 Thread

Dobbie03 wrote:

How do I make an exceptionally song/album name scroll in conky?

conky has a scroll object

http://conky.sourceforge.net/variables.html wrote:

scroll     length (step) text    

Scroll 'text' by 'step' characters showing 'length' number of characters at the same time. The text may also contain variables. 'step' is optional and defaults to 1 if not set. If a var creates output on multiple lines then the lines are placed behind each other separated with a '|'-sign. If you change the textcolor inside $scroll it will automatically have it's old value back at the end of $scroll. The end and the start of text will be separated by 'length' number of spaces.

Offline

#6997 2014-02-01 04:49:37

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,591

Re: Conky v1.9 Thread

Perfecto.

Thanks mrpeachy.

Offline

#6998 2014-02-01 04:54:38

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,591

Re: Conky v1.9 Thread

One thing, where in this line would I put the scroll command?

${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}TRACK: ${color1}${alignr}${if_running audacious}${exec audtool --current-song-tuple-data title| fold -s -w 150}

I can get it to scroll  if I put something like this:

${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}TRACK: ${color1}${alignr}${if_running audacious}${exec audtool scroll 150 1 --current-song-tuple-data title| fold -s -w 150}

But it only scrolls that text following that command note the actual song title.

Offline

#6999 2014-02-01 05:27:57

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

Re: Conky v1.9 Thread

Dobbie03 wrote:

One thing, where in this line would I put the scroll command?

${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}TRACK: ${color1}${alignr}${if_running audacious}${exec audtool --current-song-tuple-data title| fold -s -w 150}

I can get it to scroll  if I put something like this:

${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}TRACK: ${color1}${alignr}${if_running audacious}${exec audtool scroll 150 1 --current-song-tuple-data title| fold -s -w 150}

But it only scrolls that text following that command note the actual song title.


can you post a screenshot showing what is scrolling and what is not?
i dont think scroll is going to work as expected when combined with fold

Offline

Be excellent to each other!

#7000 2014-02-01 05:35:42

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,591

Re: Conky v1.9 Thread

mrpeachy wrote:
Dobbie03 wrote:

One thing, where in this line would I put the scroll command?

${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}TRACK: ${color1}${alignr}${if_running audacious}${exec audtool --current-song-tuple-data title| fold -s -w 150}

I can get it to scroll  if I put something like this:

${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}TRACK: ${color1}${alignr}${if_running audacious}${exec audtool scroll 150 1 --current-song-tuple-data title| fold -s -w 150}

But it only scrolls that text following that command not the actual song title.


can you post a screenshot showing what is scrolling and what is not?
i dont think scroll is going to work as expected when combined with fold

Now I cant get anything to scroll.  Grrrr.

This is the config:

${font Open Sans Light:size=15}${exec audtool version}
${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}TRACK: ${color1}${alignr}${if_running audacious}${exec audtool --current-song-tuple-data title| fold -s -w 150}
${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}ARTIST: ${color1}${alignr}${if_running audacious}${exec audtool --current-song-tuple-data artist| fold -s -w 150}
${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}ALBUM: ${color1}${alignr}${if_running audacious}${exec audtool --current-song-tuple-data album| fold -s -w 150}
${if_running audacious}${color #ffffff}${font AvantGarde LT ExtraLight:pixelsize=10}VOL: ${color2}${exec audtool get-volume} ${color1}% ${color ffffff}${color #ffffff}P/LIST: ${color1}${exec audtool  playlist-position} ${color3}/ ${color2}${exec audtool playlist-length} ${alignr}${color #ffffff}BIT: ${color1}${if_running audacious}${color2}${exec audtool --current-song-bitrate-kbps} kbps ${color #ffffff}LEN: ${color1}${execi 0.5 audtool --current-song-output-length}${color3} / ${color2}${exec audtool --current-song-length}
${color7}${if_running audacious}${execibar 0.5  expr 100 \* $(audtool --current-song-output-length-seconds) \/ $(audtool --current-song-length-seconds) }$endif

Even if I remove the fold detail, nothing.

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