feat: add stylix theme

Break Changes:
- May need reconfigure fcitx5 input method
This commit is contained in:
danny 2025-08-20 22:32:44 +08:00
parent ca73fac1f6
commit d1913a50ae
30 changed files with 621 additions and 531 deletions

View file

@ -5,15 +5,6 @@
...
}:
let
patchPapirus = pkgs.stdenv.mkDerivation {
name = "${pkgs.papirus-icon-theme.name}-patch";
src = pkgs.papirus-icon-theme;
installPhase = ''
mkdir -p $out/share/icons
ln $src/share/icons/Papirus $out/share/icons/hicolor
'';
};
caelestiaDot = pkgs.fetchFromGitHub {
owner = "caelestia-dots";
repo = "caelestia";
@ -199,11 +190,9 @@ in
systemd.user.services.caelestia = {
Service = {
ExecStart = lib.mkForce "${pkgs.writeShellScript "caelestia-wrapper" ''
export QT_QPA_PLATFORMTHEME=gtk3
${config.programs.caelestia.package}/bin/caelestia-shell
''}";
Environment = [
"QT_QPA_PLATFORMTHEME=gtk3"
];
};
};

View file

@ -1,28 +1,28 @@
{ ... }:
{ lib, config, ... }:
let
configDir = ../config;
browser = "zen.desktop";
in
{
home.file."${config.home.homeDirectory}/.config/starship.toml".source =
lib.mkForce "${configDir}/starship/starship.toml";
home.file = {
".config/neofetch".source = "${configDir}/neofetch";
".config/btop".source = "${configDir}/btop";
".config/rofi".source = "${configDir}/rofi";
".config/scripts".source = "${configDir}/scripts";
".config/starship.toml".source = "${configDir}/starship/starship.toml";
".config/macchiato.toml".source = "${configDir}/starship/macchiato.toml";
".config/gh" = {
recursive = true;
source = "${configDir}/gh";
};
".local/share/fcitx5/themes/fcitx5-dark-transparent" = {
recursive = true;
source = "${configDir}/fcitx5-dark-transparent";
};
".config/fcitx5/conf" = {
recursive = true;
source = "${configDir}/fcitx5";
};
# ".local/share/fcitx5/themes/fcitx5-dark-transparent" = {
# recursive = true;
# source = "${configDir}/fcitx5-dark-transparent";
# };
# ".config/fcitx5/conf" = {
# recursive = true;
# source = "${configDir}/fcitx5";
# };
".face".source = "${configDir}/.face";
};

View file

@ -15,15 +15,6 @@ in
package = pkgs.catppuccin-cursors.macchiatoLavender;
};
theme = {
name = themeName;
package = pkgs.catppuccin-gtk.override {
accents = [ "lavender" ];
size = "compact";
variant = "macchiato";
};
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
@ -43,14 +34,7 @@ in
};
home.packages = with pkgs; [
libsForQt5.qt5ct
gsettings-desktop-schemas
glib
];
qt = {
enable = true;
style.name = "adwaita-dark";
platformTheme.name = "gtk3";
};
}

View file

