~mil/sxmo-tickets#236: 
Enable compositor (new FR)

I have been playing with picom today, and it looks cool when enabled. It adds some cool 3D effects (shadows, fade in/out). So I will share my config files, needed to enable picom. Of course, picom needs to be installed first :)

picom.conf (located in .config dir)


# Shadow
shadow = true;
detect-rounded-corners = true;
shadow-radius = 5;
shadow-offset-x = 1;
shadow-offset-y = 1;
shadow-opacity = .3;
shadow-ignore-shaped = false;
shadow-exclude = [
	"name = 'Notification'", 
# workaround for conky until it provides window properties:
	"override_redirect = 1 && !WM_CLASS@:s",
#    "class_g ?= 'Dmenu'",
#	"class_g ?= 'Dunst'",
# disable shadows for hidden windows:
	"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
# disables shadows on sticky windows:
#	"_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'",
#	Disable for Firefox elements
	"class_g = 'firefox' && argb",
	"_GTK_FRAME_EXTENTS@:c"
];

# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;

#menu-opacity = 0.95;
inactive-opacity = 0.93;
active-opacity = 1;
#alpha-step = 0.01;
#inactive-dim = 0.0;
#blur-background = false;
#blur-kern = "3x3box";

fading = true;
fade-delta = 1;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-exclude = [ ];

#backend = "xrender";
backend = "glx";
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
mark-wmwin-focused = true;
use-ewmh-active-win = true;
mark-ovredir-focused = true;
detect-client-opacity = true;
unredir-if-possible = true;
refresh-rate = 0;
vsync = true;
dbe = false;
focus-exclude = [
  "class_g = 'Cairo-clock'",
#  "class_i = 'dmenu'",
  "class_i = 'dwm'"
];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
use-damage = true;

#opacity-rule = [ 
#"99:name *?= 'Call'", 
#"99:class_g = 'Chromium'", 
#"99:name *?= 'Conky'", 
#"99:class_g = 'Darktable'", 
#"50:class_g = 'Dmenu'", 
#"99:name *?= 'Event'", 
#"99:class_g = 'Firefox'", 
#"99:class_g = 'GIMP'", 
#"99:name *?= 'Image'",
#"99:class_g = 'Lazpaint'", 
#"99:class_g = 'Midori'", 
#"99:name *?= 'Minitube'", 
#"99:class_g = 'Mousepad'",
#"99:name *?= 'MuseScore'", 
#"90:name *?= 'Page Info'", 
#"99:name *?= 'Pale Moon'", 
#"90:name *?= 'Panel'", 
#"99:class_g = 'Pinta'", 
#"90:name *?= 'Restart'", 
#"99:name *?= 'sudo'", 
#"99:name *?= 'Screenshot'", 
#"99:class_g = 'Viewnior'", 
#"99:class_g = 'VirtualBox'", 
#"99:name *?= 'VLC'", 
#"99:name *?= 'Write'", 
#"93:class_g = 'URxvt' && !_NET_WM_STATE@:32a", 
#"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", 
#"96:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'" 
#];
#opacity-rule = [
#    "99:I3_FLOATING_WINDOW@:c && focused",
#    "60:I3_FLOATING_WINDOW@:c && !focused"
#];

wintypes : 
{
  tooltip = 
  {
    fade = true;
    shadow = false;
    opacity = 0.85;
    focus = true;
  };
  desktop = 
  {
    fade = true;
    shadow = false;
    opacity = 1;
    focus = true;
  };
  dock = 
  {
    fade = true;
    shadow = false;
    opacity = 1;
    focus = true;
  };
  notification = 
  {
    fade = true;
    shadow = true;
    opacity = 0.7;
    focus = true;
  };
};

conky.conf needs to be updated (the important part is own_window*):


conky.config = {
    alignment = 'middle_middle',
    background = false,
    border_width = 0.5,
    cpu_avg_samples = 4,
    default_color = 'white',
    default_outline_color = 'grey',
    default_shade_color = 'black',
    draw_borders = true,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = true,
    use_xft = true,
    font = 'Bitstream Vera Sans:size=8',
    gap_x = 5,
    gap_y = 50,
    minimum_height = 5,
    minimum_width = 5,
    net_avg_samples = 2,
    double_buffer = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window = false,
    stippled_borders = 1,
    cpu_avg_samples = 2,
    update_interval = 3,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false,
    own_window = true,
    own_window_type = 'override',
    own_window_transparent = true
}

conky.text = [[
  ${font Latin Modern Mono Caps:size=60}${alignc}${exec date +"%H:%M"}$font
  ${font Latin Modern Mono Caps:size=10}${alignc}${exec date +"%d %b %Y"}$font
  ${voffset 20}${goto 40}${font Bitstream Vera Sans:bold:size=8}CPU$alignr$cpu%$font
  ${voffset 5}${goto 40}${top name 1}$alignr${top cpu 1}%
  ${goto 40}${top name 2}$alignr${top cpu 2}%
  ${goto 40}${top name 3}$alignr${top cpu 3}%
  ${goto 40}${top name 4}$alignr${top cpu 4}%
  ${voffset 10}${goto 40}${font Bitstream Vera Sans:bold:size=8}RAM$alignr$mem$font
  ${goto 40}${voffset 5}${top_mem name 1}$alignr${top_mem mem_res 1}
  ${goto 40}${top_mem name 2}$alignr${top_mem mem_res 2}
  ${goto 40}${top_mem name 3}$alignr${top_mem mem_res 3}
  ${goto 40}${top_mem name 4}$alignr${top_mem mem_res 4}
  ${voffset 20}${goto 40}${font Bitstream Vera Sans:bold:size=8}CPUtemp$alignr${hwmon 2 temp 1}°C$font
  ${goto 40}GPU0temp$alignr$color${hwmon 3 temp 1}°C
  ${goto 40}GPU1temp$alignr$color${hwmon 4 temp 1}°C
  ${voffset 20}${goto 40}${font Bitstream Vera Sans:bold:size=8}Battery$alignr${exec cat /sys/class/power_supply/axp20x-battery/capacity}%$font
]]

Most of the upper config is combination of sxmo default config and manjaro i3 linux config.

And this needs to be added to xinit hook:


# Start compositor picom
picom -b

# Set a pretty wallpaper
feh --bg-fill /usr/share/sxmo/background.jpg

# Start Conky
conky -c $HOME/.config/sxmo/conky24h.conf -d

After restart 3d compositing should be working, and you will have shadows below your dmenus, giving cool 3d efect (you can play with settings and have stronger shadows if you want). The only drawback which I found is that Firefox scrolling is a little les responsive, but still completely usable.

Status
REPORTED
Submitter
~dinkocar
Assigned to
No-one
Submitted
5 months ago
Updated
4 months ago
Labels
feature

~trbl 5 months ago

Please don't make this default. Picom is suuuper slow as it runs on the CPU.

~justinesmithies 5 months ago

Don't make picom default as I found it seriously slowed down things like megapixels to the point of being unusable.

~stacyharper 5 months ago

I think most of sxmo users dont care about (and dont want) some cool 3D effects (shadows, fade in/out). Picom will probably never be a default but it still is nice to share your setup

~anjan 4 months ago

I think we should ideally put this information in the docs rather than having it hidden in the issue tracker. ~dinkocar , can you send a patch to the mailing list with a patch?

~anjan 4 months ago

I think we should ideally put this information in the docs rather than having it hidden in the issue tracker. ~dinkocar , can you please send a patch to the mailing list with a patch?

Register here or Log in to comment, or comment via email.