From 10765db295af0d12affe057452e9ced4d2c911d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Tue, 27 Feb 2024 21:13:42 +0100 Subject: [PATCH] Add waybar config and some fonts --- home/default.nix | 1 + home/hyprland/waybar.nix | 190 +++++++++++++++++++++++++++++++++++++++ system/fonts.nix | 6 ++ 3 files changed, 197 insertions(+) create mode 100644 home/hyprland/waybar.nix diff --git a/home/default.nix b/home/default.nix index 6a923e5..63626c7 100644 --- a/home/default.nix +++ b/home/default.nix @@ -11,6 +11,7 @@ ./programs/tmux ./zsh ./packages + ./hyprland/waybar.nix ]; firefox.enable = true; tmux.enable = true; diff --git a/home/hyprland/waybar.nix b/home/hyprland/waybar.nix new file mode 100644 index 0000000..5b01a01 --- /dev/null +++ b/home/hyprland/waybar.nix @@ -0,0 +1,190 @@ +{ pkgs, ... }: { + programs.waybar = { + enable = true; + systemd = { + enable = false; # disable it,autostart it in hyprland conf + target = "graphical-session.target"; + }; + style = '' + * { + font-family: "Fira Code"; + font-size: 14px; + font-weight: bold; + border-radius: 0px; + transition-property: background-color; + transition-duration: 0.5s; + } + @keyframes blink_red { + to { + background-color: rgb(242, 143, 173); + color: rgb(26, 24, 38); + } + } + .warning, + .critical, + .urgent { + animation-name: blink_red; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + window#waybar { + background-color: transparent; + } + window > box { + margin-left: 0px; + margin-right: 0px; + margin-top: 0px; + border-bottom: 2px solid @color1; + background-color: @background; + } + #workspaces { + padding-left: 0px; + padding-right: 4px; + } + #workspaces button { + padding-top: 5px; + padding-bottom: 5px; + padding-left: 6px; + padding-right: 6px; + color: @color1; + } + #workspaces button.active { + background-color: @color1; + color: rgb(26, 24, 38); + } + #workspaces button.urgent { + color: rgb(26, 24, 38); + } + #workspaces button:hover { + background-color: #b38dac; + color: rgb(26, 24, 38); + } + tooltip { + background: #3b4253; + } + tooltip label { + color: #e4e8ef; + } + #custom-launcher { + font-size: 20px; + padding-left: 8px; + padding-right: 6px; + color: #7ebae4; + } + #mode, + #clock, + #memory, + #temperature, + #cpu, + #mpd, + #custom-wall, + #temperature, + #backlight, + #pulseaudio, + #network, + #battery, + #custom-powermenu, + #custom-cava-internal { + padding-left: 10px; + padding-right: 10px; + color: @color1; + } + #network.disconnected { + color: #cccccc; + } + #battery.charging, + #battery.full, + #battery.discharging { + color: #cf876f; + } + #battery.critical:not(.charging) { + color: #d6dce7; + } + #custom-powermenu { + color: #bd6069; + } + #tray { + padding-right: 8px; + padding-left: 10px; + } + #tray menu { + background: #3b4252; + color: #dee2ea; + } + #mpd.paused { + color: rgb(192, 202, 245); + font-style: italic; + } + #mpd.stopped { + background: transparent; + } + #mpd { + color: #e4e8ef; + } + #custom-cava-internal { + font-family: "Hack Nerd Font"; + } + ''; + settings = [{ + "layer" = "top"; + "position" = "top"; + modules-left = + [ "custom/launcher" "hyprland/workspaces" "custom/cava-internal" ]; + modules-center = [ "clock" ]; + modules-right = + [ "pulseaudio" "pulseaudio#microphone" "memory" "cpu" "tray" ]; + "custom/launcher" = { + "format" = " "; + "on-click" = "pkill rofi || ~/.config/rofi/launcher.sh"; + "tooltip" = false; + }; + "custom/cava-internal" = { + "exec" = "sleep 1s && cava-internal"; + "tooltip" = false; + }; + "hyprland/workspaces" = { + "format" = "{name}"; + "on-click" = "activate"; + "on-scroll-up" = "hyprctl dispatch workspace e+1"; + "on-scroll-down" = "hyprctl dispatch workspace e-1"; + }; + "pulseaudio" = { + "scroll-step" = 5; + "format" = "{icon} {volume}%"; + "format-muted" = ""; + "format-icons" = { "default" = [ "" "" "" ]; }; + "on-click" = "pamixer -t"; + }; + "pulseaudio#microphone" = { + "format" = "{format_source}"; + "format-source" = " {volume}%"; + "format-source-muted" = ""; + "on-click" = "pamixer --default-source -t"; + "on-scroll-up" = "pamixer --default-source -i 5"; + "on-scroll-down" = "pamixer --default-source -d 5"; + "scroll-step" = 5; + "on-click-right" = "pavucontrol"; + }; + "clock" = { + "interval" = 1; + "format" = "{:%I:%M %p %A %b %d}"; + "tooltip" = true; + }; + "memory" = { + "interval" = 3; + "format" = " {percentage}%"; + "states" = { "warning" = 85; }; + }; + "cpu" = { + "interval" = 3; + "format" = " {usage}%"; + }; + "tray" = { + "icon-size" = 15; + "spacing" = 6; + }; + }]; + }; +} diff --git a/system/fonts.nix b/system/fonts.nix index 9f9cf19..2e72d3d 100644 --- a/system/fonts.nix +++ b/system/fonts.nix @@ -1,7 +1,13 @@ { pkgs, ... }: { + environment.systemPackages = with pkgs; [ twemoji-color-font ]; fonts.packages = with pkgs; [ fira-code fira-code-symbols + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + twemoji-color-font + font-awesome ]; }