LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Blogs > Tux and Me
User Name
Password

Notices

Rating: 2 votes, 5.00 average.

Lubuntu conky and compton

Posted 07-20-2014 at 10:13 PM by t1nm@n
Updated 07-21-2014 at 01:00 AM by t1nm@n (To add category)

Getting a good desktop with effects like shadows and stuff is the challenge here. After some fiddling around (conky doesnot play well with compton), I was able to get a working setup.

1. Installing compton
Code:
sudo add-apt-repository ppa:richardgv/compton
sudo apt-get update && sudo apt-get install compton
2. Open /home/<user>/.config/compton.conf, create one if it doesnot exist. Put these in
Code:
# Shadow
shadow = true;			# Enabled client-side shadows on windows.
no-dock-shadow = true;		# Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true;		# Don't draw shadows on DND windows.
#clear-shadow = true;		# Zero the part of the shadow's mask behind the window (experimental).
#shadow-radius = 7;		# The blur radius for shadows. (default 12)
#shadow-offset-x = -7;		# The left offset for shadows. (default -15)
#shadow-offset-y = -7;		# The top offset for shadows. (default -15)
shadow-opacity = 0.4;		# The translucency for shadows. (default .75)
# shadow-red = 0.0;		# Red color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-green = 0.0;		# Green color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-blue = 0.0;		# Blue color value of shadow. (0.0 - 1.0, defaults to 0)
shadow-exclude = [ "n:e:Notification" ];	# Exclude conditions for shadows.
# shadow-exclude = "n:e:Notification";
# shadow-ignore-shaped = true;

# Opacity
menu-opacity = 1.0;			# The opacity for menus. (default 1.0)
#inactive-opacity = 0.9;			# Opacity of inactive windows. (0.1 - 1.0)
#frame-opacity = 0.8;			# Opacity of window titlebars and borders. (0.1 - 1.0)
inactive-opacity-override = false;	# Inactive opacity set by 'inactive-opacity' overrides value of _NET_WM_OPACITY.
alpha-step = 0.06;

# Fading
fading = false;			# Fade windows during opacity changes.
# fade-delta = 30;		# The time between steps in a fade in milliseconds. (default 10).
fade-in-step = 0.03;		# Opacity change between steps while fading in. (default 0.028).
fade-out-step = 0.03;		# Opacity change between steps while fading out. (default 0.03).
#no-fading-openclose = true;	# Fade windows in/out when opening/closing.

# Other
#inactive-dim = 0.5;		# Dim inactive windows. (0.0 - 1.0, defaults to 0).
mark-wmwin-focused = true;	# Try to detect WM windows and mark them as active.
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
dbe = false;
paint-on-overlay = false;
sw-opti = false;

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = false; opacity = 0.85; };
};
3. Installing conky
Code:
sudo apt-get install conky-all
This is the best thing since sliced bread. Get it and install it. There is a README in the zip that guides you through the install process.

4. My conkyrc
Code:
######################
# - Conky settings - #
######################

background yes
use_xft yes
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
#own_window_type desktop
own_window_argb_visual yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
alignment top_right
gap_x 12
gap_y 56
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
xftfont Droid Sans:size=8
gap_x 25
gap_y 25
minimum_size 200 110
maximum_width 200

default_color D6D6D6

color0 F2F2F2
color1 7296BB
color2 FFFFFF
color3 7296BB

# -- Lua Load -- #
lua_load ~/.draw_bg.lua
lua_draw_hook_pre draw_bg

TEXT

${color0}${font ConkyColorsLogos:size=16}u${font}${color}
${goto 32}${voffset -23}Kernel: ${alignr}${color2}${kernel}${color}
${goto 32}Uptime: ${alignr}${color2}${uptime}${color}
# |--CPU
${voffset 4}${color0}${font ConkyColors:size=16}c${font}${offset -20}${voffset 6}${cpubar cpu0 4,17}${color}${voffset -16}${goto 32}CPU1: ${font Droid Sans:style=Bold:size=8}${color1}${cpu cpu1}%${color}${font} ${alignr}${color2}${cpugraph cpu1 8,60 7296BB 7296BB}${color}
${goto 32}CPU2: ${font Droid Sans:style=Bold:size=8}${color1}${cpu cpu2}%${color}${font} ${alignr}${color2}${cpugraph cpu2 8,60 7296BB 7296BB}${color}
# |--MEM
${voffset 2}${color0}${font ConkyColors:size=15}g${font}${color}${goto 32}${voffset -7}RAM: ${font Droid Sans:style=Bold:size=8}${color1}$memperc%${color}${font}
${offset 1}${color0}${membar 4,17}${color}${goto 32}F: ${font Droid Sans:style=Bold:size=8}${color2}${memeasyfree}${color}${font} U: ${font Droid Sans:style=Bold:size=8}${color2}${mem}${color}${font}
The accompanying file for conky ~/.draw_bg.lua
Code:
--[[
Background by londonali1010 (2009)

This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish.

To call this script in Conky, use (assuming you have saved this script to ~/scripts/):
	lua_load ~/.scripts/draw_bg.lua
	lua_draw_hook_pre draw_bg

Changelog:
+ v1.0 -- Original release (07.10.2009)
]]

-- Change these settings to affect your background.
-- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.

corner_r=20

-- Set the colour and transparency (alpha) of your background.

bg_colour=0x000000
bg_alpha=0.40

require 'cairo'
function rgb_to_r_g_b(colour,alpha)
	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function conky_draw_bg()
	if conky_window==nil then return end
	local w=conky_window.width
	local h=conky_window.height
	local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
	cr=cairo_create(cs)
	
	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-corner_r)
	cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
	cairo_line_to(cr,corner_r,h)
	cairo_curve_to(cr,0,h,0,h,0,h-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,rgb_to_r_g_b(bg_colour,bg_alpha))
	cairo_fill(cr)
end
In lubuntu goto Menu> Preferences> Default Applications for LXsession> Autostart
In the Manual autostarted applications add
Code:
compton -b
and
Code:
conky -q
Restart your session and have fun.
Posted in Lubuntu
Views 490 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration