From d32757924f41bda39ea686e2328aab21d6afcdaa Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 1 May 2022 11:16:58 -0400 Subject: [PATCH] start prettying polybar --- modules/applications/alacritty.nix | 40 ++++++++-------- modules/desktop/fonts.nix | 2 +- modules/desktop/i3.nix | 32 ++++++++----- modules/desktop/polybar.nix | 73 +++++++++++++++++------------- 4 files changed, 83 insertions(+), 64 deletions(-) diff --git a/modules/applications/alacritty.nix b/modules/applications/alacritty.nix index 1a7f22c..1826f4d 100644 --- a/modules/applications/alacritty.nix +++ b/modules/applications/alacritty.nix @@ -40,32 +40,32 @@ ]; colors = { primary = { - background = "0x1d2021"; - foreground = "0xd5c4a1"; + background = "#282828"; + foreground = "#d5c4a1"; }; cursor = { - text = "0x1d2021"; - cursor = "0xd5c4a1"; + text = "#1d2021"; + cursor = "#d5c4a1"; }; normal = { - black = "0x1d2021"; - red = "0xfb4934"; - green = "0xb8bb26"; - yellow = "0xfabd2f"; - blue = "0x83a598"; - magenta = "0xd3869b"; - cyan = "0x8ec07c"; - white = "0xd5c4a1"; + black = "#1d2021"; + red = "#fb4934"; + green = "#b8bb26"; + yellow = "#fabd2f"; + blue = "#83a598"; + magenta = "#d3869b"; + cyan = "#8ec07c"; + white = "#d5c4a1"; }; bright = { - black = "0x665c54"; - red = "0xfe8019"; - green = "0x3c3836"; - yellow = "0x504945"; - blue = "0xbdae93"; - magenta = "0xebdbb2"; - cyan = "0xd65d0e"; - white = "0xfbf1c7"; + black = "#665c54"; + red = "#fe8019"; + green = "#3c3836"; + yellow = "#504945"; + blue = "#bdae93"; + magenta = "#ebdbb2"; + cyan = "#d65d0e"; + white = "#fbf1c7"; }; }; draw_bold_text_with_bright_colors = false; diff --git a/modules/desktop/fonts.nix b/modules/desktop/fonts.nix index 4822548..7036804 100644 --- a/modules/desktop/fonts.nix +++ b/modules/desktop/fonts.nix @@ -4,7 +4,7 @@ fonts.fonts = with pkgs; [ - gui.font.package # Used for Vim and Terminal + pkgs."${gui.font.package}" # Used for Vim and Terminal # siji # More icons for Polybar ]; fonts.fontconfig.defaultFonts.monospace = [ gui.font.name ]; diff --git a/modules/desktop/i3.nix b/modules/desktop/i3.nix index 125ef15..0de7305 100644 --- a/modules/desktop/i3.nix +++ b/modules/desktop/i3.nix @@ -14,16 +14,26 @@ enable = true; config = let modifier = "Mod4"; # Super key - ws1 = "1:"; - ws2 = "2:"; - ws3 = "3:"; - ws4 = "4:"; - ws5 = "5:"; - ws6 = "6:"; - ws7 = "7:"; - ws8 = "8:"; - ws9 = "9:"; - ws10 = "10:"; + ws1 = "I"; + ws2 = "II"; + ws3 = "III"; + ws4 = "IV"; + ws5 = "V"; + ws6 = "VI"; + ws7 = "VII"; + ws8 = "VIII"; + ws9 = "IX"; + ws10 = "X"; + # ws1 = "1:"; + # ws2 = "2:"; + # ws3 = "3:"; + # ws4 = "4:"; + # ws5 = "5:"; + # ws6 = "6:"; + # ws7 = "7:"; + # ws8 = "8:"; + # ws9 = "9:"; + # ws10 = "10:"; in { modifier = modifier; assigns = { @@ -191,7 +201,7 @@ }; startup = [ { - command = "feh --bg-scale $HOME/Downloads/basic-wallpaper.webp"; + command = "feh --bg-scale $HOME/Downloads/nord-desert.png"; always = true; notification = false; } diff --git a/modules/desktop/polybar.nix b/modules/desktop/polybar.nix index 8e25c52..07d403f 100644 --- a/modules/desktop/polybar.nix +++ b/modules/desktop/polybar.nix @@ -2,22 +2,22 @@ config = lib.mkIf config.services.xserver.enable { - environment.systemPackages = with pkgs; - [ - polybarFull # Includes PulseAudio - ]; - # Used for icons - fonts.fonts = with pkgs; [ font-awesome ]; + fonts.fonts = with pkgs; [ jetbrains-mono font-awesome ]; home-manager.users.${identity.user} = { services.polybar = { enable = true; + package = pkgs.polybar.override { + i3GapsSupport = true; + pulseSupport = true; + githubSupport = true; + }; script = "polybar &"; config = let colors = { - background = "#282A2E"; + background = "#282828"; background-alt = "#373B41"; foreground = "#C5C8C6"; primary = "#F0C674"; @@ -27,35 +27,41 @@ }; in { "bar/main" = { + bottom = false; width = "100%"; - height = "24pt"; - radius = 6; + height = "22pt"; + radius = 0; + # offset-y = "5%"; # dpi = 96; background = colors.background; foreground = colors.foreground; line-size = "3pt"; - border-size = "4pt"; - border-color = "#00000000"; - padding-left = 0; - padding-right = 1; + border-top-size = 0; + border-right-size = 0; + border-left-size = 0; + border-bottom-size = "4pt"; + border-color = "#1d2021"; + padding-left = 2; + padding-right = 2; module-margin = 1; - separator = "|"; - separator-foreground = colors.disabled; - font-0 = "monospace;2"; - font-1 = "Font Awesome 5 Free"; - font-2 = "Font Awesome 5 Free Solid"; - font-3 = "Font Awesome 5 Brands"; - modules-left = "xworkspaces xwindow"; - modules-right = - "filesystem pulseaudio xkeyboard memory cpu wlan eth date"; + # separator = "|"; + # separator-foreground = colors.disabled; + font-0 = "JetBrainsMono:size=10;2"; + # font-0 = "monospace;2"; + font-1 = "Font Awesome 5 Free:size=10"; + font-2 = "Font Awesome 5 Free Solid:size=10"; + font-3 = "Font Awesome 5 Brands:size=10"; + modules-left = "xworkspaces"; + modules-center = "xwindow"; + modules-right = "pulseaudio date"; cursor-click = "pointer"; cursor-scroll = "ns-resize"; enable-ipc = true; - # tray-position = right - # wm-restack = generic - # wm-restack = bspwm - # wm-restack = i3 - # override-redirect = true + tray-position = "right"; + # wm-restack = "generic"; + # wm-restack = "bspwm"; + # wm-restack = "i3"; + # override-redirect = true; }; "module/xworkspaces" = { type = "internal/xworkspaces"; @@ -88,10 +94,13 @@ type = "internal/pulseaudio"; format-volume-prefix = "VOL "; format-volume-prefix-foreground = colors.primary; - format-volume = ""; + format-volume = " "; label-volume = "%percentage%%"; - label-muted = "muted"; + label-muted = ""; label-muted-foreground = colors.disabled; + ramp-volume-0 = ""; + ramp-volume-1 = ""; + ramp-volume-2 = ""; }; # "module/xkeyboard" = { # type = "internal/xkeyboard"; @@ -137,14 +146,14 @@ "module/date" = { type = "internal/date"; interval = 1; - date = "%H:%M"; + date = "%H:%M:%S"; date-alt = "%Y-%m-%d %H:%M:%S"; - label = "%date%"; + label = " %date%"; label-foreground = colors.primary; }; "settings" = { screenchange-reload = true; - pseudo-transparency = true; + pseudo-transparency = false; }; }; };