aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Wilken2022-10-22 14:48:07 +0200
committerTimo Wilken2022-10-22 14:48:07 +0200
commitcdc8fcec2746621f4f87c21e0d71e806e2bcedf0 (patch)
tree7de5522afb5d15e0b492a0352c550191e7110d3a
parentb92b07f74745c3c01dda15cdcd1fc8eae51eef30 (diff)
Run picom compositor
-rw-r--r--home-configuration.scm36
-rw-r--r--picom.conf304
2 files changed, 327 insertions, 13 deletions
diff --git a/home-configuration.scm b/home-configuration.scm
index 124dbf0f..21758522 100644
--- a/home-configuration.scm
+++ b/home-configuration.scm
@@ -105,26 +105,25 @@ replacement spec (to which `regexp-substitute/global' is applied)."
'(;; CLI tools
"adb" "dos2unix" "file" "fzf" "git" "imagemagick" "jq"
"lesspipe" "nvme-cli" "openssh" "powertop" "pulsemixer" "pv"
- "rsync" "smartmontools" "source-highlight" "tk" "tlp" "tmux"
- "tree" "xxd" "zip" "unzip"
+ "rsync" "smartmontools" "source-highlight" "tk" "tmux" "tree"
+ "xxd" "zip" "unzip"
;; Programming languages
"python" "sbcl"
;; Emacs
"emacs" "emacs-use-package" "emacs-editorconfig" ; TODO: set up EditorConfig
;; Shell
"zsh" "zsh-autosuggestions" "zsh-syntax-highlighting" "zsh-autopair"
+ ;; GUI programs
;; i3 and Xorg. i3 itself must be installed system-wide for gdm to pick it up.
;; acpilight is a drop-in xbacklight replacement, as xbacklight doesn't work on my system.
- "acpilight" "i3status" "dunst" "rofi" "hsetroot"
- "xdot" "xclip" "xdotool" "xdpyinfo" "xev" "xfd" "xfontsel"
- "xinput" "xkill" "xprop" "xrandr" "xrdb" "xsel" "xset"
- "xwininfo"
- ;; GUI programs
- "arandr" "gnupg" "pinentry-rofi" "gimp" "inkscape" "icecat"
- "kitty" "mpv" "nheko" "neomutt" "password-store"
- "signal-desktop" "simple-scan" "zoom"
+ "acpilight" "arandr" "dunst" "gnupg" "pinentry-rofi" "gimp"
+ "hsetroot" "i3status" "inkscape" "icecat" "kitty"
+ "mpv" "nheko" "neomutt" "password-store" "picom" "rofi"
+ "signal-desktop" "simple-scan" "xdg-utils" "xdot" "xclip"
+ "xdotool" "xdpyinfo" "xev" "xfd" "xfontsel" "xinput" "xkill"
+ "xprop" "xrandr" "xrdb" "xsel" "xset" "xwininfo" "zoom"
"zathura" "zathura-ps" "zathura-pdf-poppler"
- ;; kitty uses this, but does not pull it in by default.
+ ;; kitty uses startup-notifications, but doesn't pull it.
;; TODO: kitty still doesn't find libstartup-notification-1.so,
;; even though it's installed by this package. Maybe kitty needs
;; its rpath adjusted?
@@ -172,7 +171,7 @@ replacement spec (to which `regexp-substitute/global' is applied)."
;; User shepherd services.
(simple-service
- 'user-services home-shepherd-service-type
+ 'terminal-services home-shepherd-service-type
(list
(shepherd-service
(documentation "Emacs server; connect using emacsclient.")
@@ -187,7 +186,11 @@ replacement spec (to which `regexp-substitute/global' is applied)."
(invoke #$(package-binary "gnupg" "gpg-agent")
"--daemon" "--no-detach")))
(stop #~(lambda _
- (invoke "gpg-connect-agent" "killagent" "/bye"))))
+ (invoke "gpg-connect-agent" "killagent" "/bye"))))))
+
+ (simple-service
+ 'gui-services home-shepherd-service-type
+ (list
(shepherd-service
(documentation "Dunst notification daemon; displays desktop notifications.")
(provision '(dunst))
@@ -195,6 +198,12 @@ replacement spec (to which `regexp-substitute/global' is applied)."
(list #$(package-binary "dunst"))))
(stop #~(make-kill-destructor)))
(shepherd-service
+ (documentation "Picom compositor; enables transparent windows in X.")
+ (provision '(picom))
+ (start #~(make-forkexec-constructor
+ (list #$(package-binary "picom") "--experimental-backends")))
+ (stop #~(make-kill-destructor)))
+ (shepherd-service
(documentation "Source Xresources on login.")
(provision '(xrdb))
(one-shot? #t)
@@ -246,6 +255,7 @@ replacement spec (to which `regexp-substitute/global' is applied)."
catppuccin-theme-variant ".conf")
"kitty-theme.conf")))
("lesskey" ,(local-file "lesskey"))
+ ("picom/picom.conf" ,(local-file "picom.conf"))
("ranger/rc.conf" ,(local-file "ranger.conf"))
("rofi/config.rasi"
,(text-file/substitutions "rofi-config.rasi"
diff --git a/picom.conf b/picom.conf
new file mode 100644
index 00000000..a7d86571
--- /dev/null
+++ b/picom.conf
@@ -0,0 +1,304 @@
+#
+# ~/.config/picom.conf -- Picom compositor configuration
+#
+
+## Backend
+
+# Backend to use: "xrender" or "glx".
+# GLX backend is typically much faster but depends on a sane driver.
+backend: "glx";
+
+## GLX backend
+
+glx-no-stencil: true;
+
+# GLX backend: Copy unmodified regions from front buffer instead of redrawing
+# them all. My tests with nvidia-drivers show a 10% decrease in performance
+# when the whole screen is modified, but a 20% increase when only 1/4 is. My
+# tests on nouveau show terrible slowdown.
+glx-copy-from-front: false;
+
+# GLX backend: Avoid rebinding pixmap on window damage. Probably could improve
+# performance on rapid window content changes, but is known to break things on
+# some drivers (LLVMpipe). Recommended if it works.
+glx-no-rebind-pixmap: true;
+
+## Shadows
+
+# Enabled client-side shadows on windows.
+shadow: false;
+# The blur radius for shadows. (default 12)
+shadow-radius: 25;
+# The left offset for shadows. (default -15)
+shadow-offset-x: -25;
+# The top offset for shadows. (default -15)
+shadow-offset-y: -25;
+# The translucency for shadows. (default .75)
+shadow-opacity: .3;
+
+# Set if you want different colour shadows
+shadow-red: 0.03;
+shadow-green: 0.03;
+shadow-blue: 0.04;
+
+# The shadow exclude options are helpful if you have shadows enabled. Due to
+# the way compton draws its shadows, certain applications will have visual
+# glitches (most applications are fine, only apps that do weird things with
+# xshapes or argb are affected). This list includes all the affected apps I
+# found in my testing. The "! name~=''" part excludes shadows on any "Unknown"
+# windows, this prevents a visual glitch with the XFWM alt tab switcher.
+# From "man picom", Format of Conditions: WM_CLASS = class_i, class_g
+shadow-exclude: [
+# "! name~=''",
+# "name = 'Notification'",
+# "name = 'Plank'",
+# "name = 'Docky'",
+# "name = 'Kupfer'",
+# "name = 'xfce4-notifyd'",
+# "name *= 'VLC'",
+ "name *= 'mpv'",
+ "class_g = 'ffplay'",
+# "name *= 'compton'",
+# "name *= 'Chromium'",
+# "name *= 'Chrome'",
+ "class_g ?= 'Firefox'",
+# "class_g = 'Conky'",
+ "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'",
+ "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
+ "_GTK_FRAME_EXTENTS@:c",
+ "class_g ?= 'ulauncher'",
+ "class_g ?= 'tray'",
+ "class_g ?= 'i3-frame'",
+# "class_g ?= 'Notify-osd'",
+# "class_g ?= 'Cairo-dock'",
+# "class_g ?= 'Xfce4-notifyd'",
+# "class_g ?= 'Xfce4-power-manager'"
+ "class_g ?= 'Xfce4-screenshooter'",
+ "class_g ?= 'peek'"
+];
+
+# Avoid drawing shadow on all shaped windows (c.f. --detect-rounded-corners)
+shadow-ignore-shaped: false;
+
+## Opacity
+
+inactive-opacity: 1;
+active-opacity: 1;
+frame-opacity: 1;
+inactive-opacity-override: false;
+
+# Dim inactive windows. (0.0 - 1.0)
+#inactive-dim = 0.1;
+# Do not let dimness adjust based on window opacity.
+#inactive-dim-fixed = true;
+
+# Blur background of transparent windows. Bad performance with X Render
+# backend. GLX backend is preferred.
+blur-method: "dual_kawase";
+blur-strength: 7;
+#blur-method: "kernel";
+# generate kernel using compton-convgen.py --dump-compton gaussian 15 -f sigma=15
+#blur-kernel: "...";
+blur-background: true;
+# Blur background of opaque windows with transparent frames as well.
+blur-background-frame: true;
+# Do not let blur radius adjust based on window opacity.
+blur-background-fixed: true;
+blur-background-exclude: [
+ #"window_type = 'dock'",
+ #"window_type = 'desktop'",
+ "window_type = 'dnd'",
+ "window_type = 'dropdown_menu'",
+ "window_type = 'popup_menu'",
+ #"class_g = 'Rofi'"
+ "class_g ?= 'Xfce4-screenshooter'",
+ # for xfce4-screenshooter triggered from its xfce4-panel button
+ "class_g ?= 'Wrapper-2.0'",
+ "class_g ?= 'peek'"
+];
+
+## Rounded corners
+#corner-radius: 16;
+#rounded-corners-exclude: [
+# "window_type = 'dock'",
+# "window_type = 'desktop'",
+# "class_g ?= 'plasmashell'",
+# "class_g ?= 'krunner'",
+# "class_g ?= 'i3-frame'"
+#];
+
+## Fading
+
+# Fade windows during opacity changes.
+fading: true;
+# The time between steps in a fade in milliseconds. (default 10).
+fade-delta: 5;
+# Opacity change between steps while fading in. (default 0.028).
+fade-in-step: 0.03;
+# Opacity change between steps while fading out. (default 0.03).
+fade-out-step: 0.03;
+# Fade windows in/out when opening/closing
+no-fading-openclose: false;
+
+# Specify a list of conditions of windows that should not be faded.
+fade-exclude: [];
+
+## Other
+
+# Try to detect WM windows and mark them as active.
+mark-wmwin-focused: true;
+# Mark all non-WM but override-redirect windows active (e.g. menus).
+mark-ovredir-focused: true;
+# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead
+# of using FocusIn/Out events. Usually more reliable but depends on a
+# EWMH-compliant WM.
+use-ewmh-active-win: true;
+# Detect rounded corners and treat them as rectangular when
+# --shadow-ignore-shaped is on.
+detect-rounded-corners: true;
+
+# Detect _NET_WM_OPACITY on client windows, useful for window managers not
+# passing _NET_WM_OPACITY of client windows to frame windows. This prevents
+# opacity being ignored for some apps. For example without this enabled my
+# xfce4-notifyd is 100% opacity no matter what.
+detect-client-opacity: true;
+
+# Toggle VSync. See also: --vsync drm/opengl/opengl-oml.
+vsync: true;
+
+# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate
+# tearing. Reported to have no effect, though.
+dbe: true;
+
+# Unredirect all windows if a full-screen opaque window is detected, to
+# maximize performance for full-screen windows, like games. Known to cause
+# flickering when redirecting/unredirecting windows. paint-on-overlay may make
+# the flickering less obvious.
+unredir-if-possible: true;
+
+# Specify a list of conditions of windows that should always be considered focused.
+focus-exclude: [];
+
+# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group
+# focused at the same time.
+detect-transient: true;
+# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group
+# focused at the same time. WM_TRANSIENT_FOR has higher priority if
+# --detect-transient is enabled, too.
+detect-client-leader: true;
+
+opacity-rule: [
+ "100:name *?= 'Call'",
+ "100:name *?= 'Conky'",
+ "100:class_g = 'Darktable'",
+ "50:class_g = 'Dmenu'",
+ "100:name *?= 'Event'",
+ "100:class_g = 'Firefox'",
+ "100:class_g = 'GIMP'",
+ "100:name *?= 'Image'",
+ "100:class_g = 'Lazpaint'",
+ "100:class_g = 'Midori'",
+ "100:name *?= 'Minitube'",
+ "83:class_g = 'Mousepad'",
+ "100:name *?= 'MuseScore'",
+ "90:name *?= 'Page Info'",
+ "100:name *?= 'Pale Moon'",
+ "100:name *?= 'Screenshot'",
+ "100:class_g = 'Viewnior'",
+ "100:name *?= 'VirtualBox'",
+ "100:name *?= 'VLC'",
+ "100:class_g = 'mpv'",
+ "100:name *?= 'Write'",
+ "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
+ "100:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'"
+];
+
+## Window type settings
+
+wintypes: {
+ # WINDOW_TYPE is one of the 15 window types defined in the EWMH standard:
+ # https://specifications.freedesktop.org/wm-spec/latest/ar01s05.html#idm45550357242464
+ # fade: Fade the particular type of windows.
+ # shadow: Give those windows shadow
+ # opacity: Default opacity for the type of windows.
+ # focus: Controls whether the window of this type is to be always considered
+ # focused. (By default, all window types except "normal" and "dialog" has
+ # this on.)
+ # full-shadow: Controls whether shadow is drawn under the parts of the
+ # window that you normally won't be able to see. Useful when the window
+ # has parts of it transparent, and you want shadows in those areas.
+ # redir-ignore: Controls whether this type of windows should cause screen to
+ # become redirected again after been unredirected. If you have
+ # --unredir-if-possible set, and doesn't want certain window to cause
+ # unnecessary screen redirection, you can set this to true.
+
+ normal: {
+ opacity: 1;
+ };
+
+ dialog: {
+ opacity: 1;
+ };
+
+ # On-screen notification
+ notify: {
+ opacity: 1;
+ };
+
+ tooltip: {
+ opacity: .85;
+ };
+
+ # Desktop window with icons etc.
+ desktop: {
+ };
+
+ # Persistent dock, usually on top of all other windows
+ dock: {
+ opacity: 1;
+ };
+
+ # Window representing something being dragged
+ dnd: {
+ opacity: .85;
+ shadow: true;
+ full-shadow: true;
+ };
+
+ # Menu "torn off" from another window
+ menu: {
+ opacity: 1;
+ };
+
+ # Toolbar "torn off" from another window
+ toolbar: {
+ opacity: 1;
+ };
+
+ # A menu from a right click
+ popup_menu: {
+ opacity: 1;
+ };
+
+ # A menu from a menu bar
+ dropdown_menu: {
+ opacity: 1;
+ };
+
+ # The pop-up/drop-down from a combo box
+ combo: {
+ opacity: 1;
+ };
+
+ # A starting application's splash screen
+ splash: {
+ opacity: 1;
+ };
+
+ # A small persistent utility window, such as a palette or toolbox
+ utility: {
+ };
+
+ unknown: {
+ };
+};