diff --git a/home/christoph/default.nix b/home/christoph/default.nix index 1fac55f3..9a2b934a 100644 --- a/home/christoph/default.nix +++ b/home/christoph/default.nix @@ -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 = { + # "" = ""; + "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; diff --git a/home/christoph/hyprland.nix b/home/christoph/hyprland.nix deleted file mode 100644 index fb3de9f7..00000000 --- a/home/christoph/hyprland.nix +++ /dev/null @@ -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 = { - # "" = ""; - "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" - ]; -} diff --git a/home/modules/color/default.nix b/home/modules/color/default.nix index 92a53b86..f43527f8 100644 --- a/home/modules/color/default.nix +++ b/home/modules/color/default.nix @@ -50,10 +50,12 @@ in { |> builtins.concatStringsSep "\n") ''echo ${lib.concatStrings (lib.replicate 20 "=")}'' ]); - in [ - applyColors - printNixColors - ]; + in + [ + applyColors + printNixColors + ] + ++ color.extraPackages; # This module sets its own options to the values specified in a colorscheme file. modules.color = let diff --git a/home/modules/color/options.nix b/home/modules/color/options.nix index 8b465d2c..d5a6101e 100644 --- a/home/modules/color/options.nix +++ b/home/modules/color/options.nix @@ -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. diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index 17649577..11704737 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -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;}; diff --git a/home/modules/hyprland/dunst.nix b/home/modules/hyprland/dunst.nix index b75f345b..c28d6976 100644 --- a/home/modules/hyprland/dunst.nix +++ b/home/modules/hyprland/dunst.nix @@ -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 = { diff --git a/home/modules/niri/default.nix b/home/modules/niri/default.nix index b00a803d..a315a6ac 100644 --- a/home/modules/niri/default.nix +++ b/home/modules/niri/default.nix @@ -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 = {