-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(picom): added activation condition for gaming-picom-guard service
- Loading branch information
Showing
1 changed file
with
71 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
}; | ||
} |