diff --git a/users/common/polybar.nix b/users/common/polybar.nix index 26a2f8c..e910172 100644 --- a/users/common/polybar.nix +++ b/users/common/polybar.nix @@ -10,7 +10,7 @@ # 2. polybar allows integer keys. In nix these have to be quoted -{config, ...}: let +{lib, pkgs, ...}: let color = { shade1 = "#311B92"; shade2 = "#4527A0"; @@ -53,34 +53,46 @@ grey = "#757575"; blue-gray = "#546e7a"; }; + + fontsize = "9"; in { services.polybar = { enable = true; + + package = pkgs.polybar.override{ + pulseSupport = true; + alsaSupport = true; + iwSupport = true; + }; + + script = "polybar main @"; settings = { "bar/main" = { monitor = "DP-1"; - monitro.fallback = "eDP-1"; + monitor-fallback = "eDP-1"; bottom = true; dpi = 96; height = 22; + offset.x = "0%"; + offset.y = "0%"; background = color.bground; foreground = color.fground; font = { - "0" = "FiraCode Nerd Font Mono:style=Medium:size=13"; + "0" = "FiraCode Nerd Font Mono:style=Medium:size=${fontsize};2"; "1" = ""; - "2" = "Iosevka Nerd Font:style=Medium:size=16"; - "3" = "Font Awesome 5 Pro:style=Solid:size=13"; - "4" = "Font Awesome 5 Pro:style=Regular:size=13"; - "5" = "Font Awesome 5 Pro:style=Light:size=13"; + "2" = "Iosevka Nerd Font:style=Medium:size=12;2"; + "3" = "Font Awesome 5 Pro:style=Solid:size=${fontsize}"; + "4" = "FontAwesome:style=Regular:size=${fontsize};2"; + "5" = "Font Awesome 5 Pro:style=Light:size=${fontsize}"; }; - modules = { - left = ["icon" "left1" "title" "left2"]; - center = ["workspaces"]; - right = ["right5" "alsa" "right4" "battery" "right3" "network" "date" "right1" "keyboardswitcher"]; + modules = with lib; { + left = concatStringsSep " " ["left1" "title" "left2"]; + center = concatStringsSep " " ["workspaces"]; + right = concatStringsSep " " ["right5" "alsa" "right4" "battery" "right3" "network" "right2" "date" "right1" "keyboardswitcher"]; }; tray = { @@ -90,9 +102,7 @@ in { enable.ipc = true; }; - # _._._._._._._._._._._._._._._._._._._._._._ # Functional MODULES - # _._._._._._._._._._._._._._._._._._._._._._ "module/title" = { type = "internal/xwindow"; @@ -109,25 +119,26 @@ in { label-empty-foreground = "#707880"; }; + "module/workspaces" = { type = "internal/xworkspaces"; - pin.workspaces = "true"; + pin.workspaces = "false"; enable.click = "true"; - enable.scroll = "true"; + enable.scroll = "false"; - label.active = " %{T1}%{T-}"; + label.active = "%{T1}%{T-}"; label.occupied = "%{T1}%{T-}"; - label.urgent = " %{T1}%{T-}"; - label.empty = " %{T1}%{T-}"; + label.urgent = "%{T1}%{T-}"; + label.empty = "%{T1}%{T-}"; - format = ""; + format = ""; label.monitor = "%name%"; label.active-foreground = color.accent; label.occupied-foreground = color.yellow; label.urgent-foreground = color.red; - label.empty-foreground = color.modulefg.alt; + label.empty-foreground = color.modulefg-alt; label.active-padding = "1"; label.urgent-padding = "1"; @@ -138,7 +149,7 @@ in { "module/alsa" = { type = "internal/pulseaudio"; - format.volume = " "; + format.volume = " "; format.volume-background = color.shade5; format.volume-foreground = color.modulefg; format.volume-padding = "1"; @@ -155,24 +166,7 @@ in { ramp.volume."1" = "%{T1}奔%{T-}"; ramp.volume."2" = "%{T1}墳%{T-}"; }; - "module/backlight" = { - type = "internal/xbacklight"; - card = "intel_backlight"; - - format = "