Awesome Window Manager: Part 6

Adding a compositor.

Awesome Window Manager: Part 6
Share on:

Adding a Compositor

Those of you interested in ricing your window manager will no doubt have seen all the fancy looking desktop on r/unixporn which have a transparent/blurring effect behind app windows. This can really add a modern look to your desktop. This can be achieved by using a compositing manager. The Awesome window manager doesn’t have one built-in, so you’ll have to add one if you want window effects, like shadows, transparency and blurring. I’ve installed a fork of the “picom compositor” called “picom-jonaburg-git”.

Install picom

To install picom from the AUR, for use with the Awesome window manager on Manjaro, enter this in a terminal:

yay -S picom-tryone-git

The Picom Config

If you’ve used an older version of picom before, remove or rename the old ~/.config/picom.conf

Next, we need to make a new configuration file for picom-jonaburg-git to use.

Let’s create the picom config file and then edit it in nano,

cd ~/.config/
mkdir picom/
cd picom/ 
touch picom.conf 
nano picom.conf

Rather than spam this page with my full picom config file (it’s quite big), instead, I’ve added links to the default example picom.conf and my own custom edited one so you can copy and paste to your own ~/.config/picom/picom.conf

Features:

  • Window Transparency: I’ve enabled a slight window transparency for my most commonly used apps in my picom config. You can remove or add your own by tweaking the variables under the Transparency / Opacity Rule sections.
  • Window Blurring: I like to have a blur effect under my app windows which allows me to see my wallpaper. It doesn’t interfere with text visibility that much, since the wallpaper images will be slightly blurred, which allows the window you are working in to still be usable.
  • Window Animations: I’ve also enabled animated movement of windows. You can tweak this under the Animations section.
  • Rounded Corners: This setting makes window borders have a slight rounded curve, rather than the normal square shape.

Using Picom

In order to use picom, you must first run it when your window manager starts. Since we already have a autostart.sh which we created in the previous guide, we can use this to run picom when AwesomeWM starts.

Edit your ~/.scripts/awesome_autostart.sh and add the following line.

# ~/.scripts/awesome_autostart.sh
# Start picom when AwesomeWM starts

run picom --experimental-backend &

Fix Screen Tearing On NVIDIA

If you notice any screen tearing while playing videos and gaming using an NVIDIA gfx card - I managed to find a fix for this, and I have detailed the process in this guide.


Fix Blurred Screenshots

One thing to note, is that if you use the “picom-tryone-git” compositor to add blurring to your windows - you need to exclude slop in the blur-background-exlude = [] section in your ~/.config/picom/picom.conf file, otherwise dragging a section of your screen and taking a snapshot may include the blurring effect in the output image.

What is “slop”?

Open a terminal and enter:

man slop

Add the blur fix for “slop” below to your ~/.config/picom/picom.conf file.

# ~/.config/picom/picom.conf
# Exclude conditions for background blur.

blur-background-exclude = [
  "window_type = 'dock'",
  "window_type = 'desktop'",
  "name = 'slop'", # ADD THIS LINE HERE
  "_GTK_FRAME_EXTENTS@:c"
];

Enable/Disable Picom

If you need to manually enable or disable picom - you can do that by adding a keybind to your ~/.config/sxhkd/sxhkdrc config:

####################
# Compositor
####################

super + shift + p
    ~/.scripts/toggle_picom.sh

save the changes, then create the toggle_picom.sh script:

#!/bin/env bash
# Enable/disable compositor
# Save to ~/.scripts/toggle_picom.sh

SERVICE="picom"
if pgrep -x "$SERVICE" >/dev/null
then
    kill $(pgrep -x "$SERVICE")
else
    picom --experimental-backend &
fi

Then save that to ~/.scripts/toggle_picom.sh, and ensure to enable execute permissions for the script:

chmod +x ~/.scripts/toggle_picom.sh

Then reset sxhkd with Super + Shift + x

The next time you start Awesome Window Manager you should have picom working, and also the ability to toggle it on/off with a hotkey.

That’s it for this guide. I hope you’re enjoying tinkering with Awesome Window Manager. You can see how I’ve set up my Awesome window manager configuration in all its glory over at my dotfiles repository on GitLab. If you like my content, why not consider buying me a coffee. It really helps motivate me to write more guides like this. And of course, thank you. 👍