Awesome Window Manager: Part 6
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 the "picom" compositor.
Install picom
To install picom from the AUR, for use with the Awesome window manager on Manjaro, enter this in a terminal:
1yay -S picom
The Picom Config
If you've used an older version of picom before, remove or rename the old ~/.config/picom.conf
1cd ~/.config/picom/
2mv picom.conf old-picom,conf
If this is the first time you've used picom - you need to make a configuration file for picom to use.
Let's create the picom config file and then edit it in nano,
1cd ~/.config/
2mkdir picom/
3cd picom/
4touch picom.conf
5vim picom.conf
Rather than spam this page with the full picom config file (it's quite big), instead, I've added a link to the default example picom.sample.conf
, so you can copy and paste to your own ~/.config/picom/picom.conf
and edit to your liking.
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.
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.
1# ~/.scripts/awesome_autostart.sh
2# Start picom when AwesomeWM starts
3
4run picom
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:
1man slop
Add the blur fix for "slop" below to your ~/.config/picom/picom.conf
file.
1# ~/.config/picom/picom.conf
2# Exclude conditions for background blur.
3
4blur-background-exclude = [
5 "window_type = 'dock'",
6 "window_type = 'desktop'",
7 "name = 'slop'", # ADD THIS LINE HERE
8 "_GTK_FRAME_EXTENTS@:c"
9];
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:
1####################
2# Compositor
3####################
4
5super + shift + p
6 ~/.scripts/toggle_picom.sh
save the changes, then create the toggle_picom.sh
script:
1#!/bin/env bash
2# Enable/disable compositor
3# Save to ~/.scripts/toggle_picom.sh
4
5SERVICE="picom"
6if pgrep -x "$SERVICE" >/dev/null
7then
8 kill $(pgrep -x "$SERVICE")
9else
10 picom --experimental-backend &
11fi
Then save that to ~/.scripts/toggle_picom.sh
, and ensure to enable execute permissions for the script:
1chmod +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. 👍