1

Modules/Color: Configure iconTheme and cursor using color module

This commit is contained in:
2025-11-14 14:19:57 +01:00
parent a9a7115774
commit a27dc9859b
7 changed files with 240 additions and 182 deletions

View File

@ -53,8 +53,17 @@ in
};
color = {
extraPackages = with pkgs; [
papirus-icon-theme
bibata-cursors
inputs.waifu-cursors.packages.${pkgs.system}.all
];
scheme = "catppuccin-mocha";
font = builtins.head nixosConfig.fonts.fontconfig.defaultFonts.monospace;
cursor = "miku-cursor-linux";
cursorSize = 64;
iconTheme = "Papirus";
wallpaper = "Windows";
accent = "mauve";
@ -83,8 +92,166 @@ in
signCommits = true;
};
hyprland = import ./hyprland.nix {inherit pkgs config headless;};
hyprpanel.enable = !headless;
hyprland = {
enable = !headless;
dunst.enable = !config.modules.hyprpanel.enable; # Disable for hyprpanel
bars.enable = false;
dynamicCursor.enable = false;
trails.enable = true;
hyprspace.enable = false; # Always broken
hyprpanel.enable = false;
keybindings = {
main-mod = "SUPER";
bindings = {
"$mainMod, t" = ["exec, kitty"];
"$mainMod, e" = ["exec, kitty --title=Yazi yazi"];
"$mainMod, n" = ["exec, neovide"];
# "$mainMod, r" = ["exec, kitty --title=Rmpc rmpc"];
"$mainMod CTRL, n" = ["exec, kitty --title=Navi navi"];
"$mainMod SHIFT, n" = ["exec, neovide ${config.paths.dotfiles}/navi/christoph.cheat"];
"$mainMod SHIFT, f" = ["exec, neovide ${config.paths.dotfiles}/flake.nix"];
"$mainMod, p" = ["exec, hyprpicker --autocopy --format=hex"];
"$mainMod, s" = ["exec, grim -g \"$(slurp)\""];
"$mainMod CTRL, s" = ["exec, grim -g \"$(slurp)\" - | wl-copy"];
"$mainMod SHIFT, s" = ["exec, grim -g \"$(slurp)\" - | wl-copy"];
", XF86AudioRaiseVolume" = ["exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"];
", XF86AudioLowerVolume" = ["exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"];
", XF86AudioPlay" = ["exec, playerctl play-pause"];
", XF86AudioPrev" = ["exec, playerctl previous"];
", XF86AudioNext" = ["exec, playerctl next"];
", XF86MonBrightnessDown" = ["exec, hyprctl hyprsunset gamma -10"];
", XF86MonBrightnessUp" = ["exec, hyprctl hyprsunset gamma +10"];
"$mainMod, XF86MonBrightnessDown" = ["exec, hyprctl hyprsunset temperature 5750"];
"$mainMod, XF86MonBrightnessUp" = ["exec, hyprctl hyprsunset identity"];
"CTRL ALT, f" = let
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
grep = "${pkgs.gnugrep}/bin/grep";
awk = "${pkgs.gawk}/bin/gawk";
notify = "${pkgs.libnotify}/bin/notify-send";
toggleMouseFocus = pkgs.writeScriptBin "hypr-toggle-mouse-focus" ''
CURRENT=$(${hyprctl} getoption input:follow_mouse | ${grep} int | ${awk} -F' ' '{print $2}')
if [[ "$CURRENT" == "1" ]]; then
${hyprctl} keyword input:follow_mouse 0
${notify} "Disabled Mouse Focus!"
else
${hyprctl} keyword input:follow_mouse 1
${notify} "Enabled Mouse Focus!"
fi
'';
in ["exec, ${toggleMouseFocus}/bin/hypr-toggle-mouse-focus"];
# "CTRL ALT, t" = ["exec, bash -c 'systemctl --user restart hyprpanel.service'"];
};
ws-bindings = {
# "<Workspace>" = "<Key>";
"1" = "1";
"2" = "2";
"3" = "3";
"4" = "4";
"5" = "5";
"6" = "6";
"7" = "7";
"8" = "8";
"9" = "9";
"10" = "0";
};
special-ws-bindings = {
"ferdium" = "x";
"msty" = "z";
"btop" = "b";
"rmpc" = "r";
};
};
autostart = {
immediate = [
"kitty --hold fastfetch"
"zeal"
"nextcloud --background"
"protonvpn-app"
# "kdeconnect-indicator" # started by services.kdeconnect.indicator
];
delayed = [
"keepassxc" # The tray doesn't work when started too early
];
special-silent = {
"ferdium" = ["ferdium"];
"msty" = ["msty"];
"btop" = ["kitty --title=Btop btop"];
"rmpc" = ["kitty --title=Rmpc rmpc"];
};
};
windowrules = [
# Fix jetbrains tooltip flicker
"float,class:^(jetbrains-.*)$,title:^(win[0-9]+)$"
"nofocus,class:^(jetbrains-.*)$,title:^(win[0-9]+)$"
];
workspacerules = {
"1" = [];
"2" = ["Zotero" "neovide" "code-url-handler"];
"3" = ["obsidian"];
"4" = ["firefox" "Google-chrome" "chromium-browser" "org.qutebrowser.qutebrowser"];
"5" = ["steam"];
"6" = ["steam_app_(.+)"];
"7" = ["signal"];
"8" = ["tidal-hifi"];
"9" = ["discord"];
"10" = ["python3"];
};
floating = [
{class = "org.kde.polkit-kde-authentication-agent-1";}
{
class = "thunar";
title = "File Operation Progress";
}
{class = "ffplay";}
{class = "Unity";}
];
transparent-opacity = "0.75";
transparent = [
"kitty"
"Alacritty"
"discord"
"signal"
"vesktop"
"Spotify"
"tidal-hifi"
"obsidian"
"firefox"
"org.qutebrowser.qutebrowser"
"jetbrains-clion"
"jetbrains-idea"
"jetbrains-pycharm"
"jetbrains-rustrover"
"jetbrains-rider"
"jetbrains-webstorm"
"code-url-handler"
"neovide"
"steam"
"ferdium"
"Msty"
];
};
# hyprpanel.enable = !headless; # Enabled by hyprland module
kitty.enable = !headless;
lazygit.enable = true;

View File

@ -1,161 +0,0 @@
{
pkgs,
config,
headless,
}: {
enable = !headless;
dunst.enable = !config.modules.hyprpanel.enable; # Disable for hyprpanel
bars.enable = false;
dynamicCursor.enable = false;
trails.enable = true;
hyprspace.enable = false; # Always broken
keybindings = {
main-mod = "SUPER";
bindings = {
"$mainMod, t" = ["exec, kitty"];
"$mainMod, e" = ["exec, kitty --title=Yazi yazi"];
"$mainMod, n" = ["exec, neovide"];
# "$mainMod, r" = ["exec, kitty --title=Rmpc rmpc"];
"$mainMod CTRL, n" = ["exec, kitty --title=Navi navi"];
"$mainMod SHIFT, n" = ["exec, neovide ${config.paths.dotfiles}/navi/christoph.cheat"];
"$mainMod SHIFT, f" = ["exec, neovide ${config.paths.dotfiles}/flake.nix"];
"$mainMod, p" = ["exec, hyprpicker --autocopy --format=hex"];
"$mainMod, s" = ["exec, grim -g \"$(slurp)\""];
"$mainMod CTRL, s" = ["exec, grim -g \"$(slurp)\" - | wl-copy"];
"$mainMod SHIFT, s" = ["exec, grim -g \"$(slurp)\" - | wl-copy"];
", XF86AudioRaiseVolume" = ["exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"];
", XF86AudioLowerVolume" = ["exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"];
", XF86AudioPlay" = ["exec, playerctl play-pause"];
", XF86AudioPrev" = ["exec, playerctl previous"];
", XF86AudioNext" = ["exec, playerctl next"];
", XF86MonBrightnessDown" = ["exec, hyprctl hyprsunset gamma -10"];
", XF86MonBrightnessUp" = ["exec, hyprctl hyprsunset gamma +10"];
"$mainMod, XF86MonBrightnessDown" = ["exec, hyprctl hyprsunset temperature 5750"];
"$mainMod, XF86MonBrightnessUp" = ["exec, hyprctl hyprsunset identity"];
"CTRL ALT, f" = let
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
grep = "${pkgs.gnugrep}/bin/grep";
awk = "${pkgs.gawk}/bin/gawk";
notify = "${pkgs.libnotify}/bin/notify-send";
toggleMouseFocus = pkgs.writeScriptBin "hypr-toggle-mouse-focus" ''
CURRENT=$(${hyprctl} getoption input:follow_mouse | ${grep} int | ${awk} -F' ' '{print $2}')
if [[ "$CURRENT" == "1" ]]; then
${hyprctl} keyword input:follow_mouse 0
${notify} "Disabled Mouse Focus!"
else
${hyprctl} keyword input:follow_mouse 1
${notify} "Enabled Mouse Focus!"
fi
'';
in ["exec, ${toggleMouseFocus}/bin/hypr-toggle-mouse-focus"];
# "CTRL ALT, t" = ["exec, bash -c 'systemctl --user restart hyprpanel.service'"];
};
ws-bindings = {
# "<Workspace>" = "<Key>";
"1" = "1";
"2" = "2";
"3" = "3";
"4" = "4";
"5" = "5";
"6" = "6";
"7" = "7";
"8" = "8";
"9" = "9";
"10" = "0";
};
special-ws-bindings = {
"ferdium" = "x";
"msty" = "z";
"btop" = "b";
"rmpc" = "r";
};
};
autostart = {
immediate = [
"kitty --hold fastfetch"
"zeal"
"nextcloud --background"
"protonvpn-app"
# "kdeconnect-indicator" # started by services.kdeconnect.indicator
];
delayed = [
"keepassxc" # The tray doesn't work when started too early
];
special-silent = {
"ferdium" = ["ferdium"];
"msty" = ["msty"];
"btop" = ["kitty --title=Btop btop"];
"rmpc" = ["kitty --title=Rmpc rmpc"];
};
};
windowrules = [
# Fix jetbrains tooltip flicker
"float,class:^(jetbrains-.*)$,title:^(win[0-9]+)$"
"nofocus,class:^(jetbrains-.*)$,title:^(win[0-9]+)$"
];
workspacerules = {
"1" = [];
"2" = ["Zotero" "neovide" "code-url-handler"];
"3" = ["obsidian"];
"4" = ["firefox" "Google-chrome" "chromium-browser" "org.qutebrowser.qutebrowser"];
"5" = ["steam"];
"6" = ["steam_app_(.+)"];
"7" = ["signal"];
"8" = ["tidal-hifi"];
"9" = ["discord"];
"10" = ["python3"];
};
floating = [
{class = "org.kde.polkit-kde-authentication-agent-1";}
{
class = "thunar";
title = "File Operation Progress";
}
{class = "ffplay";}
{class = "Unity";}
];
transparent-opacity = "0.75";
transparent = [
"kitty"
"Alacritty"
"discord"
"signal"
"vesktop"
"Spotify"
"tidal-hifi"
"obsidian"
"firefox"
"org.qutebrowser.qutebrowser"
"jetbrains-clion"
"jetbrains-idea"
"jetbrains-pycharm"
"jetbrains-rustrover"
"jetbrains-rider"
"jetbrains-webstorm"
"code-url-handler"
"neovide"
"steam"
"ferdium"
"Msty"
];
}

