Author Topic: Conky and other stuff  (Read 11488 times)

0 Members and 1 Guest are viewing this topic.

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Conky and other stuff
« on: February 08, 2013, 08:49:26 pm »
I agree that we needed a seporate thread for conky,tint2,pypanel,blah blah blah stuff. Filling up the desktop thread with something we're going to change in a few days is just making it bloated.

Screen shots and config files required.

Arch with OpenBox, tint2, conky. System specs found in screenshot.

.conkyrc
Code: [Select]
background no
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes

maximum_width 400
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color lightgray
default_shade_color red
default_outline_color green
alignment top_right
gap_x 10
gap_y 30

no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer none


TEXT
${alignc 32}${font Open Sans:size=20}${color #0FDF00}arch${color } linux$font$color
${alignc}${font Open Sans:size=10}${color white}${execi 30 users | cut -c1-5}@$nodename

${color #0FDF00}${font Open Sans:Bold:size=10}Time Date${hr 2}$color$font
$color${font Open Sans:size=12}${time %I:%M}$alignr${time %d %b %Y}$font$color

# SYS
${font Open Sans:Bold:size=10}${color #0FDF00}SYSTEM${hr 2}$color${font}
$sysname $kernel $alignr $machine
Uptime $alignr $uptime
GPU Temperature $alignr ${execi 30 sensors | grep 'temp1:' | cut -c16-17}°C

# CPU
${font Open Sans:Bold:size=10}${color #0FDF00}CPU${hr 2}
$color${font}Intel i5 2500k $alignr ${freq_g cpu0}GHz
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
${font}Core 1 ${color #0FDF00}${execi 30 sensors | grep 'Core 0:' | cut -c16-17}°C${color} @ ${cpu cpu1} % $alignc ${color #0FDF00}${cpubar cpu1}${color}
${font}Core 2 ${color #0FDF00}${execi 30 sensors | grep 'Core 1:' | cut -c16-17}°C${color} @ ${cpu cpu2} % $alignc ${color #0FDF00}${cpubar cpu2}${color}

# MEMORY
${font Open Sans:Bold:size=10}${color #0FDF00}MEMORY${hr 2}
$color${font}${font Open Sans:bold:size=8.5}RAM$font
$mem / $memmax $alignr $memperc %
${color #0FDF00}$membar

# NETWORK
${font Open Sans:Bold:size=10}${color #0FDF00}Network${hr 2}
$color${font Open Sans:bold:size=8.5}External IP ${font}${alignr}${execi 6666666 wget -O - http://ip.tupeux.com | tail}$font
${font Open Sans:bold:size=8.5}wlo1 $font$alignr ${addr wlo1}
down $alignr ${downspeedf wlo1} kb/s
up $alignr ${upspeedf wlo1} kb/s
down total ${totaldown wlo1} $alignr up total ${totalup wlo1}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
down graph $alignr up graph
${downspeedgraph wlo1 30,120 0FDF00 0FDF00}$alignr${upspeedgraph wlo1 30,120 0FDF00 0FDF00}
# HDD
${font Open Sans:Bold:size=10}${color #0FDF00}Disks${hr 2}
$color${font Open Sans:bold:size=8.5}/dev/sda $font$alignr ${execi 30 python2 ~/Python_Code/conky_hddtemp.py}°C
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
${font Open Sans:bold:size=8.5}ROOT $font$font$alignr ${fs_type /}/ext4
${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /} %
${color #0FDF00}${fs_bar /}
$color${font Open Sans:bold:size=8.5}HOME $font$font$alignr home/ext4
${fs_used /home} / ${fs_size /home} $alignr ${fs_used_perc /home} %
${color #0FDF00}${fs_bar /home}
# TOP
${font Open Sans:Bold:size=10}${color #0FDF00}TOP${hr 2}
$color${font}${font Open Sans:bold:size=8.5}PROCESS $alignr CPU USAGE$font
${top name 1}${alignr}${top cpu 1} %
${top name 2}${alignr}${top cpu 2} %
${top name 3}${alignr}${top cpu 3} %
${top name 4}${alignr}${top cpu 4} %
${top name 5}${alignr}${top cpu 5} %

conky_hddtemp.py -- becuase the hdd temp needs sudo
Code: (python) [Select]
#Requires hddtemp installed

#!/usr/bin/python2
import os

command = "hddtemp /dev/sda | cut -c24-25"
sudo_pass = "doItInTheButtLulz"

x = os.popen("echo %s | sudo -S %s" % (sudo_pass, command)).read()
print x.strip()

Tint2
Code: [Select]
# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure
#Edit- Techb

# Background definitions
# ID 1
rounded = 10
border_width = 1
background_color = #000700 74
border_color = #07A410 80

# ID 2
rounded = 5
border_width = 0
background_color = #FFFFFF 40
border_color = #FFFFFF 46

# ID 3
rounded = 5
border_width = 0
background_color = #FFFFFF 14
border_color = #FFFFFF 66

# Panel
panel_monitor = all
panel_position = top center horizontal
panel_size = 100% 30
panel_margin = 0 0
panel_padding = 7 0 7
panel_dock = 0
wm_menu = 0
panel_layer = top
panel_background_id = 1

# Panel Autohide
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 2
autohide_height = 2
strut_policy = follow_size

# Taskbar
taskbar_mode = single_desktop
taskbar_padding = 2 3 2
taskbar_background_id = 0
taskbar_active_background_id = 0

# Tasks
urgent_nb_of_blink = 8
task_icon = 1
task_text = 1
task_centered = 1
task_maximum_size = 70 35
task_padding = 6 2
task_background_id = 3
task_active_background_id = 2
task_urgent_background_id = 2
task_iconified_background_id = 3

# Task Icons
task_icon_asb = 70 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 70 0 0

# Fonts
task_font = Sans 7
task_font_color = #0F8A00 66
task_active_font_color = #09FF00 100
task_urgent_font_color = #9B0D0D 81
task_iconified_font_color = #0F8A00 66
font_shadow = 0

# System Tray
systray = 1
systray_padding = 0 4 5
systray_sort = ascending
systray_background_id = 0
systray_icon_size = 16
systray_icon_asb = 70 0 0

# Clock
time1_format = %I:%M
time1_font = sans 8
time2_format = %A %d %B
time2_font = sans 6
clock_font_color = #FFFFFF 72
clock_padding = 1 0
clock_background_id = 0
clock_rclick_command = orage

# Tooltips
tooltip = 0
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font = sans 10
tooltip_font_color = #000000 80

# Mouse
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify

# Battery
battery = 1
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
battery_hide = 98
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #FFFFFF 72
battery_padding = 1 0
battery_background_id = 0

# End of config

openbox/rx.xml -- Only the relevent part
Code: (xml) [Select]
    <!-- Custome Keybinds -->
    <keybind key="C-A-t">
      <action name="Execute">
        <command>urxvt</command>
      </action>
    </keybind>
    <keybind key="C-A-f">
      <action name="Execute">
        <command>thunar</command>
      </action>
    </keybind>
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer set Master 1+</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer set Master 1-</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer set Master toggle</command>
      </action>
    </keybind>
    <keybind key="C-A-s">
      <action name=Execute">
        <command>import -window root screen.jpg</command>
      </action>
    </keybind>
    <keybind key="W-m">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>

.Xresources
Code: [Select]
XTerm*foreground: green
XTerm*background: black
XTerm*scrollBar: on
XTerm*saveLines: 2000
XTerm*loginShell: on
XTerm*reverseWrap: on
XTerm*rightScrollBar: true
XTerm*VT100*jumpScroll: true
XTerm*boldFont: 7x14bold
XTerm*font: 7x14

URXvt*title: TechTerm
URxvt*transparent: true
URxvt*shading: 110
URxvt*foreground: green
URxvt*background: black
URxvt*saveLines: 2000
URxvt*loginShell: on
URxvt*reverseWrap: on
URxvt*scrollBar: on
URxvt*scrollBar_right: true
URxvt*scrollstyle: xterm
URxvt*scrollColor: green
URxvt*boldFont: 7x14bold
URxvt*font: 7x14
URxvt.iconFile: /usr/share/icons/gnome/32x32/apps/terminal.png
« Last Edit: February 08, 2013, 10:48:05 pm by techb »
>>>import this
-----------------------------

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Conky and other stuff
« Reply #1 on: February 08, 2013, 10:05:41 pm »
OK I know I've posted my shit like crazy but I'm going to do it one more time for the sake of this thread. I'm also running Arch with Openbox.

mocp with custom theme and urxvt



Openbox menu with Mire v2 Blue theme






Conky 1
Code: [Select]
alignment top_left
border_width 200
default_color bbbbbb
double_buffer yes
draw_borders no
draw_outline no
draw_shades no
gap_x 3
gap_y 3
maximum_width 2000
no_buffers yes
override_utf8_locale yes
own_window_colour eeeeee
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
own_window_transparent yes
own_window_type override
own_window yes
stippled_borders 0
update_interval 5
uppercase no
#use_spacer yes
use_xft yes
xftfont Nu:size=7

# Lua Load #
lua_load ~/.openbox/conky/conky_top/clock_rings.lua
lua_draw_hook_pre clock_rings

TEXT

$alignc${image ~/.icons/archlinux/icons/archlinuxiconcrystal128.png -p 12,0 -s 64x64}| ${color 99cccc}Kernel: $color${kernel}$color ${color eeeeee}| ${font}${color 99cccc}Hostname: $color${nodename} ${color eeeeee}| ${color 99cccc}External IP: $color${execi 10 wget -O - http://ip.tupeux.com | tail} ${color eeeeee}| ${color 99cccc}wlan0: $color${addr wlan0} ${color eeeeee}| ${color 99cccc}Mac: $color${exec ifconfig wlan0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'} ${color eeeeee}|${color 99cccc} RAM $color${memperc}%${offset -75}${color eeeeee}${offset 55}${color ffffff}        | ${color 99cccc}Home $color${fs_bar 6,75 /home}${offset -75}${voffset -1}${color eeeeee}${offset 55}${color ffffff}        | ${voffset 1}${color 99cccc}Root $color${fs_bar 6,75 /}${offset -75}${voffset -1}${color eeeeee}${offset 55} ${color ffffff}       | ${color 99cccc}Battery: $color${battery_percent}%${color eeeeee} | ${color 99cccc}${time %I:%M %p - %b %e} ${color eeeeee}| ${color 99cccc}Temp: $color${acpitemp} ${color eeeeee}|


Conky 2
Code: [Select]
alignment bottom_left
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

# Window specifications #
own_window yes
own_window_type override
own_window_transparent #000000
own_window_transparent yes

border_inner_margin 30
border_outer_margin 30

minimum_size 400 450
maximum_width 500

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes

# Text settings #
use_xft yes
xftfont Nu:size=8
xftalpha 0.5

uppercase no

TEXT
${font Radio Space:size=11}${color 66CCCC}${voffset 5}NAME${goto 122}         ${font Radio Space:size=8}${color 99CCCC}PID${goto 163}        CPU%${goto 210}        MEM%$color${voffset 5}
${color 99CCCC}${voffset -4}____________________________________________________
$font${color eeeeee}
${top name 1}${goto 115}        ${top pid 1}${goto 160}        ${top cpu 1}${goto 205}        ${top mem 1}
${top name 2}${goto 115}        ${top pid 2}${goto 160}        ${top cpu 2}${goto 205}        ${top mem 2}
${top name 3}${goto 115}        ${top pid 3}${goto 160}        ${top cpu 3}${goto 205}        ${top mem 3}
${top name 4}${goto 115}        ${top pid 4}${goto 160}        ${top cpu 4}${goto 205}        ${top mem 4}
${top name 5}${goto 115}        ${top pid 5}${goto 160}        ${top cpu 5}${goto 205}        ${top mem 5}
${top name 6}${goto 115}        ${top pid 6}${goto 160}        ${top cpu 6}${goto 205}        ${top mem 6}
${top name 7}${goto 115}        ${top pid 7}${goto 160}        ${top cpu 7}${goto 205}        ${top mem 7}
${top name 8}${goto 115}        ${top pid 8}${goto 160}        ${top cpu 8}${goto 205}        ${top mem 8}
${top name 9}${goto 115}           ${top pid 9}${goto 160}               ${top cpu 9}${goto 205}               ${top mem 9}
${top name 10}${goto 115}           ${top pid 10}${goto 160}               ${top cpu 10}${goto 205}               ${top mem 10}

mocp theme
Code: [Select]

background                = default        default
frame                    = white        default
window_title            = white        default
directory                = white        default
selected_directory        = white        black    reverse
playlist                = white        default
selected_playlist        = white        default    reverse
file                    = white        default
selected_file            = white        black    reverse
marked_file                = white        default    bold
marked_selected_file    = white        default    bold,reverse
info                    = white        default    underline
status                    = white        default
title                    = white        default    bold
state                    = white        default
current_time            = white        default    bold
time_left                = white        default    bold
total_time                = white        default    bold
time_total_frames        = white        default
sound_parameters        = white        default    bold
legend                    = red        default
disabled                = white        default
enabled                    = white        default    bold
empty_mixer_bar            = cyan        black
filled_mixer_bar        = white        black    reverse
empty_time_bar            = white        black
filled_time_bar            = cyan        default    reverse
entry                    = white        black
entry_title                = white        black
error                    = red        black    bold,underline
message                    = red        default
plist_time                = red        default

 ;D
« Last Edit: February 08, 2013, 10:08:40 pm by lucid »
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline relax

  • Sir
  • ***
  • Posts: 562
  • Cookies: 114
  • The one and only
    • View Profile
Re: Conky and other stuff
« Reply #2 on: February 09, 2013, 02:12:04 am »
not much to say except that the vlc.py is a real fucking mess but works



.concyrc
Code: [Select]
background no
use_xft yes
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window_class Conky
own_window yes
own_window_type dock
own_window_argb_visual yes
own_window_argb_value 180
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 400 1900
maximum_width 195
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color d8d8d8
default_shade_color 000000
default_outline_color d9d7d6
alignment tr
gap_x 1150
gap_y 20
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
lua_load ~/test.lua
lua_draw_hook_pre draw_lua
use_spacer none
override_utf8_locale yes
use_xft yes
xftfont Terminus:size=8
xftalpha 0.8

TEXT
${font Sans:bold:size=8.25}${color AA0000}SYSTEM  ${color3}${hr 2}
${voffset 4}${font Stylebats:size=10}${color1}${voffset -1}${font}${color2} ${sysname} ${kernel}${alignr}${machine}
${font StyleBats:size=10}${color1}${voffset -1}${font}${color2} System Uptime${alignr}${uptime_short}
${font StyleBats:size=10}${color1}${voffset -1}${font}${color2} File System${alignr}${fs_type}
${voffset 4}${font Sans:bold:size=8}${color AA0000}PROCESSORS  ${color3}${hr 2}
${voffset 4}${font StyleBats:size=10}${color1}${voffset -1}${font}${color2} CPU1 ${cpu cpu1}%${goto 200}${freq_g 1} GHz
${font StyleBats:size=10}${color1}${voffset -1}${font}${color2} CPU2 ${cpu cpu2}%
${font StyleBats:size=10}${color1}${voffset -1}${font}${color2} CPU3 ${cpu cpu3}%
${font StyleBats:size=10}${color1}${voffset -1}${font}${color2} CPU4 ${cpu cpu4}%
${font StyleBats:size=10}${color1}${voffset -1}${font}${color2} CPU Info ${alignr}${execi 30 sensors | grep '(' | cut -c16-17}°C / ${freq} MHz
${voffset 4}${font Sans:bold:size=8.25}${color aa0000}MEMORY  ${color3}${hr 2}
${voffset 4}${font StyleBats:size=10}${color1}${voffset -2}${font}${color2} RAM ${memperc}%
${font Sans:bold:size=8.25}${color AA0000}HDD  ${color3}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color1}${font}${color2} Mint${goto 200}${fs_used_perc /}}${fs_used_perc /media/Backup}
${alignr}${fs_used /} / ${fs_size /}
${font StyleBats:size=10}${color1}${font}${color2} Extra
${alignr}${fs_used /media/extra} / ${fs_size /media/extra}
${font Sans:bold:size=8.25}${color AA0000}TOP PROCESSES  ${color3}${hr 2}${font}
 Name${goto 60}${goto 100}  CPU%${goto 155}${alignr}MEM%
 ${top name 1}${goto 100}${top cpu 1}%${alignr}${top mem 1}%
 ${top name 2}${goto 100}${top cpu 2}%${alignr}${top mem 2}%
 ${top name 3}${goto 100}${top cpu 3}%${alignr}${top mem 3}%
 ${top name 4}${goto 100}${top cpu 4}%${alignr}${top mem 4}%
${voffset 4}${font Sans:bold:size=8.25}${color AA0000}NETWORK  ${color3}${hr 2}${font}
 ${color2}Public IP${alignr}${if_up tap0}${addr tap0}$else${addr eth0}$endif
 ${color2}VPN Status${alignr}${if_up tap0}On$else Off$endif

 ${color2}Down Speed ${downspeed eth0}$alignr${downspeedgraph eth0 12,80 00ff00 ff0000 7000}
 ${color2}Up Speed${goto 80}${upspeed eth0}$alignr${upspeedgraph eth0 12,80 00ff00 ff0000 1000}

${font PizzaDude Bullets:size=9.5}${color1}${font}${color2} Downloaded${alignr}${totaldown eth0}${goto 150}${font PizzaDudeBullets:size=9.5}${color1}${font}
${font PizzaDudeBullets:size=9.5}${color1}${font}${color2} Uploaded${alignr}${totalup eth0}${goto 150}
${font Sans:bold:size=8.25}${color aa0000}WEATHER  ${color3}${hr 2}
${execi 600 ~/Accuweather_Conky_Int_Images/acc_int_images}
${image ~/Accuweather_Conky_Int_Images/cc.png -p -18,485 -s 123x72}${goto 88}${voffset -8}${font Sans:Bold:size=13}${execpi 600 sed -n '29p' ~/Accuweather_Conky_Int_Images/curr_cond}°C${font}
${goto 88}${execpi 600 sed -n '28p' ~/Accuweather_Conky_Int_Images/curr_cond}

   ${execpi 600 sed -n '1p' ~/Accuweather_Conky_Int_Images/curr_cond}$alignc           ${execpi 600 sed -n '6p' ~/Accuweather_Conky_Int_Images/curr_cond}$alignr${execpi 600 sed -n '11p' ~/Accuweather_Conky_Int_Images/curr_cond}   
${image ~/Accuweather_Conky_Int_Images/tod.png -p -5,555 -s 80x50}$alignc${image ~/Accuweather_Conky_Int_Images/6.png -p 63,555 -s 80x50}$alignr${image ~/Accuweather_Conky_Int_Images/11.png -p 140,555 -s 80x50}


${font Sans:Bold:size=10}${goto 10}${execpi 600 sed -n '4p' ~/Accuweather_Conky_Int_Images/curr_cond}°C${goto 85}${font Sans:Bold:size=10}${execpi 600 sed -n '9p' ~/Accuweather_Conky_Int_Images/curr_cond}°C${goto 165}${font Sans:Bold:size=10}${execpi 600 sed -n '14p' ~/Accuweather_Conky_Int_Images/curr_cond}°C
${if_running vlc}${font Sans:bold:size=8.25}${color aa0000}VLC  ${color3}${hr 2}
${image ~/images/vlc.png -p 0,630 -s 50x40}${goto 60}${voffset 5}${execpi 3 python ~/vlc.py -t}
${goto 60}${voffset -3}${font Sans:Italic:size=8}${execpi 3 python ~/vlc.py -s}$font

${execpi 1 python ~/vlc.py -c}$alignr${execpi 3 python ~/vlc.py -l}
${goto 200}${execpi 2 python ~/vlc.py -p}
$endif

~/test.lua
Code: (lua) [Select]
--[[ this script combines the background drawing lua (originally by londonali1010, modified by VinDSL)
with a script that emulates only the gradient bars portion of the script by wlourf
call in conkyrc above TEXT like so
lua_load /path to file/filename.lua
lua_draw_hook_pre draw_lua
]]
require 'cairo'
function conky_draw_lua()
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)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--#########################################################################################################
--background setup -- make sure this comes first-----------
settings={--CONKY BACKGROUND
corner_r=30,--corner radius
bg_color={0x222222,0.0},--color and alpha inside {}
bg_height=-67,--negative number reduces height of bg
w=conky_window.width,
h=conky_window.height,
};background(settings)
--end background setup-------------------------------------
--Line 1 settings
local a_arg=conky_parse('${cpu}')
local a_thick=10
local a_red=0
local a_green=0
local a_blue=0
local a_alpha=1
local a_start=10
--line 1 settings end 
local a_num=tonumber(a_arg)
--line 1 background

--line 1 title
cairo_rotate (cr,90*math.pi/180)
cairo_show_text (cr, "CPU");
cairo_rotate (cr, -90*math.pi/180)

bar_adjust=-2

--bar setup------------------------------------------------
settings={--CPU1 GRAPH
number=tonumber(conky_parse("${cpu cpu1}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=70,--x coordinate
bar_starty=93,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)
settings={--CPU2 GRAPH
number=tonumber(conky_parse("${cpu cpu2}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=70,--x coordinate
bar_starty=108,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)
settings={--CPU3 GRAPH
number=tonumber(conky_parse("${cpu cpu3}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=70,--x coordinate
bar_starty=123,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)
settings={--CPU4 GRAPH
number=tonumber(conky_parse("${cpu cpu4}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=70,--x coordinate
bar_starty=138,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)

settings={--MEM GRAPH
number=tonumber(conky_parse("${memperc}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=70,--x coordinate
bar_starty=189,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)

settings={--HD1 GRAPH
number=tonumber(conky_parse("${fs_used_perc /}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=70,--x coordinate
bar_starty=223,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)

settings={--HD2 GRAPH
number=tonumber(conky_parse("${fs_used_perc /media/extra}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=70,--x coordinate
bar_starty=252,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)

settings={--VLC GRAPH
number=tonumber(conky_parse("${execpi 2 python ~/vlc.py -p}")),--conky object to read
number_max=100,--max value of conky object
bar_startx=38,--x coordinate
bar_starty=679,--y coordinate
divisions=21,--number of blocks
div_width=5,--horizontal size
div_height=7,--vertical size
div_gap=1,--space between bits
bg_color={0xFFFFFF,0.25},--background color, color and alpha inside {}
st_color={0x00FF00,1},--start color for gradient, green
mid_color={0xFFFF00,1},--middle color for gradient, yellow
end_color={0xFF0000,1},--end color for gradient
};bars(settings)

--
--

--copy and paste above for new bar-------------------------
--#########################################################################################################
--#########################################################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function bars(t)
local bar_startx=t.bar_startx
local bar_starty=t.bar_starty
local divisions=t.divisions
local div_width=t.div_width
local div_height=t.div_height
local div_gap=t.div_gap
local br,bg,bb,ba=rgb_to_r_g_b(t.bg_color)
local sr,sg,sb,sa=rgb_to_r_g_b(t.st_color)
local mr,mg,mb,ma=rgb_to_r_g_b(t.mid_color)
local er,eg,eb,ea=rgb_to_r_g_b(t.end_color)
--additional line
local allgreen=t.make_full_green
--additional line
if t.number==nil then number=0 else number=t.number end
local number_max=t.number_max
local number_divs=(number/number_max)*divisions
--additional line
local number_change=t.number_max*0.6
--additional line
cairo_set_line_width (cr,div_width)
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
--additional lines
if allgreen==1 and number>=number_change then
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+er
colg=((mg-sg)*(i/(divisions/2)))+eg
colb=((mb-sb)*(i/(divisions/2)))+eb
cola=((ma-sa)*(i/(divisions/2)))+ea
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+er
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+eg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+eb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ea
else
colr=br
colg=bg
colb=bb
cola=ba
end
end
--additional lines
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
end--function bars
function background(t)
local corner_r=t.corner_r
local br,bg,bb,ba=rgb_to_r_g_b(t.bg_color)
local v=t.bg_height
local h=t.h
local w=t.w
cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h+v-corner_r)
cairo_curve_to(cr,w,h+v,w,h+v,w-corner_r,h+v)
cairo_line_to(cr,corner_r,h+v)
cairo_curve_to(cr,0,h+v,0,h+v,0,h+v-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)
cairo_set_source_rgba(cr,br,bg,bb,ba)
cairo_fill(cr)
end--function background

~/vlc.py
Code: (python) [Select]
import subprocess
import sys
import getopt
def cmd_output(args, **kwds):
      kwds.setdefault("stdout", subprocess.PIPE)
      kwds.setdefault("stderr", subprocess.STDOUT)
      p = subprocess.Popen(args, **kwds)
      return p.communicate()[0]

def main(argv):
        try:
    name = "org.mpris.MediaPlayer2.vlc" #get this from "qdbus | grep vlc"
            data = str(cmd_output("qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata".split()))
            status = str(cmd_output("qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus".split()))
            current_seconds = int(cmd_output("qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Position".split()))/1000
        except:
            print("Unknown error")
            sys.exit()
        status = status[:-1]
        start = data.find("title:")
        end   = data.find("xesam:url:")
        title = data[start+7:end-1]
        if len(title)>40:
             title = "Unknown"
        start = data.find("vlc:length:")
        end   = data.find("vlc:publisher:")
        length_seconds = int(data[start+11:end])/1000
        current_seconds = int(current_seconds / 1000)
        current_position_percent = str(int((float(current_seconds) / float(length_seconds))*100))                     
        length = str(length_seconds/60).rjust(1,"0")+":"+str(length_seconds%60).rjust(2,"0")
        current_position = str(int(current_seconds/60)).rjust(1,"0")+":"+str(int(current_seconds%60)).rjust(2,"0")
        if len(argv) < 1:
            print("Try -h for help")
        try:
            opts, args = getopt.getopt(argv,"tslcph")
        except getopt.GetoptError:
            print("Try -h for help")
            sys.exit(2)
        for opt, arg in opts:
            if opt == "-t":
                print(title)
                sys.exit()
            elif opt == "-s":
                print(status)
                sys.exit()
            elif opt == "-l":
                print(length)
                sys.exit()
            elif opt == "-c":
                print(current_position)
                sys.exit()
            elif opt == "-p":
                print(current_position_percent)
                sys.exit()
            else:
                print("To get vlc info pls provide some of the following arguments")
                print("-t, --title        To display playing title")
                print("-s, --status        To display playbackstatus")
                print("-l, --length        To display length of the file playing")
                print("-c, --current        To display current position")
                print("-p, --procent        To display procent of elapsed time")
if __name__ == "__main__":
   main(sys.argv[1:])

you also need actualweather script and vlc image


Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: Conky and other stuff
« Reply #3 on: February 09, 2013, 02:08:31 pm »
:D :D :D :D
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Conky and other stuff
« Reply #4 on: February 10, 2013, 01:53:44 am »
:D :D :D :D

You forgot the script. But i like the EZ thing.
>>>import this
-----------------------------

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: Conky and other stuff
« Reply #5 on: February 10, 2013, 04:06:40 am »
Lol no I didnt, I justa wanted to show-off my EZ script for conky.
Im still working on it as its still buggy.

Somebody has got a smite fetish for me.
What the fuck did I do....
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Conky and other stuff
« Reply #6 on: February 10, 2013, 04:32:14 am »
Lol no I didnt, I justa wanted to show-off my EZ script for conky.
Im still working on it as its still buggy.

Somebody has got a smite fetish for me.
What the fuck did I do....

Not I, says techb. But you should post scripts anyway, we might be able to help?
>>>import this
-----------------------------

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Conky and other stuff
« Reply #7 on: February 10, 2013, 07:32:50 am »
@ proxx - Idk dude. I don't even bother asking really. I got about 10 smites since yesterday out of nowhere and nobody responded to any of my posts in any way that lets me know who did it. It don't matter.
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline relax

  • Sir
  • ***
  • Posts: 562
  • Cookies: 114
  • The one and only
    • View Profile
Re: Conky and other stuff
« Reply #8 on: February 10, 2013, 10:46:04 am »
@ proxx - Idk dude. I don't even bother asking really. I got about 10 smites since yesterday out of nowhere and nobody responded to any of my posts in any way that lets me know who did it. It don't matter.


yeah well seems to be someone running about and smiting everyone for no reason.
Maybe an old member who got kicked with ~ -400 karma :P

Offline jonneburger

  • Peasant
  • *
  • Posts: 89
  • Cookies: -14
  • M'hacker
    • View Profile
Re: Conky and other stuff
« Reply #9 on: February 10, 2013, 11:38:16 am »

yeah well seems to be someone running about and smiting everyone for no reason.
Maybe an old member who got kicked with ~ -400 karma :P
pllay?

Offline flowjob

  • Knight
  • **
  • Posts: 327
  • Cookies: 46
  • Pastafarian
    • View Profile
Re: Conky and other stuff
« Reply #10 on: February 24, 2013, 12:09:55 pm »


Nothing special, I prefer the simple ones...
But it contains all important information. Also I'm currently working on a script to automatically add other devices when plugged in to the "Devices" section.
Wrote it from scratch so it's a bit messy...

Code: [Select]
own_window yes
own_window_type override
own_window_transparent yes

double_buffer yes

use_xft yes
font Cantarell:size=10

update_interval 1.0

minimum_size 250 5

draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no

uppercase no

default_color light gray
color1 white

own_window_color black
own_window_transparent yes
own_window_type override

alignment top_right

gap_x 10
gap_y 20

TEXT
$color
${color1}${font Cantarell:size=12}SYSTEM $color${hr 2}$font
   User: $color1${exec whoami}$color
   Host: $color1$nodename$color
   Dist:  $color1${exec lsb_release -si} ${exec lsb_release -sr} "${exec lsb_release -sc}"$color
   Core: $color1$kernel [${machine}-${exec uname -s}]$color
   Time: $color1${time %I:%M.%S %P}$color
    UTC: $color1${utime %I:%M.%S %P}$color
   Date: $color1${time %Y-%m-%d}$color
${color1}${font Cantarell:size=12}PERFORMANCE $color${hr 2}$font
   CPU: $color1${cpu cpu0}% / ${freq_g}GHz$color
   ${cpugraph 888888 ffffff -l}
   RAM: $color1${mem mem0} / $memmax$color
   ${memgraph 888888 ffffff -l}
   Swap: $color1$swap / $swapmax$color
   ${swapbar}
   Processes: $color1$processes$color
   Battery: $color1${battery BAT0}$color
   Uptime: $color1$uptime$color
${color1}${font Cantarell:size=12}NETWORK $color${hr 2}$font
   Up: $color1${upspeedf eth0} KiB/s$color
   Total: $color1$totalup$color
   ${upspeedgraph 888888 ffffff -l}
   Down: $color1${downspeedf eth0} KiB/s$color
   Total: $color1$totaldown$color
   ${downspeedgraph 888888 ffffff -l}
   IPv4: $color1$addr$color
${color1}${font Cantarell:size=12}DEVICES $color${hr 2}$font
   root: $color1${fs_used /} / ${fs_size /}$color
   ${fs_bar /}
   tanto: $color1${fs_used /shared} / ${fs_size /shared}$color
   ${fs_bar /shared}
Quote
<phil> I'm gonna DDOS the washing machine with clothes packets.
<deviant_sheep> dont use too much soap or youll cause a bubble overflow

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: Conky and other stuff
« Reply #11 on: February 24, 2013, 05:35:18 pm »
You shouldnt use the exec function in such a fashion.
It will be executed at the same frequency as conky is refreshed.
In your case thats 1 second.
Youll hog your CPU load for nothing.

You could better use execi or texeci which allow you to set the update variable.
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Conky and other stuff
« Reply #12 on: February 24, 2013, 08:53:51 pm »
So are we opposed to having this be kind of a help thread too?

Because I noticed that my conky isn't quite as fast I want it to be. For example the clock isn't exactly real time. It only updates the time every ten to fifteen minutes. Also, when I edit it, it takes quite awhile for the changes to take effect. There's obviously something wrong with the settings but I can't find it. My other conky worked fine.

Code: [Select]
alignment top_left
border_width 50
default_color bbbbbb
double_buffer yes
draw_borders no
draw_outline no
draw_shades no
gap_x 3
gap_y 3
maximum_width 3000
no_buffers yes
override_utf8_locale yes
own_window_colour eeeeee
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
own_window_transparent yes
own_window_type override
own_window yes
stippled_borders 0
update_interval 1
uppercase no
#use_spacer yes
use_xft yes
xftfont Nu:size=7

TEXT
${image ~/.icons/archlinux/icons/archlinuxiconcrystal128.png -p 12,0 -s 64x64}
${voffset -10}${offset 190}$alignr| ${color 99cccc}Kernel: $color${kernel}$color ${color eeeeee} ${font}${color 99cccc}Hostname: $color${nodename} ${color eeeeee}| ${color 99cccc}External IP: $color${execi 10 wget -O - http://ip.tupeux.com | tail} ${color eeeeee} ${color 99cccc}wlan0: $color${addr wlan0} ${color eeeeee} ${color 99cccc}Mac: $color${exec ifconfig wlan0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'} ${color eeeeee}|${color 99cccc} RAM $color${memperc}%${offset -75}${color eeeeee}${offset 55}${color ffffff}        | ${color 99cccc}Home ${color 0ABFFF}${fs_bar 6,75 /home}${offset -75}${voffset -1}${color eeeeee}${offset 55}${color ffffff}          ${voffset 1}${color 99cccc}Root ${color 0ABFFF}${fs_bar 6,75 /}${offset -75}${voffset -1}${color eeeeee}${offset 55} ${color ffffff}       | ${color 99cccc}Battery: $color${battery_percent}%${color eeeeee} | ${color 99cccc}${time %I:%M %p - %b %e} ${color eeeeee}|# ${color 99cccc}Temp: $color${acpitemp} ${color eeeeee}|
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Conky and other stuff
« Reply #13 on: February 24, 2013, 10:56:39 pm »
So are we opposed to having this be kind of a help thread too?

Because I noticed that my conky isn't quite as fast I want it to be. For example the clock isn't exactly real time. It only updates the time every ten to fifteen minutes. Also, when I edit it, it takes quite awhile for the changes to take effect. There's obviously something wrong with the settings but I can't find it. My other conky worked fine.

Code: [Select]
alignment top_left
border_width 50
default_color bbbbbb
double_buffer yes
draw_borders no
draw_outline no
draw_shades no
gap_x 3
gap_y 3
maximum_width 3000
no_buffers yes
override_utf8_locale yes
own_window_colour eeeeee
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
own_window_transparent yes
own_window_type override
own_window yes
stippled_borders 0
update_interval 1
uppercase no
#use_spacer yes
use_xft yes
xftfont Nu:size=7

TEXT
${image ~/.icons/archlinux/icons/archlinuxiconcrystal128.png -p 12,0 -s 64x64}
${voffset -10}${offset 190}$alignr| ${color 99cccc}Kernel: $color${kernel}$color ${color eeeeee} ${font}${color 99cccc}Hostname: $color${nodename} ${color eeeeee}| ${color 99cccc}External IP: $color${execi 10 wget -O - http://ip.tupeux.com | tail} ${color eeeeee} ${color 99cccc}wlan0: $color${addr wlan0} ${color eeeeee} ${color 99cccc}Mac: $color${exec ifconfig wlan0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'} ${color eeeeee}|${color 99cccc} RAM $color${memperc}%${offset -75}${color eeeeee}${offset 55}${color ffffff}        | ${color 99cccc}Home ${color 0ABFFF}${fs_bar 6,75 /home}${offset -75}${voffset -1}${color eeeeee}${offset 55}${color ffffff}          ${voffset 1}${color 99cccc}Root ${color 0ABFFF}${fs_bar 6,75 /}${offset -75}${voffset -1}${color eeeeee}${offset 55} ${color ffffff}       | ${color 99cccc}Battery: $color${battery_percent}%${color eeeeee} | ${color 99cccc}${time %I:%M %p - %b %e} ${color eeeeee}|# ${color 99cccc}Temp: $color${acpitemp} ${color eeeeee}|

Maybe get the time from the system? Could use python:
Code: (python) [Select]
import time
print time.strftime("%I:%M:%S", time.gmtime())

Or use bash:
Code: (bash) [Select]
date +"%I:%M:%S"
>>>import this
-----------------------------

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Conky and other stuff
« Reply #14 on: March 01, 2013, 01:50:23 am »
I'm not sure that's my problem. I mean, it outputs the time in the proper format and everything just like this:

${time %I:%M %p - %b %e}. But it doesn't change every minute. It changes every fifteen minutes or so. I think there is another problem here because half the time when I make a change to conky, instead of immediately refreshing to show the changes sometimes it takes a few minutes to make the change. Sometimes it doesn't at all and I have to restart. I would just killall conky and then conky & but for some reason when I do that it refreshing the wrong conky(as I have two)
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python