nixcfg/homeManagerModules/theme.nix

91 lines
2.7 KiB
Nix
Raw Normal View History

{
pkgs,
lib,
config,
...
2024-07-09 23:41:52 -04:00
}: let
2024-09-17 20:36:14 -04:00
cfg = config.ar.home;
2024-07-09 23:41:52 -04:00
in {
2024-09-17 20:36:14 -04:00
config = lib.mkIf cfg.theme.enable {
2024-08-15 18:06:42 -04:00
home.packages = [
pkgs.gnome.adwaita-icon-theme
pkgs.liberation_ttf
];
2024-08-15 18:06:42 -04:00
gtk.iconTheme = {
name =
if config.stylix.polarity == "dark"
then "Papirus-Dark"
else "Papirus";
2024-08-15 18:06:42 -04:00
package = pkgs.papirus-icon-theme.override {color = "adwaita";};
};
2024-08-15 17:41:50 -04:00
qt = {
enable = true;
platformTheme.name = "qtct";
style = {
name =
if config.stylix.polarity == "dark"
then "Adwaita-Dark"
else "Adwaita";
2024-08-17 14:00:05 -04:00
package = pkgs.adwaita-qt;
2024-08-15 17:41:50 -04:00
};
};
2024-08-15 18:06:42 -04:00
2024-09-17 20:36:14 -04:00
stylix.targets.gtk.extraCss = builtins.concatStringsSep "\n" [
(lib.optionalString ((cfg.desktop.hyprland.enable || cfg.desktop.sway.enable) && !cfg.desktop.gnome.enable) ''
2024-09-17 20:36:14 -04:00
window.background { border-radius: ${toString cfg.theme.borders.radius}; }
2024-08-15 18:06:42 -04:00
2024-09-17 20:36:14 -04:00
tooltip {
background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups});
border-radius: ${toString cfg.theme.borders.radius};
border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D};
color: white;
}
2024-09-17 20:36:14 -04:00
tooltip.background {
background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups});
border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D};
}'')
2024-09-17 18:04:52 -04:00
2024-09-17 20:36:14 -04:00
(lib.optionalString (
(cfg.desktop.hyprland.enable || cfg.desktop.sway.enable) && (config.stylix.polarity == "light") && !cfg.desktop.gnome.enable
2024-09-17 20:36:14 -04:00
) ''
tooltip {
&.background { background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); }
background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups});
}'')
(lib.optionalString (cfg.theme.gtk.hideTitleBar && !cfg.desktop.gnome.enable) ''
2024-09-17 20:36:14 -04:00
/* No (default) title bar on wayland */
headerbar.default-decoration {
/* You may need to tweak these values depending on your GTK theme */
border-radius: 0;
border: 0;
box-shadow: none;
font-size: 0;
margin-bottom: 50px;
margin-top: -100px;
min-height: 0;
padding: 0;
}
2024-08-15 18:06:42 -04:00
2024-09-17 20:36:14 -04:00
.titlebar,
.titlebar .background
{
border-radius: 0;
}
2024-09-17 20:36:14 -04:00
/* rm -rf window shadows */
window.csd, /* gtk4? */
window.csd decoration { /* gtk3 */
border-radius: 0;
box-shadow: none;
}'')
];
2024-07-09 23:41:52 -04:00
};
}