Skip to content

Commit

Permalink
feat(home-manager): init wlogout module
Browse files Browse the repository at this point in the history
  • Loading branch information
Anomalocaridid committed Dec 9, 2024
1 parent becc648 commit 11f3880
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .sources/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,18 @@
"url": "https://github.com/catppuccin/waybar/archive/ee8ed32b4f63e9c417249c109818dcc05a2e25da.tar.gz",
"hash": "0q4mzqx3w6cywfifs7ij8qzhzvj59dfdzpvqx76vpnhd2zm35bfd"
},
"wlogout": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "catppuccin",
"repo": "wlogout"
},
"branch": "main",
"revision": "b690cee13b944890e43a5fb629ccdff86cffbbb3",
"url": "https://github.com/catppuccin/wlogout/archive/b690cee13b944890e43a5fb629ccdff86cffbbb3.tar.gz",
"hash": "1cj39y0ry2rxdliay29dfij6zz0lib1hc34fm3c6w11yjg3q6i21"
},
"yazi": {
"type": "Git",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions modules/home-manager/all-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
./tofi.nix
./obs-studio.nix
./waybar.nix
./wlogout.nix
./yazi.nix
./zathura.nix
./zellij.nix
Expand Down
60 changes: 60 additions & 0 deletions modules/home-manager/wlogout.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
inherit (lib) ctp;
cfg = config.programs.wlogout.catppuccin;
enable = cfg.enable && config.programs.wlogout.enable;
in
{
options.programs.wlogout.catppuccin = ctp.mkCatppuccinOpt { name = "wlogout"; } // {
accent = ctp.mkAccentOpt "wlogout";
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.programs.wlogout = lib.mkIf enable {
style = lib.concatStrings [
''
@import url("${sources.wlogout + /themes/${cfg.flavor}/${cfg.accent}.css}");
''
# Set icons
(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 tests/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
tofi.enable = true;
obs-studio.enable = true;
waybar.enable = true;
wlogout.enable = true;
yazi.enable = true;
zathura.enable = true;
zellij.enable = true;
Expand Down

0 comments on commit 11f3880

Please sign in to comment.