diff --git a/config/dotfiles/.config/kitty/kitty.conf b/config/dotfiles/.config/kitty/kitty.conf index a837d83..5e3c816 100644 --- a/config/dotfiles/.config/kitty/kitty.conf +++ b/config/dotfiles/.config/kitty/kitty.conf @@ -7,6 +7,6 @@ confirm_os_window_close 0 background_opacity 0.7 -font_family DejaVuSansM Nerd Font Mono -bold_font DejaVuSansM Nerd Font Mono Bold -bold_italic_font DejaVuSansM Nerd Font Mono Bold Oblique +font_family Hasklug Nerd Font +bold_font auto +bold_italic_font auto diff --git a/machines/terra/modules.nix b/machines/terra/modules.nix index d9d959d..37aafdf 100644 --- a/machines/terra/modules.nix +++ b/machines/terra/modules.nix @@ -28,6 +28,7 @@ x = 0; y = 0; wallpaper = ../../misc/landscape.png; + bar = "right"; } { output = "DP-3"; @@ -35,6 +36,7 @@ y = 0; transform = 1; wallpaper = ../../misc/portrait.png; + bar = "top"; } ]; bindWorkspaces = "interlaced"; diff --git a/modules/apps/visual.nix b/modules/apps/visual.nix index d7626f7..cb7e235 100644 --- a/modules/apps/visual.nix +++ b/modules/apps/visual.nix @@ -39,7 +39,7 @@ in { ]; fonts.packages = with pkgs; [ - nerd-fonts.dejavu-sans-mono + nerd-fonts.hasklug ]; }; } diff --git a/modules/terminal/zsh.nix b/modules/terminal/zsh.nix index 3a427cf..4605a63 100644 --- a/modules/terminal/zsh.nix +++ b/modules/terminal/zsh.nix @@ -35,14 +35,13 @@ in { l = "ls -lAh --group-directories-first"; zip = "zip -r"; cat = "bat"; + py = "python3"; }; ohMyZsh = { enable = true; plugins = [ - "git" "zsh-interactive-cd" - "python" "git-auto-fetch" "wd" ]; diff --git a/modules/wm/hyprland/animations.nix b/modules/wm/hyprland/animations.nix new file mode 100644 index 0000000..d09f256 --- /dev/null +++ b/modules/wm/hyprland/animations.nix @@ -0,0 +1,159 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf; + cfg = config.horseman.wm.hyprland; +in { + config = mkIf cfg.enable { + horseman.wm.hyprland.config = { + animations = { + enabled = true; + beziers = [ + { + name = "easeOutQuint"; + startX = 0.23; + startY = 1.0; + endX = 0.32; + endY = 1.0; + } + { + name = "easeInOutCubic"; + startX = 0.65; + startY = 0.05; + endX = 0.36; + endY = 1.0; + } + { + name = "linear"; + startX = 0.0; + startY = 0.0; + endX = 1.0; + endY = 1.0; + } + { + name = "almostLinear"; + startX = 0.5; + startY = 0.5; + endX = 0.75; + endY = 1.0; + } + { + name = "quick"; + startX = 0.15; + startY = 0.0; + endX = 0.1; + endY = 1.0; + } + ]; + + animations = [ + { + name = "global"; + on = true; + speed = 10.0; + curve = "default"; + } + { + name = "border"; + on = true; + speed = 5.39; + curve = "easeOutQuint"; + } + { + name = "windows"; + on = true; + speed = 4.79; + curve = "easeOutQuint"; + } + { + name = "windowsIn"; + on = true; + speed = 4.1; + curve = "easeOutQuint"; + style = "popin 87%"; + } + { + name = "windowsOut"; + on = true; + speed = 1.49; + curve = "linear"; + style = "popin 87%"; + } + { + name = "fadeIn"; + on = true; + speed = 1.73; + curve = "almostLinear"; + } + { + name = "fadeOut"; + on = true; + speed = 1.46; + curve = "almostLinear"; + } + { + name = "fade"; + on = true; + speed = 3.03; + curve = "quick"; + } + { + name = "layers"; + on = true; + speed = 3.81; + curve = "easeOutQuint"; + } + { + name = "layersIn"; + on = true; + speed = 4.0; + curve = "easeOutQuint"; + style = "fade"; + } + { + name = "layersOut"; + on = true; + speed = 1.5; + curve = "linear"; + style = "fade"; + } + { + name = "fadeLayersIn"; + on = true; + speed = 1.79; + curve = "almostLinear"; + } + { + name = "fadeLayersOut"; + on = true; + speed = 1.39; + curve = "almostLinear"; + } + { + name = "workspaces"; + on = true; + speed = 1.94; + curve = "almostLinear"; + style = "fade"; + } + { + name = "workspacesIn"; + on = true; + speed = 1.21; + curve = "almostLinear"; + style = "fade"; + } + { + name = "workspacesOut"; + on = true; + speed = 1.94; + curve = "almostLinear"; + style = "fade"; + } + ]; + }; + }; + }; +} diff --git a/modules/wm/hyprland/config/waybar/style.css b/modules/wm/hyprland/config/waybar/style.css index 69a9098..bfd51da 100644 --- a/modules/wm/hyprland/config/waybar/style.css +++ b/modules/wm/hyprland/config/waybar/style.css @@ -53,7 +53,7 @@ * { font-size: 15px; - font-family: "Zed Mono Nerd Font"; + font-family: "Hasklug Nerd Font"; } window#waybar{ diff --git a/modules/wm/hyprland/default.nix b/modules/wm/hyprland/default.nix index db16b00..1dbdffa 100644 --- a/modules/wm/hyprland/default.nix +++ b/modules/wm/hyprland/default.nix @@ -11,6 +11,7 @@ in { imports = [ ./options.nix ./keybindings.nix + ./animations.nix ]; options = { @@ -45,194 +46,6 @@ in { xdg-desktop-portal-hyprland ]; - home-manager.users.${homeCfg.username} = { - programs.waybar = { - enable = true; - - settings = { - horizontalBar = { - layer = "top"; - position = "top"; - output = [ - "DP-3" - ]; - modules-left = ["group/power"]; - modules-center = ["hyprland/workspaces"]; - modules-right = ["network" "pulseaudio" "memory" "cpu" "clock"]; - - "clock" = { - interval = 1; - format = "{:%H:%M:%S}"; - tooltip-format = "{:%a %d %b %Y}"; - }; - - "cpu" = { - interval = 3; - format = " {usage}%"; - on-click = "kitty btop &"; - }; - - "memory" = { - interval = 3; - format = " {percentage}%"; - on-click = "kitty btop &"; - }; - - "pulseaudio" = { - format = " {volume}"; - on-click = "kitty pulsemixer &"; - }; - - "network" = { - interval = 3; - format = "{ipaddr}"; - format-ethernet = " {ipaddr}"; - format-disconnected = "󰣽 Disconnected"; - format-wifi = "󰤨 {essid}"; - - tooltip = false; - }; - - "battery" = { - interval = 3; - # TODO This needs to be fixed - }; - - "hyprland/workspaces" = { - format = "{icon}"; - format-icons = { - "active" = ""; - "default" = ""; - "empty" = ""; - }; - persistent-workspaces = { - "*" = [1 2 3 4 5 6 7 8 9 10]; - }; - }; - - "group/power" = { - orientation = "horizontal"; - drawer = { - }; - modules = [ - "custom/power" - "custom/reboot" - "custom/lock" - "idle_inhibitor" - ]; - }; - - "custom/lock" = { - format = "󰍁 "; - tooltip = false; - on-click = "hyprlock"; - }; - "custom/reboot" = { - format = "󰜉 "; - tooltip = false; - on-click = "reboot"; - }; - "custom/power" = { - format = " "; - tooltip = false; - on-click = "shutdown now"; - }; - "idle_inhibitor" = { - tooltip = false; - format = "{icon}"; - format-icons = { - deactivated = "󰒲 "; - activated = "󰒳 "; - }; - }; - }; - - verticalBar = { - layer = "top"; - position = "right"; - output = [ - "eDP-1" - ]; - modules-left = ["group/power"]; - modules-center = ["hyprland/workspaces"]; - modules-right = ["battery" "clock"]; - - "clock" = { - interval = 1; - format = "{:%H\n%M\n%S}"; - tooltip-format = "{:%a %d %b %Y}"; - }; - - "cpu" = { - interval = 3; - format = "\n{usage}%"; - on-click = "kitty btop &"; - }; - - "memory" = { - interval = 3; - format = "\n{percentage}%"; - on-click = "kitty btop &"; - }; - - "battery" = { - interval = 3; - # TODO This needs to be fixed - }; - - "hyprland/workspaces" = { - format = "{icon}"; - format-icons = { - "active" = ""; - "default" = ""; - "empty" = ""; - }; - persistent-workspaces = { - "*" = [1 2 3 4 5 6 7 8 9 10]; - }; - }; - - "group/power" = { - orientation = "vertical"; - drawer = { - }; - modules = [ - "custom/power" - "custom/reboot" - "custom/lock" - "idle_inhibitor" - ]; - }; - - "custom/lock" = { - format = "󰍁 "; - tooltip = false; - on-click = "hyprlock"; - }; - "custom/reboot" = { - format = "󰜉 "; - tooltip = false; - on-click = "reboot"; - }; - "custom/power" = { - format = " "; - tooltip = false; - on-click = "shutdown now"; - }; - "idle_inhibitor" = { - tooltip = false; - format = "{icon}"; - format-icons = { - deactivated = "󰒲 "; - activated = "󰒳 "; - }; - }; - }; - }; - }; - xdg.configFile."waybar/style.css".source = ./config/waybar/style.css; - }; - horseman.wm.hyprland.config = { execOnce = [ "hyprpaper" @@ -302,153 +115,6 @@ in { }; }; - animations = { - enabled = true; - beziers = [ - { - name = "easeOutQuint"; - startX = 0.23; - startY = 1.0; - endX = 0.32; - endY = 1.0; - } - { - name = "easeInOutCubic"; - startX = 0.65; - startY = 0.05; - endX = 0.36; - endY = 1.0; - } - { - name = "linear"; - startX = 0.0; - startY = 0.0; - endX = 1.0; - endY = 1.0; - } - { - name = "almostLinear"; - startX = 0.5; - startY = 0.5; - endX = 0.75; - endY = 1.0; - } - { - name = "quick"; - startX = 0.15; - startY = 0.0; - endX = 0.1; - endY = 1.0; - } - ]; - - animations = [ - { - name = "global"; - on = true; - speed = 10.0; - curve = "default"; - } - { - name = "border"; - on = true; - speed = 5.39; - curve = "easeOutQuint"; - } - { - name = "windows"; - on = true; - speed = 4.79; - curve = "easeOutQuint"; - } - { - name = "windowsIn"; - on = true; - speed = 4.1; - curve = "easeOutQuint"; - style = "popin 87%"; - } - { - name = "windowsOut"; - on = true; - speed = 1.49; - curve = "linear"; - style = "popin 87%"; - } - { - name = "fadeIn"; - on = true; - speed = 1.73; - curve = "almostLinear"; - } - { - name = "fadeOut"; - on = true; - speed = 1.46; - curve = "almostLinear"; - } - { - name = "fade"; - on = true; - speed = 3.03; - curve = "quick"; - } - { - name = "layers"; - on = true; - speed = 3.81; - curve = "easeOutQuint"; - } - { - name = "layersIn"; - on = true; - speed = 4.0; - curve = "easeOutQuint"; - style = "fade"; - } - { - name = "layersOut"; - on = true; - speed = 1.5; - curve = "linear"; - style = "fade"; - } - { - name = "fadeLayersIn"; - on = true; - speed = 1.79; - curve = "almostLinear"; - } - { - name = "fadeLayersOut"; - on = true; - speed = 1.39; - curve = "almostLinear"; - } - { - name = "workspaces"; - on = true; - speed = 1.94; - curve = "almostLinear"; - style = "fade"; - } - { - name = "workspacesIn"; - on = true; - speed = 1.21; - curve = "almostLinear"; - style = "fade"; - } - { - name = "workspacesOut"; - on = true; - speed = 1.94; - curve = "almostLinear"; - style = "fade"; - } - ]; - }; - dwindle = { pseudotile = true; preserveSplit = true; @@ -529,6 +195,109 @@ in { } ]; }; + + waybar = { + formats = { + horizontal = { + "clock" = { + format = "󰥔 {:%H:%M:%S}"; + format-alt = "{:%a %d %b %Y}"; + }; + }; + vertical = { + "clock" = { + format = "{:%H\n%M\n%S}"; + format-alt = "{:%d\n%m\n%y}"; + }; + }; + }; + modules = { + "clock" = { + interval = 1; + tooltip = false; + }; + + "cpu" = { + interval = 3; + format = " {usage}%"; + on-click = "kitty btop &"; + }; + + "memory" = { + interval = 3; + format = " {percentage}%"; + on-click = "kitty btop &"; + }; + + "pulseaudio" = { + format = " {volume}"; + on-click = "kitty pulsemixer &"; + }; + + "network" = { + interval = 3; + format = "{ipaddr}"; + format-ethernet = " {ipaddr}"; + format-disconnected = "󰣽 Disconnected"; + format-wifi = "󰤨 {essid}"; + + tooltip = false; + }; + + "battery" = { + interval = 3; + # TODO This needs to be fixed + }; + + "hyprland/workspaces" = { + format = "{icon}"; + format-icons = { + "active" = ""; + "default" = ""; + "empty" = ""; + }; + persistent-workspaces = { + "*" = [1 2 3 4 5 6 7 8 9 10]; + }; + }; + + "group/power" = { + orientation = "horizontal"; + drawer = { + }; + modules = [ + "custom/power" + "custom/reboot" + "custom/lock" + "idle_inhibitor" + ]; + }; + + "custom/lock" = { + format = "󰍁 "; + tooltip = false; + on-click = "hyprlock"; + }; + "custom/reboot" = { + format = "󰜉 "; + tooltip = false; + on-click = "reboot"; + }; + "custom/power" = { + format = " "; + tooltip = false; + on-click = "shutdown now"; + }; + "idle_inhibitor" = { + tooltip = false; + format = "{icon}"; + format-icons = { + deactivated = "󰒲 "; + activated = "󰒳 "; + }; + }; + }; + }; }; services.logind.extraConfig = '' diff --git a/modules/wm/hyprland/options.nix b/modules/wm/hyprland/options.nix index 50d2576..f11bb54 100644 --- a/modules/wm/hyprland/options.nix +++ b/modules/wm/hyprland/options.nix @@ -3,10 +3,11 @@ config, ... }: let - inherit (lib) mkOption types mkIf trivial strings; + inherit (lib) mkOption types mkIf trivial strings lists; inherit (builtins) concatStringsSep elem genList elemAt; inherit (trivial) boolToString; inherit (strings) floatToString; + inherit (lists) remove; cfg = config.horseman.wm.hyprland; homeCfg = config.horseman; @@ -1175,6 +1176,10 @@ in { type = types.nullOr types.path; default = null; }; + bar = mkOption { + type = types.enum ["" "left" "right" "top" "bottom"]; + default = ""; + }; }; }); }; @@ -1215,6 +1220,20 @@ in { }); }; }; + + waybar = { + formats = { + horizontal = mkOption { + type = types.attrs; + }; + vertical = mkOption { + type = types.attrs; + }; + }; + modules = mkOption { + type = types.attrs; + }; + }; }; config = mkIf cfg.enable { @@ -1676,6 +1695,71 @@ in { ) } ''; + + programs.waybar = { + enable = true; + + settings = let + outputMap = location: ( + remove null ( + map (disp: + if (disp.bar == location) + then disp.output + else null) + cfg.config.monitors.displays + ) + ); + in { + topBar = + { + layer = "top"; + position = "top"; + output = outputMap "top"; + + modules-left = ["group/power"]; + modules-center = ["hyprland/workspaces"]; + modules-right = ["network" "pulseaudio" "memory" "cpu" "clock"]; + } + // cfg.config.waybar.modules // cfg.config.waybar.formats.horizontal; + + bottomBar = + { + layer = "top"; + position = "bottom"; + output = outputMap "bottom"; + + modules-left = ["group/power"]; + modules-center = ["hyprland/workspaces"]; + modules-right = ["network" "pulseaudio" "memory" "cpu" "clock"]; + } + // cfg.config.waybar.modules // cfg.config.waybar.formats.horizontal; + + rightBar = + { + layer = "top"; + position = "right"; + output = outputMap "right"; + + modules-left = ["group/power"]; + modules-center = ["hyprland/workspaces"]; + modules-right = ["battery" "clock"]; + } + // cfg.config.waybar.modules // cfg.config.waybar.formats.vertical; + + leftBar = + { + layer = "top"; + position = "left"; + output = outputMap "left"; + + modules-left = ["group/power"]; + modules-center = ["hyprland/workspaces"]; + modules-right = ["battery" "clock"]; + } + // cfg.config.waybar.modules // cfg.config.waybar.formats.vertical; + }; + }; + xdg.configFile."waybar/style.css".source = ./config/waybar/style.css; }; }; }