Add hyprland theming
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
{ user ? throw "user argument is required" }: { lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home-manager.users."${user.name}" =
|
||||
let
|
||||
brightnessctl = lib.meta.getExe pkgs.brightnessctl;
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland.settings.bindle = [
|
||||
home-manager.users."${user.name}" = {
|
||||
home.packages = with pkgs; [ brightnessctl ];
|
||||
|
||||
wayland.windowManager.hyprland.settings.bindle =
|
||||
let
|
||||
brightnessctl = lib.meta.getExe pkgs.brightnessctl;
|
||||
in
|
||||
[
|
||||
", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+"
|
||||
", XF86MonBrightnessDown, exec, ${brightnessctl} -q s 5%-"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
@define-color view_fg_color @window_fg_color;
|
||||
|
||||
@define-color accent_bg_color {{colors.primary_container.default.hex}};
|
||||
@define-color accent_fg_color {{colors.on_primary.default.hex}};
|
||||
@define-color accent_fg_color {{colors.on_primary_container.default.hex}};
|
||||
@define-color accent_color {{colors.primary.default.hex}};
|
||||
|
||||
@define-color headerbar_bg_color @window_bg_color;
|
||||
@@ -14,7 +14,7 @@
|
||||
@define-color headerbar_shade_color {{colors.shadow.default.hex}};
|
||||
|
||||
@define-color card_bg_color alpha({{colors.surface_container.default.hex}}, {{custom.opacity}});
|
||||
@define-color card_fg_color {{colors.on_surface.default.hex}};
|
||||
@define-color card_fg_color {{colors.on_surface_variant.default.hex}};
|
||||
@define-color card_shade_color {{colors.shadow.default.hex}};
|
||||
|
||||
@define-color popover_bg_color @window_bg_color;
|
||||
@@ -29,19 +29,19 @@
|
||||
@define-color sidebar_shade_color @card_shade_color;
|
||||
|
||||
@define-color warning_bg_color {{colors.warning_container.default.hex}};
|
||||
@define-color warning_fg_color {{colors.on_warning.default.hex}};
|
||||
@define-color warning_fg_color {{colors.on_warning_container.default.hex}};
|
||||
@define-color warning_color {{colors.warning.default.hex}};
|
||||
|
||||
@define-color error_bg_color {{colors.error_container.default.hex}};
|
||||
@define-color error_fg_color {{colors.on_error.default.hex}};
|
||||
@define-color error_fg_color {{colors.on_error_container.default.hex}};
|
||||
@define-color error_color {{colors.error.default.hex}};
|
||||
|
||||
@define-color success_bg_color {{colors.success_container.default.hex}};
|
||||
@define-color success_fg_color {{colors.on_success.default.hex}};
|
||||
@define-color success_fg_color {{colors.on_success_container.default.hex}};
|
||||
@define-color success_color {{colors.success.default.hex}};
|
||||
|
||||
@define-color destructive_bg_color {{colors.danger_container.default.hex}};
|
||||
@define-color destructive_fg_color {{colors.on_danger.default.hex}};
|
||||
@define-color destructive_fg_color {{colors.on_danger_container.default.hex}};
|
||||
@define-color destructive_color {{colors.danger.default.hex}};
|
||||
|
||||
@define-color panel_bg_color @window_bg_color;
|
||||
|
@@ -1,11 +1,15 @@
|
||||
{ user ? throw "user argument is required" }: { lib, pkgs, ... }:
|
||||
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
hmConfig = config.home-manager.users."${user.name}";
|
||||
in
|
||||
{
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
home-manager.users."${user.name}" = {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
"$mod" = "SUPER";
|
||||
"$term" = lib.meta.getExe pkgs.kitty;
|
||||
@@ -93,8 +97,20 @@
|
||||
misc = {
|
||||
"disable_hyprland_logo" = true;
|
||||
"disable_splash_rendering" = true;
|
||||
"new_window_takes_over_fullscreen" = 2;
|
||||
};
|
||||
|
||||
decoration.blur = {
|
||||
passes = 2;
|
||||
popups = true;
|
||||
};
|
||||
|
||||
input.touchpad.natural_scroll = true;
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
source = ./theme.conf
|
||||
'';
|
||||
};
|
||||
|
||||
programs.zsh.loginExtra = lib.mkAfter ''
|
||||
@@ -103,6 +119,13 @@
|
||||
fi
|
||||
'';
|
||||
|
||||
programs.matugen.settings.templates = {
|
||||
hyprland = {
|
||||
input_path = ./theme.conf;
|
||||
output_path = "${hmConfig.xdg.configHome}/hypr/theme.conf";
|
||||
};
|
||||
};
|
||||
|
||||
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
|
||||
name = "reload-hyprland";
|
||||
runtimeInputs = with pkgs; [ hyprland ];
|
||||
|
20
users/configs/hyprland/theme.conf
Normal file
20
users/configs/hyprland/theme.conf
Normal file
@@ -0,0 +1,20 @@
|
||||
general {
|
||||
gaps_in = {{custom.padding}}
|
||||
gaps_out = {{custom.padding_double}}
|
||||
col.inactive_border = rgba({{colors.surface.default.hex_stripped}}{{custom.opacity_hex | to_lower}})
|
||||
col.active_border = rgb({{colors.primary.default.hex_stripped}})
|
||||
}
|
||||
|
||||
decoration {
|
||||
rounding = {{custom.radius}}
|
||||
col.shadow = rgba({{colors.shadow.default.hex_stripped}}{{custom.opacity_shadow_hex | to_lower}})
|
||||
|
||||
blur {
|
||||
size = {{custom.blur}}
|
||||
}
|
||||
}
|
||||
|
||||
misc {
|
||||
col.splash = rgb({{colors.on_surface.default.hex_stripped}})
|
||||
background_color = rgb({{colors.surface.default.hex_stripped}})
|
||||
}
|
@@ -40,16 +40,23 @@ in
|
||||
types = mkColor "syntax" "types";
|
||||
};
|
||||
|
||||
custom_keywords = {
|
||||
flavour = hmConfig.theme.flavour;
|
||||
contrast = builtins.toString hmConfig.theme.contrast;
|
||||
opacity = builtins.toString hmConfig.theme.opacity;
|
||||
transparency = builtins.toString (1 - hmConfig.theme.opacity);
|
||||
radius = builtins.toString hmConfig.theme.radius;
|
||||
padding = builtins.toString hmConfig.theme.padding;
|
||||
double_padding = builtins.toString (hmConfig.theme.padding * 2);
|
||||
blur = builtins.toString hmConfig.theme.blur;
|
||||
};
|
||||
custom_keywords =
|
||||
let
|
||||
zeroPad = hex: if builtins.stringLength hex == 1 then "0${hex}" else hex;
|
||||
percentageToHex = percentage: zeroPad (lib.trivial.toHexString (builtins.floor (percentage * 255)));
|
||||
in
|
||||
{
|
||||
flavour = hmConfig.theme.flavour;
|
||||
contrast = builtins.toString hmConfig.theme.contrast;
|
||||
radius = builtins.toString hmConfig.theme.radius;
|
||||
padding = builtins.toString hmConfig.theme.padding;
|
||||
padding_double = builtins.toString (hmConfig.theme.padding * 2);
|
||||
blur = builtins.toString hmConfig.theme.blur;
|
||||
opacity = builtins.toString hmConfig.theme.opacity;
|
||||
opacity_hex = builtins.toString (percentageToHex hmConfig.theme.opacity);
|
||||
opacity_shadow = builtins.toString (hmConfig.theme.opacity * .75);
|
||||
opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * .75));
|
||||
};
|
||||
};
|
||||
|
||||
templates = { };
|
||||
|
@@ -15,6 +15,12 @@ in
|
||||
runtimeInputs = with pkgs; [ swww ];
|
||||
text = ''
|
||||
swww-daemon &> /tmp/swww.log
|
||||
|
||||
while ! swww query &> /dev/null; do
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
swww img "${hmConfig.theme.configDir}/wallpaper"
|
||||
'';
|
||||
})} &";
|
||||
|
||||
@@ -26,10 +32,6 @@ in
|
||||
swww
|
||||
];
|
||||
text = ''
|
||||
while ! swww query &> /dev/null; do
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
swww img "${hmConfig.theme.configDir}/wallpaper"
|
||||
'';
|
||||
})} &";
|
||||
|
@@ -8,16 +8,10 @@ in
|
||||
home-manager.users."${user.name}" = {
|
||||
theme.enable = true;
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
initExtraConfig = ''
|
||||
${themeBin} &
|
||||
'';
|
||||
|
||||
settings.bind = [
|
||||
"CTRL_ALT, r, exec, ${themeBin}"
|
||||
"CTRL_ALT, t, exec, ${themeBin} toggle"
|
||||
];
|
||||
};
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"CTRL_ALT, r, exec, ${themeBin}"
|
||||
"CTRL_ALT, t, exec, ${themeBin} toggle"
|
||||
];
|
||||
|
||||
home = {
|
||||
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
|
Reference in New Issue
Block a user