From 35248129b5550f5d4e370c4aa94f86fd0bc37377 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Fri, 20 Jan 2023 21:43:16 +0100 Subject: [PATCH] finished color configuration --- users/rouven/modules/hyprland/default.nix | 66 +++++-- users/rouven/modules/hyprland/hyprland.conf | 2 +- users/rouven/modules/hyprland/waybar.nix | 166 ++++++++++++++++++ .../modules/hyprland/wofi-config/config | 2 - .../modules/hyprland/wofi-config/style.css | 46 ----- users/rouven/modules/packages.nix | 1 - 6 files changed, 219 insertions(+), 64 deletions(-) create mode 100644 users/rouven/modules/hyprland/waybar.nix delete mode 100644 users/rouven/modules/hyprland/wofi-config/config delete mode 100644 users/rouven/modules/hyprland/wofi-config/style.css diff --git a/users/rouven/modules/hyprland/default.nix b/users/rouven/modules/hyprland/default.nix index fac7a2e..50344af 100644 --- a/users/rouven/modules/hyprland/default.nix +++ b/users/rouven/modules/hyprland/default.nix @@ -1,30 +1,68 @@ { config, pkgs, hyprpaper, ... }: { + imports = [ ./waybar.nix ]; wayland.windowManager.hyprland.enable = true; xdg.configFile."hypr/hyprland.conf".source = ./hyprland.conf; xdg.configFile."hypr/hyprpaper.conf".text = '' preload = ${../../../../images/wallpaper.png} - wallpaper =, ${../../../../images/wallpaper.png} + wallpaper =eDP-1, ${../../../../images/wallpaper.png} + wallpaper =HDMI-A-1, ${../../../../images/wallpaper.png} ''; - # TODO integrate this to nix-colors - xdg.configFile."wofi".source = ./wofi-config; - home.packages = [ - pkgs.wofi + home.packages = with pkgs; [ + wofi + font-awesome hyprpaper.packages.x86_64-linux.default ]; - programs.waybar = { - enable = true; - #settings = { - #mainBar = { - #layer = "top"; - #position = "top"; - #}; - #}; - }; + xdg.configFile."wofi/config".text = '' + allow_images = true + term = alacritty + ''; + + xdg.configFile."wofi/style.css".text = '' + window { + margin: 0px; + border: 1px solid #${config.colorScheme.colors.base0D}; + background-color: #${config.colorScheme.colors.base00}; + } + + #input { + margin: 5px; + border: none; + color: #${config.colorScheme.colors.base05}; + background-color: #${config.colorScheme.colors.base02}; + } + + + #inner-box, + #outer-box { + margin: 5px; + border: none; + background-color: #${config.colorScheme.colors.base00}; + } + + + #text { + margin: 5px; + border: none; + color: #${config.colorScheme.colors.base05}; + } + + #entry:selected { + background-color: #${config.colorScheme.colors.base01}; + } + + #entry:nth-child(even), + #entry:nth-child(odd){ + background-color: #${config.colorScheme.colors.base02}; + } + ''; + programs.mako = { enable = true; backgroundColor = "#${config.colorScheme.colors.base00}FF"; + textColor = "#${config.colorScheme.colors.base05}FF"; + #defaultTimeout = 10; }; } diff --git a/users/rouven/modules/hyprland/hyprland.conf b/users/rouven/modules/hyprland/hyprland.conf index af5f20c..3b8f6f9 100644 --- a/users/rouven/modules/hyprland/hyprland.conf +++ b/users/rouven/modules/hyprland/hyprland.conf @@ -80,7 +80,7 @@ master { gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = off + workspace_swipe = on } # Example windowrule v1 diff --git a/users/rouven/modules/hyprland/waybar.nix b/users/rouven/modules/hyprland/waybar.nix new file mode 100644 index 0000000..5fcf175 --- /dev/null +++ b/users/rouven/modules/hyprland/waybar.nix @@ -0,0 +1,166 @@ +{ config, pkgs, ... }: +{ + programs.waybar = { + enable = true; + package = pkgs.waybar.overrideAttrs (oldAttrs: { + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + }); + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 26; + modules-left = [ "wlr/workspaces" ]; + modules-right = [ "network" "cpu" "temperature" "pulseaudio" "battery" "tray" "clock" ]; + 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}"; + }; + cpu = { + format = "{usage}% "; + }; + temperature = { + critical-threshold = 80; + format = "{temperatureC}°C {icon}"; + format-icons = [ "" ]; + }; + pulseaudio = { + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = "{volume}% "; + format-source-muted = ""; + format-icons = { + headphone = ""; + headset = ""; + default = [ "" "" "" ]; + }; + on-click = "pavucontrol"; + }; + battery = { + states = { + warning = 30; + critical = 15; + }; + format = "{capacity}% {icon}"; + format-charging = "{capacity}% "; + format-plugged = "{capacity}% "; + format-icons = [ "" "" "" "" "" ]; + }; + tray = { + spacing = 10; + }; + }; + }; + }; + + xdg.configFile."waybar/style.css".text = '' + * { + font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; + } + + window#waybar { + background-color: transparent; + color: #${config.colorScheme.colors.base05}; + transition-property: background-color; + transition-duration: .5s; + } + + window#waybar.hidden { + background-color: transparent; + } + + #workspaces button { + padding: 0 5px; + background-color: transparent; + color: #${config.colorScheme.colors.base05}; + } + + #workspaces button.active { + background-color: #${config.colorScheme.colors.base04}; + box-shadow: inset 0 -3px #${config.colorScheme.colors.base05}; + } + + #workspaces button.urgent { + background-color: #eb4d4b; + } + + #clock, + #battery, + #cpu, + #memory, + #temperature, + #network, + #pulseaudio, + #tray{ + border-radius: 30px; + padding: 0 10px; + color: #${config.colorScheme.colors.base05}; + } + + #window, + #workspaces { + margin: 0 4px; + } + + #clock { + background-color: #${config.colorScheme.colors.base00}; + } + + #battery { + background-color: #${config.colorScheme.colors.base02}; + color: #${config.colorScheme.colors.base05}; + } + + #battery.charging, #battery.plugged { + color: #${config.colorScheme.colors.base05}; + background-color: #${config.colorScheme.colors.base02}; + } + + #battery.critical:not(.charging) { + background-color: #${config.colorScheme.colors.base08}; + color: #${config.colorScheme.colors.base01}; + } + + #cpu { + background-color: #${config.colorScheme.colors.base06}; + color: #${config.colorScheme.colors.base01}; + } + + #network { + background-color: #${config.colorScheme.colors.base07}; + color: #${config.colorScheme.colors.base01}; + } + + #network.disconnected { + background-color: #${config.colorScheme.colors.base08}; + } + + #pulseaudio { + background-color: #${config.colorScheme.colors.base03}; + color: #${config.colorScheme.colors.base05}; + } + + #temperature { + background-color: #${config.colorScheme.colors.base05}; + color: #${config.colorScheme.colors.base01}; + } + + #temperature.critical { + background-color: #${config.colorScheme.colors.base08}; + color: #${config.colorScheme.colors.base01}; + } + + #tray { + background-color: #${config.colorScheme.colors.base01}; + color: #${config.colorScheme.colors.base05}; + } + + ''; +} diff --git a/users/rouven/modules/hyprland/wofi-config/config b/users/rouven/modules/hyprland/wofi-config/config deleted file mode 100644 index 46d242b..0000000 --- a/users/rouven/modules/hyprland/wofi-config/config +++ /dev/null @@ -1,2 +0,0 @@ -allow_images = true -term = alacritty diff --git a/users/rouven/modules/hyprland/wofi-config/style.css b/users/rouven/modules/hyprland/wofi-config/style.css deleted file mode 100644 index c0ba166..0000000 --- a/users/rouven/modules/hyprland/wofi-config/style.css +++ /dev/null @@ -1,46 +0,0 @@ -window { -margin: 0px; -border: 1px solid #bd93f9; -background-color: #282a36; -} - -#input { -margin: 5px; -border: none; -color: #f8f8f2; -background-color: #44475a; -} - -#inner-box { -margin: 5px; -border: none; -background-color: #282a36; -} - -#outer-box { -margin: 5px; -border: none; -background-color: #282a36; -} - -#scroll { -margin: 0px; -border: none; -} - -#text { -margin: 5px; -border: none; -color: #f8f8f2; -} - -#entry:selected { -background-color: #44475a; -} - -#entry:nth-child(even){ -background-color: #404552; -} -#entry:nth-child(odd){ -background-color: #404552; -} diff --git a/users/rouven/modules/packages.nix b/users/rouven/modules/packages.nix index 0b9dddb..db23d14 100644 --- a/users/rouven/modules/packages.nix +++ b/users/rouven/modules/packages.nix @@ -46,7 +46,6 @@ virt-manager powerline-fonts ventoy-bin - mpd # libs libyubikey