Add hyprland theming
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -7,11 +7,6 @@ let
|
|||||||
runtimeInputs = with pkgs; [ coreutils-full ];
|
runtimeInputs = with pkgs; [ coreutils-full ];
|
||||||
bashOptions = [ "nounset" "pipefail" ];
|
bashOptions = [ "nounset" "pipefail" ];
|
||||||
text = ''
|
text = ''
|
||||||
if [ -z "''${WAYLAND_DISPLAY:-}" ]; then
|
|
||||||
echo "No Wayland session active. Exiting."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ ! -L "${cfg.configDir}/wallpaper" ] && ln -sf "${cfg.wallpaper}" "${cfg.configDir}/wallpaper"
|
[ ! -L "${cfg.configDir}/wallpaper" ] && ln -sf "${cfg.wallpaper}" "${cfg.configDir}/wallpaper"
|
||||||
[ ! -f "${cfg.configDir}/mode" ] && echo "${cfg.mode}" > "${cfg.configDir}/mode"
|
[ ! -f "${cfg.configDir}/mode" ] && echo "${cfg.mode}" > "${cfg.configDir}/mode"
|
||||||
|
|
||||||
@@ -177,13 +172,13 @@ in
|
|||||||
|
|
||||||
radius = mkOption {
|
radius = mkOption {
|
||||||
type = ints.unsigned;
|
type = ints.unsigned;
|
||||||
default = 24;
|
default = 8;
|
||||||
description = "The radius of corners.";
|
description = "The radius of corners.";
|
||||||
};
|
};
|
||||||
|
|
||||||
padding = mkOption {
|
padding = mkOption {
|
||||||
type = ints.unsigned;
|
type = ints.unsigned;
|
||||||
default = 12;
|
default = 8;
|
||||||
description = "The padding of windows.";
|
description = "The padding of windows.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
{ user ? throw "user argument is required" }: { lib, pkgs, ... }:
|
{ user ? throw "user argument is required" }: { lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home-manager.users."${user.name}" =
|
home-manager.users."${user.name}" = {
|
||||||
|
home.packages = with pkgs; [ brightnessctl ];
|
||||||
|
|
||||||
|
wayland.windowManager.hyprland.settings.bindle =
|
||||||
let
|
let
|
||||||
brightnessctl = lib.meta.getExe pkgs.brightnessctl;
|
brightnessctl = lib.meta.getExe pkgs.brightnessctl;
|
||||||
in
|
in
|
||||||
{
|
[
|
||||||
wayland.windowManager.hyprland.settings.bindle = [
|
|
||||||
", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+"
|
", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+"
|
||||||
", XF86MonBrightnessDown, 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 view_fg_color @window_fg_color;
|
||||||
|
|
||||||
@define-color accent_bg_color {{colors.primary_container.default.hex}};
|
@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 accent_color {{colors.primary.default.hex}};
|
||||||
|
|
||||||
@define-color headerbar_bg_color @window_bg_color;
|
@define-color headerbar_bg_color @window_bg_color;
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
@define-color headerbar_shade_color {{colors.shadow.default.hex}};
|
@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_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 card_shade_color {{colors.shadow.default.hex}};
|
||||||
|
|
||||||
@define-color popover_bg_color @window_bg_color;
|
@define-color popover_bg_color @window_bg_color;
|
||||||
@@ -29,19 +29,19 @@
|
|||||||
@define-color sidebar_shade_color @card_shade_color;
|
@define-color sidebar_shade_color @card_shade_color;
|
||||||
|
|
||||||
@define-color warning_bg_color {{colors.warning_container.default.hex}};
|
@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 warning_color {{colors.warning.default.hex}};
|
||||||
|
|
||||||
@define-color error_bg_color {{colors.error_container.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 error_color {{colors.error.default.hex}};
|
||||||
|
|
||||||
@define-color success_bg_color {{colors.success_container.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 success_color {{colors.success.default.hex}};
|
||||||
|
|
||||||
@define-color destructive_bg_color {{colors.danger_container.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 destructive_color {{colors.danger.default.hex}};
|
||||||
|
|
||||||
@define-color panel_bg_color @window_bg_color;
|
@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;
|
programs.hyprland.enable = true;
|
||||||
|
|
||||||
home-manager.users."${user.name}" = {
|
home-manager.users."${user.name}" = {
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
"$mod" = "SUPER";
|
"$mod" = "SUPER";
|
||||||
"$term" = lib.meta.getExe pkgs.kitty;
|
"$term" = lib.meta.getExe pkgs.kitty;
|
||||||
@@ -93,8 +97,20 @@
|
|||||||
misc = {
|
misc = {
|
||||||
"disable_hyprland_logo" = true;
|
"disable_hyprland_logo" = true;
|
||||||
"disable_splash_rendering" = 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 ''
|
programs.zsh.loginExtra = lib.mkAfter ''
|
||||||
@@ -103,6 +119,13 @@
|
|||||||
fi
|
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 {
|
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
|
||||||
name = "reload-hyprland";
|
name = "reload-hyprland";
|
||||||
runtimeInputs = with pkgs; [ 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,15 +40,22 @@ in
|
|||||||
types = mkColor "syntax" "types";
|
types = mkColor "syntax" "types";
|
||||||
};
|
};
|
||||||
|
|
||||||
custom_keywords = {
|
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;
|
flavour = hmConfig.theme.flavour;
|
||||||
contrast = builtins.toString hmConfig.theme.contrast;
|
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;
|
radius = builtins.toString hmConfig.theme.radius;
|
||||||
padding = builtins.toString hmConfig.theme.padding;
|
padding = builtins.toString hmConfig.theme.padding;
|
||||||
double_padding = builtins.toString (hmConfig.theme.padding * 2);
|
padding_double = builtins.toString (hmConfig.theme.padding * 2);
|
||||||
blur = builtins.toString hmConfig.theme.blur;
|
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));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -15,6 +15,12 @@ in
|
|||||||
runtimeInputs = with pkgs; [ swww ];
|
runtimeInputs = with pkgs; [ swww ];
|
||||||
text = ''
|
text = ''
|
||||||
swww-daemon &> /tmp/swww.log
|
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
|
swww
|
||||||
];
|
];
|
||||||
text = ''
|
text = ''
|
||||||
while ! swww query &> /dev/null; do
|
|
||||||
sleep 0.1
|
|
||||||
done
|
|
||||||
|
|
||||||
swww img "${hmConfig.theme.configDir}/wallpaper"
|
swww img "${hmConfig.theme.configDir}/wallpaper"
|
||||||
'';
|
'';
|
||||||
})} &";
|
})} &";
|
||||||
|
@@ -8,16 +8,10 @@ in
|
|||||||
home-manager.users."${user.name}" = {
|
home-manager.users."${user.name}" = {
|
||||||
theme.enable = true;
|
theme.enable = true;
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland.settings.bind = [
|
||||||
initExtraConfig = ''
|
|
||||||
${themeBin} &
|
|
||||||
'';
|
|
||||||
|
|
||||||
settings.bind = [
|
|
||||||
"CTRL_ALT, r, exec, ${themeBin}"
|
"CTRL_ALT, r, exec, ${themeBin}"
|
||||||
"CTRL_ALT, t, exec, ${themeBin} toggle"
|
"CTRL_ALT, t, exec, ${themeBin} toggle"
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
Reference in New Issue
Block a user