Skip to content

Commit

Permalink
fix(picom): added activation condition for gaming-picom-guard service
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Jul 20, 2024
1 parent 7d62525 commit 04937cf
Showing 1 changed file with 71 additions and 72 deletions.
143 changes: 71 additions & 72 deletions modules/desktop/submodules/picom.nix
Original file line number Diff line number Diff line change
@@ -1,92 +1,91 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
let guardName = "gaming-picom-guard"; in
with lib;
{
config = {
systemd.user = {
services.${guardName} = {
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
after = [ "picom.service" ];
path = with pkgs; [ systemd toybox ];
script = ''
while true; do
if ! pgrep --ignore-case steam > /dev/null; then
systemctl --user start picom.service
break
fi
sleep 1
systemd.user.services.${guardName} = {
enable = config.modules.desktop.gaming.steam.enable;
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
after = [ "picom.service" ];
path = with pkgs; [ systemd toybox ];
script = ''
while true; do
if ! pgrep --ignore-case steam > /dev/null; then
systemctl --user start picom.service
break
fi
sleep 1
if systemctl --user is-active picom.service > /dev/null; then
systemctl --user stop picom.service
fi
done
'';
postStop = "systemctl --user start picom.service";
startAt = "*-*-* *:*:00";
if systemctl --user is-active picom.service > /dev/null; then
systemctl --user stop picom.service
fi
done
'';
postStop = "systemctl --user start picom.service";
startAt = "*-*-* *:*:00";

serviceConfig.ExecCondition = "${pkgs.toybox}/bin/pgrep --ignore-case steam";
};
serviceConfig.ExecCondition = "${pkgs.toybox}/bin/pgrep --ignore-case steam";
};
};

services.picom = {
enable = true;
package = pkgs.picom-allusive;
backend = "glx";
fade = true;
fadeDelta = 4;
services.picom = {
enable = true;
package = pkgs.picom-allusive;
backend = "glx";
fade = true;
fadeDelta = 4;

vSync = true;
vSync = true;

wintypes = {
dock.shadow = false;
notification.corner-radius = 5;
};
wintypes = {
dock.shadow = false;
notification.corner-radius = 5;
};

opacityRules = [
"95:class_g = 'Alacritty' && focused"
"85:class_g = 'Alacritty' && !focused"
"95:class_g = 'kitty' && focused"
"85:class_g = 'kitty' && !focused"
];
opacityRules = [
"95:class_g = 'Alacritty' && focused"
"85:class_g = 'Alacritty' && !focused"
"95:class_g = 'kitty' && focused"
"85:class_g = 'kitty' && !focused"
];

settings = {
glx-no-stencil = true;
glx-copy-from-front = false;
settings = {
glx-no-stencil = true;
glx-copy-from-front = false;

# Border
corner-radius = 10;
corners-rule = [
"10:class_g = 'xmobar'"
];
round-borders = 3;
# Border
corner-radius = 10;
corners-rule = [
"10:class_g = 'xmobar'"
];
round-borders = 3;

# Blur
blur-background = true;
blur-method = "gaussian";
blur-strength = 6;
blur-background-exclude = [
"window_type = 'dock'"
];
# Blur
blur-background = true;
blur-method = "gaussian";
blur-strength = 6;
blur-background-exclude = [
"window_type = 'dock'"
];

dbus = true;
dbus = true;

# Fade
no-fading-openclose = false;
# Fade
no-fading-openclose = false;

# Other
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
dbe = false;
unredir-if-possible = false;
detect-transient = true;
detect-client-leader = true;
use-damage = true;
xrender-sync-fence = true;
};
# Other
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
dbe = false;
unredir-if-possible = false;
detect-transient = true;
detect-client-leader = true;
use-damage = true;
xrender-sync-fence = true;
};
};
}

0 comments on commit 04937cf

Please sign in to comment.