Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
701451a
bemenu: use mkTarget
0xda157 May 22, 2025
76fd254
dunst: use mkTarget
0xda157 May 22, 2025
8ded80d
fcitx5: use mkTarget
0xda157 May 22, 2025
ace4421
feh: use mkTarget
0xda157 May 22, 2025
18f920c
fnott: use mkTarget
0xda157 May 22, 2025
f4af9ab
fuzzle: use mkTarget
0xda157 May 22, 2025
c28b6b4
fzf: use mkTarget
0xda157 May 22, 2025
37025bd
ghostty: use mkTarget
0xda157 May 22, 2025
022d649
glance: use mkTarget
0xda157 May 22, 2025
2df185e
hyprpaper: use mkTarget
0xda157 May 22, 2025
246c349
k9s: use mkTarget
0xda157 May 22, 2025
87cc064
kitty: use mkTarget
0xda157 May 22, 2025
1d24fc2
kmscon: use mkTarget
0xda157 May 22, 2025
8d02112
kubecolor: use mkTarget
0xda157 May 22, 2025
90c7ef2
lightdm: use mkTarget
0xda157 May 22, 2025
cb99905
mako: use mkTarget
0xda157 May 22, 2025
333388e
mangohud: use mkTarget
0xda157 May 22, 2025
04d0d77
micro: use mkTarget
0xda157 May 22, 2025
ecedbf6
nushell: use mkTarget
0xda157 May 22, 2025
cf832ee
qutebrowser: use mkTarget
0xda157 May 22, 2025
4f2863d
spotify-player: use mkTarget
0xda157 May 23, 2025
cb59785
starship: use mkTarget
0xda157 May 23, 2025
12b7860
swaync: use mkTarget
0xda157 May 23, 2025
f32c646
sxiv: use mkTarget
0xda157 May 23, 2025
0c2c2c1
tmux: use mkTarget
0xda157 May 23, 2025
616d526
tofi: use mkTarget
0xda157 May 23, 2025
5621ddb
wob: use mkTarget
0xda157 May 23, 2025
792775f
wofi: use mkTarget
0xda157 May 23, 2025
a6ac759
wpaperd: use mkTarget
0xda157 May 23, 2025
e37c030
yazi: use mkTarget
0xda157 May 23, 2025
60b976e
zathura: use mkTarget
0xda157 May 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions modules/bemenu/hm.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{ config, lib, ... }:
{
options.stylix.targets.bemenu = {
enable = config.lib.stylix.mkEnableTarget "bemenu" true;
mkTarget,
lib,
config,
...
}:
mkTarget {
name = "bemenu";
humanName = "bemenu";

extraOptions = {
fontSize = lib.mkOption {
description = ''
Font size used for bemenu.
Expand All @@ -20,15 +26,26 @@
};
};

config =
lib.mkIf (config.stylix.enable && config.stylix.targets.bemenu.enable)
configElements = [
(
{ cfg, fonts }:
{
programs.bemenu.settings = {
# Font name
fn = "${fonts.sansSerif.name} ${
lib.optionalString (cfg.fontSize != null) (builtins.toString cfg.fontSize)
}";
};
}
)
(
{ colors, opacity }:
{
programs.bemenu.settings =
with config.lib.stylix.colors.withHashtag;
with colors.withHashtag;
let
inherit (config.stylix.targets.bemenu) alternate fontSize;
bemenuOpacity = lib.toHexString (
((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100
((builtins.ceil (opacity.popups * 100)) * 255) / 100
);
in
{
Expand All @@ -48,11 +65,8 @@

ab = "${if alternate then base00 else base01}"; # Alternate bg
af = "${if alternate then base04 else base05}"; # Alternate fg

# Font name
fn = "${config.stylix.fonts.sansSerif.name} ${
lib.optionalString (fontSize != null) (builtins.toString fontSize)
}";
};
};
}
)
];
}
78 changes: 44 additions & 34 deletions modules/dunst/hm.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
{ config, lib, ... }:
{
options.stylix.targets.dunst.enable =
config.lib.stylix.mkEnableTarget "Dunst" true;
{ mkTarget, lib, ... }:
mkTarget {
name = "dunst";
humanName = "Dunst";

config = lib.mkIf (config.stylix.enable && config.stylix.targets.dunst.enable) {
services.dunst.settings =
with config.lib.stylix.colors.withHashtag;
let
inherit (config.stylix) fonts;
dunstOpacity = lib.toHexString (
((builtins.floor (config.stylix.opacity.popups * 100 + 0.5)) * 255) / 100
);
in
configElements = [
(
{ fonts }:
{
global = {
separator_color = base02;
font = "${fonts.sansSerif.name} ${toString fonts.sizes.popups}";
};
services.dunst.settings.global.font =
"${fonts.sansSerif.name} ${toString fonts.sizes.popups}";
}
)
(
{ colors, opacity }:
{
services.dunst.settings =
with colors.withHashtag;
let
dunstOpacity = lib.toHexString (
((builtins.floor (opacity.popups * 100 + 0.5)) * 255) / 100
);
in
{
global = {
separator_color = base02;
};

urgency_low = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base0B;
};
urgency_low = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base0B;
};

urgency_normal = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base0E;
};
urgency_normal = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base0E;
};

urgency_critical = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base08;
};
};
};
urgency_critical = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base08;
};
};
}
)
];
}
43 changes: 24 additions & 19 deletions modules/fcitx5/hm.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
{
config,
lib,
...
}:
{
options.stylix.targets.fcitx5.enable =
config.lib.stylix.mkEnableTarget "fcitx5" true;
{ mkTarget, ... }:
mkTarget {
name = "fcitx5";
humanName = "fcitx5";

config =
lib.mkIf (config.stylix.enable && config.stylix.targets.fcitx5.enable)
configElements = [
(
{ fonts }:
{
i18n.inputMethod.fcitx5.settings.addons.classicui.globalSection = with fonts; {
Font = "${sansSerif.name} ${toString sizes.popups}";
MenuFont = "${sansSerif.name} ${toString sizes.popups}";
TrayFont = "${sansSerif.name} ${toString sizes.popups}";
};
}
)
(
{ colors }:
{
i18n.inputMethod.fcitx5 = {
settings.addons.classicui.globalSection = with config.stylix.fonts; {
settings.addons.classicui.globalSection = {
Theme = "stylix";
UseDarkTheme = false;
UseAccentColor = false;

Font = "${sansSerif.name} ${toString sizes.popups}";
MenuFont = "${sansSerif.name} ${toString sizes.popups}";
TrayFont = "${sansSerif.name} ${toString sizes.popups}";
};
themes.stylix = {
# Adapted from https://github.com/sanweiya/fcitx5-mellow-themes under the BSD 2 license (compatible with this project's license (MIT))
# Copyright (c) 2024, sanweiya
highlightImage = config.lib.stylix.colors {
highlightImage = colors {
template = ./highlight.svg.mustache;
extension = ".svg";
};
panelImage = config.lib.stylix.colors {
panelImage = colors {
template = ./panel.svg.mustache;
extension = ".svg";
};
theme = import ./template.nix {
colors = config.lib.stylix.colors.withHashtag;
colors = colors.withHashtag;
};
};
};
};
}
)
];
}
46 changes: 18 additions & 28 deletions modules/feh/hm.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
{
mkTarget,
lib,
pkgs,
config,
lib,
...
}:
let
cfg = config.stylix.targets.feh;
in
{
options.stylix.targets.feh = {
enable = config.lib.stylix.mkEnableTarget "the desktop background using Feh" (
config.stylix.image != null
);
};
mkTarget {
name = "feh";
humanName = "the desktop background using Feh";
autoEnable =
with config.xsession.windowManager;
bspwm.enable
|| herbstluftwm.enable
|| i3.enable
|| spectrwm.enable
|| xmonad.enable;

config.xsession.initExtra =
lib.mkIf
(
config.stylix.enable
&& cfg.enable
&& (
with config.xsession.windowManager;
bspwm.enable
|| herbstluftwm.enable
|| i3.enable
|| spectrwm.enable
|| xmonad.enable
)
)
(
configElements =
{ imageScalingMode, image }:
{
xsession.initExtra =
let
inherit (config.stylix) imageScalingMode;
bg-arg =
if imageScalingMode == "fill" then
"--bg-fill"
Expand All @@ -44,6 +34,6 @@ in
else
"--bg-max";
in
"${lib.getExe pkgs.feh} --no-fehbg ${bg-arg} ${config.stylix.image}"
);
"${lib.getExe pkgs.feh} --no-fehbg ${bg-arg} ${image}";
};
}
83 changes: 48 additions & 35 deletions modules/fnott/hm.nix
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
{ lib, config, ... }:
{
options.stylix.targets.fnott.enable =
config.lib.stylix.mkEnableTarget "Fnott" true;
{ mkTarget, lib, ... }:
mkTarget {
name = "fnott";
humanName = "Fnott";

config.services.fnott.settings =
lib.mkIf (config.stylix.enable && config.stylix.targets.fnott.enable)
(
let
font = "${config.stylix.fonts.sansSerif.name}:size=${toString config.stylix.fonts.sizes.popups}";
fg = c: "${c}ff";
bg =
c:
"${c}${
lib.toHexString (
((builtins.floor (config.stylix.opacity.popups * 100 + 0.5)) * 255) / 100
)
}";
in
with config.lib.stylix.colors;
{
main = {
title-font = font;
summary-font = font;
body-font = font;

title-color = fg base05;
summary-color = fg base05;
body-color = fg base05;
progress-bar-color = fg base02;
background = bg base00;
configElements = [
(
{ fonts }:
{
services.fnott.settings =
let
font = "${fonts.sansSerif.name}:size=${toString fonts.sizes.popups}";
in
{
main = {
title-font = font;
summary-font = font;
body-font = font;
};
};
}
)
(
{ colors, opacity }:
{
services.fnott.settings =
let
fg = c: "${c}ff";
bg =
c:
"${c}${
lib.toHexString (((builtins.floor (opacity.popups * 100 + 0.5)) * 255) / 100)
}";
in
with colors;
{
main = {
title-color = fg base05;
summary-color = fg base05;
body-color = fg base05;
progress-bar-color = fg base02;
background = bg base00;
};

low.border-color = fg base0B;
normal.border-color = fg base0E;
critical.border-color = fg base08;
}
);
low.border-color = fg base0B;
normal.border-color = fg base0E;
critical.border-color = fg base08;
};
}
)
];
}
Loading