View File

@ -50,10 +50,12 @@ in {
|> builtins.concatStringsSep "\n")
''echo ${lib.concatStrings (lib.replicate 20 "=")}''
]);
in [
in
[
applyColors
printNixColors
];
]
++ color.extraPackages;
# This module sets its own options to the values specified in a colorscheme file.
modules.color = let

View File

@ -50,6 +50,38 @@ in rec {
default = "JetBrainsMono Nerd Font Mono";
};
cursor = lib.mkOption {
type = lib.types.str;
description = "The cursor to use";
example = "Bibata-Modern-Classic";
default = "Bibata-Modern-Classic";
};
cursorSize = lib.mkOption {
type = lib.types.int;
description = "The cursor size";
example = 24;
default = 24;
};
iconTheme = lib.mkOption {
type = lib.types.str;
description = "The icon theme to use";
example = "Papirus";
default = "Papirus";
};
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
description = "Extra packages to install";
example = ''
[
pkgs.bibata-cursors
]
'';
default = [];
};
# This option is set automatically
wallpapers = let
# Collect all the available wallpapers.

View File

@ -38,17 +38,21 @@ in {
gtk = {
enable = true;
iconTheme.package = pkgs.papirus-icon-theme;
iconTheme.name = "Papirus";
# iconTheme.package = lib.mkDefault pkgs.papirus-icon-theme;
iconTheme.name = color.iconTheme;
};
modules = {
hyprpanel.enable = hyprland.hyprpanel.enable;
};
home = {
pointerCursor = {
gtk.enable = true;
x11.enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
gtk.enable = lib.mkDefault true;
x11.enable = lib.mkDefault true;
# package = lib.mkDefault pkgs.bibata-cursors;
name = color.cursor;
size = color.cursorSize;
};
packages = with pkgs; [
@ -113,10 +117,10 @@ in {
programs = {
hyprlock = import ./hyprlock.nix {inherit config hyprland color;};
caelestia = import ./caelestia.nix {inherit config hyprland color;};
};
services = {
# TODO: Dunst shouldn't be part of the hyprland module
dunst = import ./dunst.nix {inherit pkgs config hyprland color;};
hypridle = import ./hypridle.nix {inherit config hyprland color;};
hyprpaper = import ./hyprpaper.nix {inherit config hyprland color;};

View File

@ -6,8 +6,8 @@
}: {
enable = hyprland.dunst.enable;
iconTheme.package = pkgs.papirus-icon-theme;
iconTheme.name = "Papirus";
# iconTheme.package = pkgs.papirus-icon-theme;
iconTheme.name = color.iconTheme;
settings = {
global = {

View File

@ -3,6 +3,7 @@
nixosConfig,
lib,
mylib,
inputs,
pkgs,
...
}: let
@ -18,11 +19,24 @@ in {
}
];
gtk = {
enable = true;
# iconTheme.package = pkgs.papirus-icon-theme;
iconTheme.name = color.iconTheme;
};
home = {
sessionVariables = {
# For Noctalia
# QS_ICON_THEME = "Papirus";
QT_QPA_PLATFORMTHEME = "gtk3";
QT_QPA_PLATFORMTHEME = "gtk3"; # For Noctalia
GDK_BACKEND = "wayland"; # For screen sharing
};
pointerCursor = {
gtk.enable = true;
x11.enable = true;
# package = inputs.waifu-cursors.packages.${pkgs.system}.all;
name = color.cursor;
size = color.cursorSize;
};
packages = with pkgs; [
@ -132,8 +146,8 @@ in {
cursor = {
hide-when-typing = true;
theme = "Bibata-Modern-Classic";
size = 24;
theme = color.cursor;
size = color.cursorSize;
};
layout = {