From 9362212790bf3c43ee2dbde7dc19be2b2bd58e60 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 12 Jul 2023 16:43:18 +0100 Subject: [PATCH] Start restyling waybar, rename laptop to compact --- Makefile | 2 +- flake.nix | 82 +++------- home/desktop/hyprland/default.nix | 10 +- home/desktop/hyprland/hyprland.conf | 12 +- .../waybar/{laptop.nix => compact.nix} | 5 - home/desktop/waybar/main.nix | 5 - home/desktop/waybar/style.css | 122 ++------------ .../waybar/styles/colourful_bubbles.css | 151 ++++++++++++++++++ hosts/Ronin/configuration.nix | 2 + hosts/Ronin/home.nix | 34 ++++ hosts/common.nix | 35 +++- 11 files changed, 271 insertions(+), 189 deletions(-) rename home/desktop/waybar/{laptop.nix => compact.nix} (90%) create mode 100644 home/desktop/waybar/styles/colourful_bubbles.css create mode 100644 hosts/Ronin/home.nix diff --git a/Makefile b/Makefile index a3adce87..2e7701f3 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: sudo nixos-rebuild build --flake . debug: - sudo nixos-rebuild build --flake . --show-trace + sudo nixos-rebuild build --flake . --show-trace --refresh switch: sudo nixos-rebuild switch --flake . diff --git a/flake.nix b/flake.nix index 63c9f06c..d9fd22f0 100644 --- a/flake.nix +++ b/flake.nix @@ -15,19 +15,13 @@ hyprland.url = "github:hyprwm/Hyprland"; }; - outputs = { - nixpkgs, - home-manager, - wallpapers, - neovim-nightly-overlay, - hyprland, - ... - }: let + outputs = inputs: let home-manager-config = { - imports = [home-manager.nixosModules.home-manager]; + imports = [inputs.home-manager.nixosModules.home-manager]; home-manager = { useGlobalPkgs = true; useUserPackages = false; + extraSpecialArgs = {inputs = inputs;}; users.root = { imports = [./home/env/bash.nix ./home/env/starship.nix]; home = { @@ -88,8 +82,8 @@ }; in { nixosConfigurations = { - Legion = nixpkgs.lib.nixosSystem { - pkgs = import nixpkgs { + Legion = inputs.nixpkgs.lib.nixosSystem { + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; }; @@ -109,20 +103,20 @@ } ]; }; - Vanguard = nixpkgs.lib.nixosSystem { - pkgs = import nixpkgs { + Vanguard = inputs.nixpkgs.lib.nixosSystem { + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; overlays = [ waybar-experimental-overlay - neovim-nightly-overlay.overlay + inputs.neovim-nightly-overlay.overlay ]; }; modules = [ home-manager-config services chromium - hyprland.nixosModules.default + inputs.hyprland.nixosModules.default ./hosts/Vanguard ./services/sshd ./services/syncthing/Vanguard.nix @@ -143,7 +137,7 @@ }; home-manager.users.xenia = { imports = [ - hyprland.homeManagerModules.default + inputs.hyprland.homeManagerModules.default ./home/personal.nix ./home/desktop/hyprland ./home/desktop/waybar/main.nix @@ -156,76 +150,44 @@ }; programs.neovim.package = pkgs.neovim-nightly; xdg.configFile."hypr/hyprpaper.conf".text = '' - preload = ${wallpapers.outputs.default} - wallpaper = ,${wallpapers.outputs.default} + preload = ${inputs.wallpapers.outputs.default} + wallpaper = ,${inputs.wallpapers.outputs.default} ''; xdg.configFile."hypr/display.conf".text = '' monitor=DP-1,highrr,auto,1 monitor=DP-2,highrr,auto,1 monitor=HDMI-1,highres,auto,2 monitor=HDMI-2,highres,auto,2 - monitor=,preferred,auto,auto + ''; + xdg.configFile."hypr/autostart.conf".text = '' exec-once=gamescope -w 1920 -h 1080 -W 3840 -H 2160 -U -f --hdr-enabled -e -- steam -gamepadui ''; }; }) ]; }; - Ronin = nixpkgs.lib.nixosSystem { - pkgs = import nixpkgs { + Ronin = inputs.nixpkgs.lib.nixosSystem { + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; overlays = [ waybar-experimental-overlay - neovim-nightly-overlay.overlay + inputs.neovim-nightly-overlay.overlay ]; }; modules = [ home-manager-config services chromium - hyprland.nixosModules.default + inputs.hyprland.nixosModules.default ./hosts/Ronin ./services/syncthing/Ronin.nix - ({pkgs, ...}: { - programs.hyprland.enable = true; - home-manager.users.elitherl = { - imports = [ - hyprland.homeManagerModules.default - ./home/work.nix - ./home/desktop/hyprland - ./home/desktop/waybar/main.nix - ./home/desktop/waybar/laptop.nix - ./home/gui - ]; - home = { - username = "elitherl"; - homeDirectory = "/home/elitherl"; - stateVersion = "22.11"; - }; - programs.neovim.package = pkgs.neovim-nightly; - programs.waybar.settings = { - main."output" = "DP-5"; - compact."output" = ["eDP-1" "DP-3"]; - }; - xdg.configFile."hypr/hyprpaper.conf".text = '' - preload = ${wallpapers.outputs.default} - wallpaper = ,${wallpapers.outputs.default} - ''; - xdg.configFile."hypr/display.conf".text = '' - monitor=desc:Iiyama North America PLB2403WS 0574281251316,1920x1200@60,0x185,1 - monitor=desc:Dell Inc. DELL U2417H 5K9YD872FY1L,1920x1080@60,1920x0,1,transform,1 - monitor=eDP-1,1920x1080@60,640x1385,1.5 - monitor=,preferred,auto,auto - ''; - }; - }) ]; }; }; homeConfigurations = { - "tux@Monarch" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages."aarch64-darwin"; + "tux@Monarch" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages."aarch64-darwin"; modules = [ ({pkgs, ...}: { imports = [./home/personal.nix ./home/gui/wezterm.nix]; @@ -248,8 +210,8 @@ }) ]; }; - "xenia@Northstar" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages."aarch64-linux"; + "xenia@Northstar" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages."aarch64-linux"; modules = [ { imports = [./home/personal.nix]; diff --git a/home/desktop/hyprland/default.nix b/home/desktop/hyprland/default.nix index 04b29d1f..0e3a2b72 100644 --- a/home/desktop/hyprland/default.nix +++ b/home/desktop/hyprland/default.nix @@ -1,4 +1,5 @@ { + inputs, pkgs, lib, config, @@ -24,7 +25,7 @@ }; in { imports = [ - ../eww + # ../eww ../waybar ../rofi ../swaylock.nix @@ -54,8 +55,11 @@ in { }; extraConfig = builtins.readFile ./hyprland.conf; }; - xdg.configFile."hypr/display.conf".text = lib.mkDefault '' - monitor=,preferred,auto,auto + xdg.configFile."hypr/hyprpaper.conf".text = lib.mkDefault '' + preload = ${inputs.wallpapers.outputs.default} + wallpaper = ,${inputs.wallpapers.outputs.default} ''; xdg.configFile."hypr/macchiato.conf".source = ./macchiato.conf; + xdg.configFile."hypr/display.conf".text = lib.mkDefault ''''; + xdg.configFile."hypr/autostart.conf".text = lib.mkDefault ''''; } diff --git a/home/desktop/hyprland/hyprland.conf b/home/desktop/hyprland/hyprland.conf index a0dc56e6..5bb0afe9 100644 --- a/home/desktop/hyprland/hyprland.conf +++ b/home/desktop/hyprland/hyprland.conf @@ -1,8 +1,12 @@ +source = ./macchiato.conf +source = ./display.conf +source = ./autostart.conf + exec-once = dunst exec-once = hyprpaper exec-once = waybar -source = ./macchiato.conf -source = ./display.conf + +monitor=,preferred,auto,auto env = XDG_CURRENT_DESKTOP=Hyprland env = XDG_SESSION_TYPE=wayland @@ -26,11 +30,12 @@ input { general { gaps_in = 5 gaps_out = 20 - border_size = 2 + border_size = 3 col.active_border = $mauve col.group_border_active = $mauve col.inactive_border = $surface2 col.group_border = $surface2 + cursor_inactive_timeout = 5 layout = dwindle } @@ -49,7 +54,6 @@ decoration { drop_shadow = yes shadow_range = 4 shadow_render_power = 3 - col.shadow = $base } animations { diff --git a/home/desktop/waybar/laptop.nix b/home/desktop/waybar/compact.nix similarity index 90% rename from home/desktop/waybar/laptop.nix rename to home/desktop/waybar/compact.nix index bccd6c05..93329704 100644 --- a/home/desktop/waybar/laptop.nix +++ b/home/desktop/waybar/compact.nix @@ -3,11 +3,6 @@ programs.waybar.settings.compact = { layer = "top"; position = "top"; - spacing = 10; - margin-top = 10; - margin-left = 20; - margin-right = 20; - margin-bottom = 5; "modules-left" = [ "wlr/workspaces" "cpu" diff --git a/home/desktop/waybar/main.nix b/home/desktop/waybar/main.nix index a66715f3..0f5dd221 100644 --- a/home/desktop/waybar/main.nix +++ b/home/desktop/waybar/main.nix @@ -3,11 +3,6 @@ programs.waybar.settings.main = { layer = "top"; position = "top"; - spacing = 10; - margin-top = 10; - margin-left = 20; - margin-right = 20; - margin-bottom = 5; "modules-left" = [ "wlr/workspaces" "cpu" diff --git a/home/desktop/waybar/style.css b/home/desktop/waybar/style.css index 6959c4c5..afcf6263 100644 --- a/home/desktop/waybar/style.css +++ b/home/desktop/waybar/style.css @@ -32,120 +32,24 @@ * { border: none; border-radius: 10px; + background: transparent; + color: @text; font-family: "FiraCode Nerd Font"; font-size: 18px; } -window#waybar { - background: transparent; -} -window#waybar.hidden { - opacity: 0.2; -} -#window { - margin-top: 6px; - padding-left: 10px; - padding-right: 10px; - border-radius: 10px; - transition: none; - color: transparent; - background: transparent; +.modules-left, +.modules-center, +.modules-right { + background: @base; + border: 3px solid @mauve; + color: @text; } -#workspaces button { - transition: none; - color: @overlay0; - box-shadow: inset 0 -3px transparent; - border-radius: 2px; +tooltip { + background: rgba(43, 48, 59, 0.5); + border: 3px solid rgba(100, 114, 125, 0.5); } -#workspaces button.active, -#workspaces button.focused { - color: @base; -} -#workspaces button:hover { - transition: none; - box-shadow: inherit; - text-shadow: inherit; - color: @base; - border-color: #e8a2af; - color: @base; -} -#workspaces button.focused:hover { - color: @base; -} - -/* left section */ -#workspaces, -#cpu, -#memory, -#temperature, -/* centre section */ -#clock, -/* right section */ -#pulseaudio, -#bluetooth, -#network, -#backlight, -#battery, -#tray { - margin-top: 0px; - margin-bottom: 0px; - margin-left: 0px; - margin-right: 0px; - padding-left: 10px; - padding-right: 10px; - transition: none; - color: @crust; - background: @lavender; -} - -#workspaces { - background: @lavender; -} -#cpu { - background: @pink; -} -#memory { - background: @mauve; -} -#temperature { - background: @red; -} -#clock { - background: @yellow; -} -#pulseaudio { - background: @green; -} -#bluetooth { - background: @teal; -} -#network { - background: @sky; -} -#backlight { - background: @sapphire; -} -#battery { - background: @blue; -} -#battery.charging, -#battery.plugged { - background-color: @blue; -} -#battery.critical:not(.charging) { - background-color: @blue; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} -@keyframes blink { -to { - color: @red; -} -} -#tray { - color: @base; +tooltip label { + color: white; } diff --git a/home/desktop/waybar/styles/colourful_bubbles.css b/home/desktop/waybar/styles/colourful_bubbles.css new file mode 100644 index 00000000..6959c4c5 --- /dev/null +++ b/home/desktop/waybar/styles/colourful_bubbles.css @@ -0,0 +1,151 @@ +@define-color base #24273a; +@define-color mantle #1e2030; +@define-color crust #181926; + +@define-color text #cad3f5; +@define-color subtext0 #a5adcb; +@define-color subtext1 #b8c0e0; + +@define-color surface0 #363a4f; +@define-color surface1 #494d64; +@define-color surface2 #5b6078; + +@define-color overlay0 #6e738d; +@define-color overlay1 #8087a2; +@define-color overlay2 #939ab7; + +@define-color blue #8aadf4; +@define-color lavender #b7bdf8; +@define-color sapphire #7dc4e4; +@define-color sky #91d7e3; +@define-color teal #8bd5ca; +@define-color green #a6da95; +@define-color yellow #eed49f; +@define-color peach #f5a97f; +@define-color maroon #ee99a0; +@define-color red #ed8796; +@define-color mauve #c6a0f6; +@define-color pink #f5bde6; +@define-color flamingo #f0c6c6; +@define-color rosewater #f4dbd6; + +* { + border: none; + border-radius: 10px; + font-family: "FiraCode Nerd Font"; + font-size: 18px; +} + +window#waybar { + background: transparent; +} +window#waybar.hidden { + opacity: 0.2; +} +#window { + margin-top: 6px; + padding-left: 10px; + padding-right: 10px; + border-radius: 10px; + transition: none; + color: transparent; + background: transparent; +} + +#workspaces button { + transition: none; + color: @overlay0; + box-shadow: inset 0 -3px transparent; + border-radius: 2px; +} +#workspaces button.active, +#workspaces button.focused { + color: @base; +} +#workspaces button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + color: @base; + border-color: #e8a2af; + color: @base; +} +#workspaces button.focused:hover { + color: @base; +} + +/* left section */ +#workspaces, +#cpu, +#memory, +#temperature, +/* centre section */ +#clock, +/* right section */ +#pulseaudio, +#bluetooth, +#network, +#backlight, +#battery, +#tray { + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + margin-right: 0px; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: @crust; + background: @lavender; +} + +#workspaces { + background: @lavender; +} +#cpu { + background: @pink; +} +#memory { + background: @mauve; +} +#temperature { + background: @red; +} +#clock { + background: @yellow; +} +#pulseaudio { + background: @green; +} +#bluetooth { + background: @teal; +} +#network { + background: @sky; +} +#backlight { + background: @sapphire; +} +#battery { + background: @blue; +} +#battery.charging, +#battery.plugged { + background-color: @blue; +} +#battery.critical:not(.charging) { + background-color: @blue; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} +@keyframes blink { +to { + color: @red; +} +} +#tray { + color: @base; +} diff --git a/hosts/Ronin/configuration.nix b/hosts/Ronin/configuration.nix index 51c8795b..733afe62 100644 --- a/hosts/Ronin/configuration.nix +++ b/hosts/Ronin/configuration.nix @@ -38,6 +38,8 @@ in { extraGroups = ["networkmanager" "wheel"]; shell = pkgs.fish; }; + home-manager.users.elitherl = import ./home.nix; + programs.hyprland.enable = true; services.greetd = { enable = true; settings = { diff --git a/hosts/Ronin/home.nix b/hosts/Ronin/home.nix new file mode 100644 index 00000000..6ed09d36 --- /dev/null +++ b/hosts/Ronin/home.nix @@ -0,0 +1,34 @@ +{ + pkgs, + inputs, + ... +}: { + imports = [ + inputs.hyprland.homeManagerModules.default + # ../../pkgs/eww-hyprland + ../../home/work.nix + ../../home/desktop/hyprland + ../../home/desktop/waybar/main.nix + ../../home/desktop/waybar/compact.nix + ../../home/gui + ]; + home = { + username = "elitherl"; + homeDirectory = "/home/elitherl"; + stateVersion = "22.11"; + }; + programs.neovim.package = pkgs.neovim-nightly; + # programs.eww-hyprland = { + # enable = true; + # package = pkgs.eww-wayland; + # }; + programs.waybar.settings = { + main."output" = "DP-5"; + compact."output" = ["eDP-1" "DP-3"]; + }; + xdg.configFile."hypr/display.conf".text = '' + monitor=desc:Iiyama North America PLB2403WS 0574281251316,1920x1200@60,0x185,1 + monitor=desc:Dell Inc. DELL U2417H 5K9YD872FY1L,1920x1080@60,1920x0,1,transform,1 + monitor=eDP-1,1920x1080@60,640x1385,1.5 + ''; +} diff --git a/hosts/common.nix b/hosts/common.nix index 9c409492..65037f09 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,4 +1,4 @@ -{...}: { +{pkgs, ...}: { nix = { settings.experimental-features = ["nix-command" "flakes"]; gc = { @@ -24,7 +24,38 @@ fish.enable = true; zsh.enable = true; }; - fonts.fontconfig.enable = true; + fonts = { + fonts = with pkgs; [ + # icon fonts + material-symbols + + # normal fonts + jost + lexend + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + roboto + + # nerdfonts + (nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];}) + ]; + + # use fonts specified by user rather than default ones + enableDefaultFonts = false; + fontconfig = { + enable = true; + # user defined fonts + # the reason there's Noto Color Emoji everywhere is to override DejaVu's + # B&W emojis that would sometimes show instead of some Color emojis + defaultFonts = { + serif = ["Noto Serif" "Noto Color Emoji"]; + sansSerif = ["Noto Sans" "Noto Color Emoji"]; + monospace = ["JetBrainsMono Nerd Font" "Noto Color Emoji"]; + emoji = ["Noto Color Emoji"]; + }; + }; + }; environment = { localBinInPath = true; shellAliases = {