From b6a6cf44e0e6a520d6645c8ffc3d4b5a8908783c Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Mon, 4 Mar 2024 16:47:35 +0100 Subject: [PATCH] add waybar icons (needs fonts) --- common/colors.nix | 10 +++++++ common/hyprland.nix | 6 ++-- common/waybar.nix | 20 +++++++++++-- common/wofi.nix | 25 +++++++++------- flake.lock | 51 +++++++++++++++++++++++++++++++++ flake.nix | 11 +++++-- hosts/default/configuration.nix | 7 +++-- hosts/default/nvidia.nix | 2 +- 8 files changed, 110 insertions(+), 22 deletions(-) create mode 100644 common/colors.nix diff --git a/common/colors.nix b/common/colors.nix new file mode 100644 index 0000000..4f99524 --- /dev/null +++ b/common/colors.nix @@ -0,0 +1,10 @@ +{ config, pkgs, nix-colors, ... }: + +{ + imports = [ + nix-colors.homeManagerModules.default + ]; + + colorScheme = nix-colors.colorSchemes.catppuccin-macchiato; + +} diff --git a/common/hyprland.nix b/common/hyprland.nix index beefcb9..fdc18b4 100644 --- a/common/hyprland.nix +++ b/common/hyprland.nix @@ -25,7 +25,7 @@ "DP-2,1920x1080@60,0x0,1" ]; windowrulev2 = [ - "opacity 0.8 0.8,class:^(kitty)$" + "opacity 1.0 0.6,class:^(kitty)$" "stayfocused,class:^(wofi)$" ]; env = [ @@ -43,8 +43,8 @@ gaps_in = "2"; gaps_out = "3"; border_size = "3"; - "col.active_border"="0xff7c94bf"; - "col.inactive_border"="0x00ffffff"; + "col.active_border"="0xff950fad"; + "col.inactive_border"="0xff26052e"; }; decoration = { rounding = "6"; diff --git a/common/waybar.nix b/common/waybar.nix index 2d0f6d1..01d3bde 100644 --- a/common/waybar.nix +++ b/common/waybar.nix @@ -17,7 +17,7 @@ ]; modules-left = [ "hyprland/workspaces" "tray" "custom/pronouns" "custom/spotify" ]; modules-center = [ "hyprland/window" "clock" ]; - modules-right = [ "custom/vpn" "wireplumber" "network" "cpu" "memory" "keyboard-state" "custom/poweroff" ]; + modules-right = [ "custom/vpn" "wireplumber" "network" "cpu" "memory" "temperature" "custom/poweroff" ]; "clock" = { tooltip-format = "{:%Y %B}\n\n{calendar}"; interval = 1; @@ -49,13 +49,27 @@ exec-if = "test -d /proc/sys/net/ipv4/conf/tun0"; return-type = "json"; interval = 5; + }; + "temperature" = { + thermal-zone = 2; + hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; + critical-threshold = 80; + format = "{temperatureC}°C {icon}"; + format-icons = ["" "" ""]; }; "custom/poweroff" = { - # TODO fix format - format = "P"; + format = ""; on-click = "wofi-power"; on-click-right = "swaylock"; }; + "network" = { + format-wifi = "{essid} ({signalStrength}%) 󰖩"; + format-ethernet = "{ipaddr}/{cidr} 󰛳"; + tooltip-format = "{ifname} via {gwaddr} 󰛳"; + format-linked = "{ifname} (No IP) 󰛳"; + format-disconnected = "Disconnected "; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; "custom/pronouns" = { format = "{}"; exec = "${config.xdg.configHome}/waybar/pronouns"; diff --git a/common/wofi.nix b/common/wofi.nix index 3089bec..438ebd6 100644 --- a/common/wofi.nix +++ b/common/wofi.nix @@ -1,6 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ config, pkgs, inputs, nix-colors, ... }: { + imports = [ + ./colors.nix + ]; home.packages = with pkgs; [ (writeShellScriptBin "wofi-launch" '' ${wofi}/bin/wofi --show drun @@ -53,7 +56,7 @@ #window { margin: 10px; border: none; - background-color: #030035; + background-color: #${config.colorScheme.palette.base0E}; border-radius: 10px; font-family: JetBrains Mono NF, @@ -64,7 +67,7 @@ #outer-box { margin: 10px; - border: 2px @lavender; + border: 2px #${config.colorScheme.palette.base07}; border-radius: 10px; background-color: transparent; } @@ -73,17 +76,17 @@ border: none; border-radius: 10px; margin-left: 2px; - color: @text; + color: #${config.colorScheme.palette.base05}; outline-style: none; - background-color: @base; + background-color: #${config.colorScheme.palette.base00}; } #scroll { - border: 10px solid @mantle; + border: 10px solid #${config.colorScheme.palette.base06}; border-radius: 10px; /*padding-right: 10px;*/ outline: none; - background-color: @base; + background-color: #${config.colorScheme.palette.base00}; } #inner-box { @@ -99,17 +102,17 @@ margin-left: 15px;*/ padding-right: 10px; padding-left: 10px; - color: @subtext0; - background-color: @base; + color: #${config.colorScheme.palette.base02}; + background-color: #${config.colorScheme.palette.base00}; } #entry:selected { border: none; - background-color: @green; + background-color: #${config.colorScheme.palette.base0B}; } #text:selected { border: none; - color: @crust; + color: #${config.colorScheme.palette.base03}; } #img { diff --git a/flake.lock b/flake.lock index 36716d3..9cd7096 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "base16-schemes": { + "flake": false, + "locked": { + "lastModified": 1696158499, + "narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=", + "owner": "tinted-theming", + "repo": "base16-schemes", + "rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-schemes", + "type": "github" + } + }, "devshell": { "inputs": { "flake-utils": "flake-utils", @@ -172,6 +188,25 @@ "type": "github" } }, + "nix-colors": { + "inputs": { + "base16-schemes": "base16-schemes", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1707825078, + "narHash": "sha256-hTfge2J2W+42SZ7VHXkf4kjU+qzFqPeC9k66jAUBMHk=", + "owner": "misterio77", + "repo": "nix-colors", + "rev": "b01f024090d2c4fc3152cd0cf12027a7b8453ba1", + "type": "github" + }, + "original": { + "owner": "misterio77", + "repo": "nix-colors", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -209,6 +244,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1697935651, + "narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixvim": { "inputs": { "devshell": "devshell", @@ -266,6 +316,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nix-colors": "nix-colors", "nixpkgs": "nixpkgs", "nixvim": "nixvim" } diff --git a/flake.nix b/flake.nix index f1fa477..2d7d372 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,10 @@ # nixpkgs.url = "github:NixOS/nixpkgs/d8e0944e6d2ce0f326040e654c07a410e2617d47"; + nix-colors = { + url = "github:misterio77/nix-colors"; + }; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -18,7 +22,7 @@ }; - outputs = { self, nixpkgs, ... }@inputs: + outputs = { self, nixpkgs, nix-colors, ... }@inputs: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; @@ -27,7 +31,10 @@ nixosConfigurations = { default = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; + specialArgs = { + inherit inputs; + inherit nix-colors; + }; modules = [ ./hosts/default/configuration.nix inputs.home-manager.nixosModules.default diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 0edd198..3a5a31a 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, inputs, ... }: +{ config, pkgs, inputs, nix-colors, ... }: { imports = @@ -81,7 +81,10 @@ }; home-manager = { - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = { + inherit inputs; + inherit nix-colors; + }; users = { "noa" = import ./home.nix; "root" = import ./root.nix; diff --git a/hosts/default/nvidia.nix b/hosts/default/nvidia.nix index d746e2d..d9c8dd2 100644 --- a/hosts/default/nvidia.nix +++ b/hosts/default/nvidia.nix @@ -6,7 +6,7 @@ driSupport32Bit = true; }; - services.xserver.videoDriver = "nvidia"; + services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = {