Skip to content

Commit

Permalink
Merge branch 'master' into enable-option
Browse files Browse the repository at this point in the history
  • Loading branch information
danth authored Jun 9, 2024
2 parents 35f1dea + ca3247e commit 2091898
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 67 deletions.
8 changes: 4 additions & 4 deletions docs/src/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ An urgent window is one which is grabbing for attention - Windows shows this by
a flashing orange taskbar icon.

- Unfocused window border: base03
- Focused window border: base0A
- Unfocused window border in group: base0D
- Focused window border in group: base06
- Urgent window border: base07
- Focused window border: base0D
- Unfocused window border in group: base03
- Focused window border in group: base0D
- Urgent window border: base08
- Window title text: base05

## Notifications and Popups
Expand Down
8 changes: 4 additions & 4 deletions modules/bspwm/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ in {

config = lib.mkIf (config.stylix.enable && config.stylix.targets.bspwm.enable) {
xsession.windowManager.bspwm.settings = {
active_border_color = colors.base08;
normal_border_color = colors.base02;
focused_border_color = colors.base0F;
presel_feedback_color = colors.base08;
normal_border_color = colors.base03;
active_border_color = colors.base0C;
focused_border_color = colors.base0D;
presel_feedback_color = colors.base00;
};
};
}
4 changes: 2 additions & 2 deletions modules/gtk/gtk.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@define-color accent_color #{{base0A-hex}};
@define-color accent_bg_color #{{base0A-hex}};
@define-color accent_color #{{base0D-hex}};
@define-color accent_bg_color #{{base0D-hex}};
@define-color accent_fg_color #{{base00-hex}};
@define-color destructive_color #{{base08-hex}};
@define-color destructive_bg_color #{{base08-hex}};
Expand Down
8 changes: 4 additions & 4 deletions modules/hyprland/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ let
settings = {
decoration."col.shadow" = rgba base00 "99";
general = {
"col.active_border" = rgb base0A;
"col.active_border" = rgb base0D;
"col.inactive_border" = rgb base03;
};
group = {
"col.border_inactive" = rgb base0D;
"col.border_active" = rgb base06;
"col.border_locked_active" = rgb base06;
"col.border_inactive" = rgb base03;
"col.border_active" = rgb base0D;
"col.border_locked_active" = rgb base0C;
};
misc.background_color = rgb base00;
};
Expand Down
2 changes: 1 addition & 1 deletion modules/i3/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ with config.lib.stylix.colors.withHashtag;
let
text = base05;
urgent = base08;
focused = base0A;
focused = base0D;
unfocused = base03;

fonts = let
Expand Down
4 changes: 2 additions & 2 deletions modules/sway/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ with config.lib.stylix.colors.withHashtag;
let
text = base05;
urgent = base08;
focused = base0A;
focused = base0D;
unfocused = base03;

fonts = {
Expand Down Expand Up @@ -54,7 +54,7 @@ in {
};
};

output."*".bg = "${config.stylix.image} fill";
output."*".bg = "${config.stylix.image} ${config.stylix.imageScalingMode}";

