Skip to content

Commit

Permalink
feat(home-manager): add support for wlogout
Browse files Browse the repository at this point in the history
  • Loading branch information
Anomalocaridid committed Dec 31, 2024
1 parent a2e641b commit 297e2ed
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/home-manager/all-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
./tofi.nix
./obs.nix
./waybar.nix
./wlogout.nix
./yazi.nix
./zathura.nix
./zed-editor.nix
Expand Down
65 changes: 65 additions & 0 deletions modules/home-manager/wlogout.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{ catppuccinLib }:
{ config, lib, ... }:

let
inherit (config.catppuccin) sources;

cfg = config.catppuccin.wlogout;
in

{
options.catppuccin.wlogout =
catppuccinLib.mkCatppuccinOption {
name = "wlogout";
accentSupport = true;
}
// {
iconStyle = lib.mkOption {
type = lib.types.enum [
"wlogout"
"wleave"
];
description = "Icon style to set in ~/.config/wlogout/style.css";
default = "wlogout";
example = lib.literalExpression "wleave";
};
extraStyle = lib.mkOption {
type = lib.types.lines;
description = "Additional CSS to put in ~/.config/wlogout/style.css";
default = "";
example = lib.literalExpression ''
button {
border-radius: 2px;
}
#lock {
background-image: url("''${config.gtk.iconTheme.package}/share/icons/''${config.gtk.iconTheme.name}/apps/scalable/system-lock-screen.svg");
}
'';
};
};

config = lib.mkIf cfg.enable {
programs.wlogout.style = lib.concatStrings [
''
@import url("${sources.wlogout}/themes/${cfg.flavor}/${cfg.accent}.css");
''
(lib.concatMapStrings
(icon: ''
#${icon} {
background-image: url("${sources.wlogout}/icons/${cfg.iconStyle}/${cfg.flavor}/${cfg.accent}/${icon}.svg");
}
'')
[
"hibernate"
"lock"
"logout"
"reboot"
"shutdown"
"suspend"
]
)
cfg.extraStyle
];
};
}
1 change: 1 addition & 0 deletions modules/tests/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
swaylock.enable = lib.mkVMOverride false;
tofi.enable = lib.mkVMOverride false;
waybar.enable = lib.mkVMOverride false;
wlogout.enable = lib.mkVMOverride false;
};

qt.enable = lib.mkVMOverride false; # NOTE: same as cava
Expand Down
1 change: 1 addition & 0 deletions modules/tests/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
tofi.enable = true;
obs-studio.enable = true;
waybar.enable = true;
wlogout.enable = true;
yazi.enable = true;
zathura.enable = true;
zed-editor.enable = true;
Expand Down
4 changes: 4 additions & 0 deletions pkgs/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
"hash": "sha256-za0y6hcN2rvN6Xjf31xLRe4PP0YyHu2i454ZPjr+lWA=",
"rev": "ee8ed32b4f63e9c417249c109818dcc05a2e25da"
},
"wlogout": {
"hash": "sha256-QUSDx5M+BG7YqI4MBsOKFPxvZHQtCa8ibT0Ln4FPQ7I=",
"rev": "b690cee13b944890e43a5fb629ccdff86cffbbb3"
},
"yazi": {
"hash": "sha256-UVcPdQFwgBxR6n3/1zRd9ZEkYADkB5nkuom5SxzPTzk=",
"rev": "5d3a1eecc304524e995fe5b936b8e25f014953e8"
Expand Down
10 changes: 10 additions & 0 deletions pkgs/wlogout/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ buildCatppuccinPort }:

buildCatppuccinPort {
pname = "wlogout";

installTargets = [
"themes"
"icons"
];
}

0 comments on commit 297e2ed

Please sign in to comment.