From 3389e89ec7b6f42ac4a1a6ddeb47fc5a1628c3bb Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Mon, 9 Mar 2026 20:26:17 +0530 Subject: Some minor code refactoring --- modules/desktop/polybar/bar/main.nix | 16 +++++++--------- modules/desktop/polybar/module/battery.nix | 10 +++++----- modules/desktop/polybar/module/bspwm.nix | 8 ++++---- modules/desktop/polybar/module/ethernet-separator.nix | 4 ++-- modules/desktop/polybar/module/ethernet.nix | 4 ++-- modules/desktop/polybar/module/wifi-separator.nix | 4 ++-- modules/desktop/polybar/module/wifi.nix | 6 +++--- modules/desktop/polybar/module/xwindow.nix | 1 - 8 files changed, 25 insertions(+), 28 deletions(-) (limited to 'modules/desktop/polybar') diff --git a/modules/desktop/polybar/bar/main.nix b/modules/desktop/polybar/bar/main.nix index 49c3b84..0f38ae4 100644 --- a/modules/desktop/polybar/bar/main.nix +++ b/modules/desktop/polybar/bar/main.nix @@ -10,31 +10,29 @@ in { override-redirect = false; wm-restack = "bspwm"; enable-ipc = true; - + border-top-size = 1; border-bottom-size = 1; border-left-size = 1; border-right-size = 1; border-color = base03; - + background = base00; foreground = base05; - + line-size = 3; line-color = base08; - + padding-left = 1; padding-right = 1; - - # separator = "%{F${base03}}%{T3}│%{T-}%{F-}"; - + offset-x = "10"; offset-y = "10"; - + font-0 = "${config.fonts.normal}:pixelsize=${toString config.fonts.size};3"; font-1 = "${config.fonts.normal}:weight=Bold:pixelsize=${largerFontSize};3"; font-2 = "${config.fonts.normal}:style=Light:pixelsize=${largerFontSize};2"; - + modules-left = "bspwm separator"; modules-center = "xwindow"; modules-right = "separator volume separator battery separator wifi wifi-separator ethernet ethernet-separator time separator memory separator cpu separator date"; diff --git a/modules/desktop/polybar/module/battery.nix b/modules/desktop/polybar/module/battery.nix index f2a10c8..cdf3b86 100644 --- a/modules/desktop/polybar/module/battery.nix +++ b/modules/desktop/polybar/module/battery.nix @@ -5,15 +5,15 @@ with config.scheme.withHashtag; type = "internal/battery"; battery = "BAT1"; adapter = "ADP1"; - + low-at = 0; format-charging = "%{T2}%{F${base03}}%{F-}%{T-} "; format-discharging = "%{T2}%{F${base03}}%{F-}%{T-} "; format-full-prefix = "󰁹 "; - + label-charging = "%percentage:3%%"; label-discharging = "%percentage:3%%"; - + ramp-capacity-0 = "󰁺"; ramp-capacity-1 = "󰁻"; ramp-capacity-2 = "󰁼"; @@ -24,7 +24,7 @@ with config.scheme.withHashtag; ramp-capacity-7 = "󰂁"; ramp-capacity-8 = "󰂂"; ramp-capacity-9 = "󰁹"; - + animation-charging-0 = "󰁺"; animation-charging-1 = "󰁻"; animation-charging-2 = "󰁼"; @@ -35,6 +35,6 @@ with config.scheme.withHashtag; animation-charging-7 = "󰂁"; animation-charging-8 = "󰂂"; animation-charging-9 = "󰁹"; - + animation-charging-framerate = 750; } diff --git a/modules/desktop/polybar/module/bspwm.nix b/modules/desktop/polybar/module/bspwm.nix index 383de8f..3c8f64a 100644 --- a/modules/desktop/polybar/module/bspwm.nix +++ b/modules/desktop/polybar/module/bspwm.nix @@ -3,18 +3,18 @@ with config.scheme.withHashtag; { type = "internal/bspwm"; - + label-focused = "%index%"; label-focused-underline = "${base0D}"; label-focused-padding = 1; - + label-occupied = "%index%"; label-occupied-padding = 1; - + label-urgent = "%index%"; label-urgent-underline = "${base08}"; label-urgent-padding = 1; - + label-empty = "%index%"; label-empty-foreground = "${base03}"; label-empty-padding = 1; diff --git a/modules/desktop/polybar/module/ethernet-separator.nix b/modules/desktop/polybar/module/ethernet-separator.nix index 87df6f3..c2fefaa 100644 --- a/modules/desktop/polybar/module/ethernet-separator.nix +++ b/modules/desktop/polybar/module/ethernet-separator.nix @@ -5,10 +5,10 @@ with config.scheme.withHashtag; type = "internal/network"; interface = "enp4s0"; interface-type = "wired"; - + format-connected = " %{F${base03}}%{T3}│%{T-}%{F-} "; format-disconnected = ""; - + label-connected = ""; label-disconnected = ""; } diff --git a/modules/desktop/polybar/module/ethernet.nix b/modules/desktop/polybar/module/ethernet.nix index 9073c79..3e2b48d 100644 --- a/modules/desktop/polybar/module/ethernet.nix +++ b/modules/desktop/polybar/module/ethernet.nix @@ -5,10 +5,10 @@ with config.scheme.withHashtag; type = "internal/network"; interface = "enp4s0"; interface-type = "wired"; - + format-connected = "%{T2}%{F${base03}}%{F-}%{T-} "; format-disconnected = ""; - + label-connected = "%netspeed:8%"; label-disconnected = ""; } diff --git a/modules/desktop/polybar/module/wifi-separator.nix b/modules/desktop/polybar/module/wifi-separator.nix index 4237d84..6b8da50 100644 --- a/modules/desktop/polybar/module/wifi-separator.nix +++ b/modules/desktop/polybar/module/wifi-separator.nix @@ -5,10 +5,10 @@ with config.scheme.withHashtag; type = "internal/network"; interface = "wlan0"; interface-type = "wireless"; - + format-connected = " %{F${base03}}%{T3}│%{T-}%{F-} "; format-disconnected = ""; - + label-connected = ""; label-disconnected = ""; } diff --git a/modules/desktop/polybar/module/wifi.nix b/modules/desktop/polybar/module/wifi.nix index f244054..9f25fa2 100644 --- a/modules/desktop/polybar/module/wifi.nix +++ b/modules/desktop/polybar/module/wifi.nix @@ -5,13 +5,13 @@ with config.scheme.withHashtag; type = "internal/network"; interface = "wlan0"; interface-type = "wireless"; - + format-connected = "%{T2}%{F${base03}}%{F-}%{T-} "; format-disconnected = ""; - + label-connected = "%netspeed:8%"; label-disconnected = ""; - + ramp-signal-0 = "󰢼"; ramp-signal-1 = "󰢼"; ramp-signal-2 = "󰢽"; diff --git a/modules/desktop/polybar/module/xwindow.nix b/modules/desktop/polybar/module/xwindow.nix index f0614d1..386efe2 100644 --- a/modules/desktop/polybar/module/xwindow.nix +++ b/modules/desktop/polybar/module/xwindow.nix @@ -1,6 +1,5 @@ { config }: -with config.scheme.withHashtag; { type = "internal/xwindow"; label = "%title:0:20:...%"; -- cgit v1.2.3