seat."*" = {
xcursor_theme = "${config.stylix.cursor.name} ${toString config.stylix.cursor.size}";
Expand Down
53 changes: 28 additions & 25 deletions modules/tofi/hm.nix
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
{
config,
lib,
...
{ config
, lib
, ...
}:
with config.stylix.fonts;
with config.lib.stylix.colors.withHashtag; {
options.stylix.targets.tofi.enable =
config.lib.stylix.mkEnableTarget "Tofi" true;

config = lib.mkIf (config.stylix.enable && config.stylix.targets.tofi.enable) {
programs.tofi.settings = let
background = base00;
foreground = base05;
darkForeground = base04;
selection = base03;
in {
font = monospace.name;
font-size = toString sizes.popups;

background-color = background;
outline-color = darkForeground;
border-color = foreground;
text-color = foreground;
prompt-color = base0A;
prompt-background = background;
placeholder-color = selection;
input-background = background;
default-result-background = background;
selection-color = selection;
selection-background = background;
};
programs.tofi.settings =
let
opacity = lib.toHexString ((((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100));
background = base00 + opacity;
foreground = base05;
darkForeground = base04 + opacity;
selection = base03 + opacity;
in
{
font = monospace.name;
font-size = toString sizes.popups;
background-color = background;
outline-color = darkForeground;
border-color = foreground;
text-color = foreground;
prompt-color = base0A;
prompt-background = background;
placeholder-color = selection;
input-background = background;
default-result-background = background;
selection-color = selection;
selection-background = background;
border-width = lib.mkDefault 4;
outline-width = lib.mkDefault 2;
};
};
}
22 changes: 21 additions & 1 deletion modules/vim/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,30 @@ let
fonts = config.stylix.fonts;
in {
plugins = [ themePlugin ];
extraConfig = ''
extraConfig = with config.lib.stylix.colors.withHashtag; ''
set termguicolors
colorscheme base16-stylix
unlet g:colors_name
let g:stylix_colors = {
\ 'base00': '${base00}',
\ 'base01': '${base01}',
\ 'base02': '${base02}',
\ 'base03': '${base03}',
\ 'base04': '${base04}',
\ 'base05': '${base05}',
\ 'base06': '${base06}',
\ 'base07': '${base07}',
\ 'base08': '${base08}',
\ 'base09': '${base09}',
\ 'base0A': '${base0A}',
\ 'base0B': '${base0B}',
\ 'base0C': '${base0C}',
\ 'base0D': '${base0D}',
\ 'base0E': '${base0E}',
\ 'base0F': '${base0F}',
\ }
set guifont=${escape [" "] fonts.monospace.name}:h${toString fonts.sizes.terminal}
'';
};
Expand Down
52 changes: 28 additions & 24 deletions modules/zathura/hm.nix
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
{ config, lib, ... }:

with config.lib.stylix.colors;
{
options.stylix.targets.zathura.enable =
config.lib.stylix.mkEnableTarget "Zathura" true;

config = lib.mkIf (config.stylix.enable && config.stylix.targets.zathura.enable) {
# Taken from here:
# https://github.com/doenerkebap/base16-zathura
programs.zathura.options = {
default-bg = "#${base00}";
default-fg = "#${base01}";
statusbar-fg = "#${base04}";
statusbar-bg = "#${base02}";
inputbar-bg = "#${base00}";
inputbar-fg = "#${base07}";
notification-bg = "#${base00}";
notification-fg = "#${base07}";
notification-error-bg = "#${base00}";
notification-error-fg = "#${base08}";
notification-warning-bg = "#${base00}";
notification-warning-fg = "#${base08}";
highlight-color = "#${base0A}";
highlight-active-color = "#${base0D}";
completion-bg = "#${base01}";
completion-fg = "#${base0D}";
completion-highlight-fg = "#${base07}";
completion-highlight-bg = "#${base0D}";
recolor-lightcolor = "#${base00}";
recolor-darkcolor = "#${base06}";
programs.zathura.options = let
highlightTransparency = "0.5";
getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}";
rgb = color: ''rgb(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"})'';
rgba = color: ''rgba(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"}, ${highlightTransparency})'';
in {
# Taken from here:
# https://github.com/doenerkebap/base16-zathura
default-bg = rgb "base00";
default-fg = rgb "base01";
statusbar-fg = rgb "base04";
statusbar-bg = rgb "base02";
inputbar-bg = rgb "base00";
inputbar-fg = rgb "base07";
notification-bg = rgb "base00";
notification-fg = rgb "base07";
notification-error-bg = rgb "base00";
notification-error-fg = rgb "base08";
notification-warning-bg = rgb "base00";
notification-warning-fg = rgb "base08";
highlight-color = rgba "base0A";
highlight-active-color = rgba "base0D";
completion-bg = rgb "base01";
completion-fg = rgb "base0D";
completion-highlight-fg = rgb "base07";
completion-highlight-bg = rgb "base0D";
recolor-lightcolor = rgb "base00";
recolor-darkcolor = rgb "base06";
};
};
}
11 changes: 11 additions & 0 deletions stylix/palette.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ in {
default = fromOs [ "image" ] null;
};

imageScalingMode = mkOption {
type = types.enum [ "stretch" "fill" "fit" "center" "tile" ];
default = fromOs [ "imageScalingMode" ] "fill";
description = ''
Wallpaper scaling mode;
This is the scaling mode your wallpaper image will use assuming it
doesnt fix your monitor perfectly
'';
};

generated = {
json = mkOption {
type = types.path;
Expand Down

0 comments on commit 2091898

Please sign in to comment.