@ -1,3 +1,4 @@
{ lib }:
{
xwayland = {
force_zero_scaling = true;
@ -7,8 +8,8 @@
gaps_in = 5;
gaps_out = 10;
border_size = 2;
"col.active_border" = "rgb(EBDBB2) rgb(24273A) rgb(24273A) rgb(EBDBB2) 45deg";
"col.inactive_border" = "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg";
"col.active_border" = lib.mkForce "rgb(EBDBB2) rgb(24273A) rgb(24273A) rgb(EBDBB2) 45deg";
"col.inactive_border" = lib.mkForce "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg";
layout = "dwindle";
};

View file

@ -133,18 +133,11 @@ in
force_default_wallpaper = 0;
};
}
// (import ./hypr/window.nix)
// (import ./hypr/window.nix { inherit lib; })
// (import ./hypr/windowrule.nix)
// (import ./hypr/input.nix);
};
# === gamemode === #
systemd.user.services.gamemode = lib.mkIf osConfig.programs.gamemode.enable {
Service = {
ExecStart = "${pkgs.gamemode}/bin/gamemoded -r";
};
};
# === Swww === #
services.swww = {
enable = true;
@ -254,7 +247,7 @@ in
};
# INPUT FIELD
input-field = [
input-field = lib.mkForce [
{
monitor = "${mainMonitor}";
size = "290, 60";
@ -370,7 +363,7 @@ in
control-center-margin-right = 20;
control-center-margin-top = 20;
control-center-width = 500;
fit-to-screen = false;
fit-to-screen = true;
hide-on-action = true;
hide-on-clear = true;
image-visibility = "when-available";
@ -400,9 +393,9 @@ in
@define-color textc #212121;
* {
font-family: JetBrainsMonoNerdFontMono;
font-family: ${osConfig.stylix.fonts.sansSerif.name};
font-size: ${toString osConfig.stylix.fonts.sizes.desktop}pt;
font-weight: bold;
font-size: 15px;
border-width: 3px;
border-color: #ebdbb2;
}
@ -415,7 +408,7 @@ in
.notification-row {
outline: none;
margin: 20px;
margin: 5px;
padding: 0;
}

View file

@ -0,0 +1,59 @@
{
pkgs,
config,
lib,
...
}:
let
addons = with pkgs; [
fcitx5-gtk
fcitx5-mozc # Japanese
fcitx5-chinese-addons
fcitx5-rime # Bopomofo
rime-data
];
in
{
i18n = {
inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
inherit addons;
waylandFrontend = true;
settings = {
addons.classicui.globalSection =
let
font = "Noto Sans CJK TC ${toString config.stylix.fonts.sizes.popups}";
in
{
Font = lib.mkForce font;
MenuFont = lib.mkForce font;
TrayFont = lib.mkForce font;
};
};
};
};
};
systemd.user.services.fcitx5 = {
Unit = {
WantedBy = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
Description = "Fcitx5 Input Method";
};
Service = {
Type = "simple";
Restart = "always";
RestartSec = 2;
ExecStart = "${pkgs.fcitx5}/bin/fcitx5";
Environment = [
"GTK_IM_MODULE="
"XMODIFIERS=@im=fcitx"
"QT_IM_MODULE=fcitx"
];
};
};
}

View file

@ -6,9 +6,6 @@
osConfig,
...
}:
let
inherit (lib) optional;
in
{
programs.poetry = {
enable = true;
@ -24,9 +21,6 @@ in
enableFishIntegration = true;
package = inputs.ghostty.packages.${system}.default;
settings = {
font-family = "CaskaydiaCove Nerd Font Mono";
font-size = 15;
theme = "Espresso";
unfocused-split-opacity = 0.85;
desktop-notifications = false;

View file

@ -10,6 +10,8 @@
...
}:
let
inherit (lib) optionalString;
mkWall = import ../scripts/mkWall.nix { inherit config pkgs; };
rofiWall = import ../scripts/rofiwall.nix { inherit config pkgs; };
@ -44,6 +46,13 @@ in
"d /tmp/wall_cache 700 ${username} -"
];
# === gamemode === #
systemd.user.services.gamemode = lib.mkIf osConfig.programs.gamemode.enable {
Service = {
ExecStart = "${pkgs.gamemode}/bin/gamemoded -r";
};
};
# === waybar === #
systemd.user.services.waybar = lib.mkIf config.programs.waybar.enable {
Unit = {
@ -54,7 +63,132 @@ in
programs.waybar = {
enable = true;
style = ../../home/config/waybar/style.css;
style =
let
borderRadius = "6px";
border = "1px solid @fg-bg";
gap = "4px";
in
lib.mkForce
# css
''
@define-color main #ebdbb2;
@define-color bg-bg rgba(0, 0, 0, 0);
@define-color fg-bg alpha(#fff, 0.05);
* {
font-family: ${osConfig.stylix.fonts.sansSerif.name};
min-height: 0;
font-size: ${toString (osConfig.stylix.fonts.sizes.desktop + 2)};
font-feature-settings: '"zero", "ss01", "ss02", "ss03", "ss04", "ss05", "cv31"';
transition-property: all;
transition-duration: 0.3s;
}
/* Main bar */
window#waybar {
background-color: @bg-bg;
}
window#waybar > .horizontal {
padding: ${gap};
}
window#waybar.hidden {
opacity: 0.5;
}
/* Set transparent if empty */
window#waybar .empty {
background-color: transparent;
border-color: transparent;
}
/* tooltip */
tooltip {
background-color: @fg-bg;
border-radius: ${borderRadius};
}
tooltip label {
padding: 4px 10px;
color: @main;
}
box.module, label.module, #gamemode {
background: @fg-bg;
color: @main;
border-radius: ${borderRadius};
border: ${border};
padding: 2.5px 12px;
}
#gamemode {
padding-right: 6px;
}
box.module button:hover {
background: shade(@fg-bg, 1.5);
}
label:hover {
background: shade(@fg-bg, 1.5);
}
.modules-left .module {
margin-right: ${gap};
}
.modules-right .module {
margin-left: ${gap};
}
.modules-center .module {
background: transparent;
border-color: transparent;
}
#taskbar {
background: transparent;
border-color: transparent;
}
/* Group */
#cpu {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
padding-right: 0;
border-right: none;
}
#memory {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
margin-left: 0;
border-left: none;
}
#temperature.critical {
background-color: red;
}
#battery.good {
color: #ebdbb2;
}
#battery.warning {
color: #eed49f;
}
#battery.critical {
color: #ee99a0;
}
#battery.charging,
#battery.plugged {
color: #a6da95;
}
'';
settings =
let
commonConfig = {
@ -325,18 +459,17 @@ in
return-type = "json";
escape = true;
};
"custom/gamemode" = {
format = "{icon}";
format-icons = {
active = "󰊗";
inactive = "󰺷";
};
exec = "~/.config/scripts/gamemodeStatus.sh";
on-click = "~/.config/scripts/gamemodeStatus.sh toggle";
gamemode = {
format = "{glyph}";
glyph = "";
hide-not-running = false;
use-icon = true;
icon-name = "input-gaming-symbolic";
icon-spacing = 4;
icon-size = 20;
tooltip = true;
interval = 3;
return-type = "json";
escape = true;
tooltip-format = "Games running: {count}";
on-click-right = "systemctl is-active --quiet gamemode.service && systemctl stop gamemode.service || systemctl start gamemode.service";
};
"custom/wallRand" = {
format = "";
@ -403,6 +536,7 @@ in
];
modules-right = [
"wlr/taskbar"
(optionalString config.programs.gamemode.enable "gamemode")
"temperature"
"custom/recording"
"idle_inhibitor"

View file

@ -28,22 +28,6 @@ in
git = ''${yaziPlugins}/git'';
};
flavors = {
gruvbox-dark = pkgs.fetchFromGitHub {
owner = "bennyyip";
repo = "gruvbox-dark.yazi";
rev = "91fdfa70f6d593934e62aba1e449f4ec3d3ccc90";
hash = "sha256-RWqyAdETD/EkDVGcnBPiMcw1mSd78Aayky9yoxSsry4=";
};
};
theme = {
flavors = {
dark = "gruvbox-dark";
light = "gruvbox-dark";
};
};
settings = {
plugin.prepend_fetchers = [
{

View file

@ -50,5 +50,4 @@ in
};
};
};
}