diff options
| author | Natasha Nightshade <31557030-TashaTheInnkeeper@users.noreply.gitlab.com> | 2026-02-02 13:35:51 +0100 |
|---|---|---|
| committer | Natasha Nightshade <31557030-TashaTheInnkeeper@users.noreply.gitlab.com> | 2026-02-02 13:35:51 +0100 |
| commit | 0423ac08769fce26e4a75ea382874c06d97526f6 (patch) | |
| tree | 9d8a1a934ecf582502f556cc61af0da687840d70 /modules/home/i3wm/polybar.nix | |
| parent | 5c741252de752af281628dd7c8c780c746236088 (diff) | |
| parent | 0ed5c638945192dc5e4a099fded4db164ba603a2 (diff) | |
Merge branch 'master' into 'main'
merge master into main
See merge request natasha-linux/nixos/dots!1
Diffstat (limited to 'modules/home/i3wm/polybar.nix')
| -rw-r--r-- | modules/home/i3wm/polybar.nix | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/modules/home/i3wm/polybar.nix b/modules/home/i3wm/polybar.nix new file mode 100644 index 0000000..95130cf --- /dev/null +++ b/modules/home/i3wm/polybar.nix @@ -0,0 +1,181 @@ +{ config, pkgs, lib, ... }: + + +{ + services.polybar = { + enable = true; + + extraConfig = let + colors = { + background = "#1c182d"; + background-alt = "#2b1b3d"; + foreground = "#d0b6fd"; + primary = "#cfb5fd"; + secondary = "#8a78b0"; + alert = "#7b91fc"; + disabled = "#707880"; + }; + in '' + [bar/example] + width = 98% + height = 30pt + radius = 15 + offset-x = 1% + offset-y = 1% + override-redirect = true + fixed-center = true + enable-ipc = true + + background = ${colors.background} + foreground = ${colors.foreground} + + line-size = 4pt + border-size = Opt + border-color = #00000000 + + padding-left = 1 + padding-right = 1 + module-margin = 1 + + separator = | + separator-foreground = ${colors.disabled} + + font-0 = fira code;2 + + modules-left = xworkspaces spotify spotify-prev spotify-play-pause spotify-next + modules-center = date + modules-right = filesystem memory cpu pulseaudio-devices wlan xkeyboard battery + + [module/systray] + type = internal/tray + format-margin = 8pt + tray-spacing = 16pt + + [module/xworkspaces] + type = internal/xworkspaces + label-active = %name% + label-active-background = ${colors.background-alt} + label-active-underline = ${colors.primary} + label-active-padding = 1 + label-occupied = %name% + label-occupied-padding = 1 + label-urgent = %name% + label-urgent-background = ${colors.alert} + label-urgent-padding = 1 + label-empty = %name% + label-empty-foreground = ${colors.disabled} + label-empty-padding = 1 + + [module/xwindow] + type = internal/xwindow + label = %title:0:60:...% + + [module/filesystem] + type = internal/fs + interval = 25 + mount-0 = / + label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% + label-unmounted = %mountpoint% not mounted + label-unmounted-foreground = ${colors.disabled} + + [module/pulseaudio] + type = internal/pulseaudio + format-volume-prefix = "VOL " + format-volume-prefix-foreground = ${colors.primary} + format-volume = <label-volume> + label-volume = %percentage%% + label-muted = muted + label-muted-foreground = ${colors.disabled} + + [module/xkeyboard] + type = internal/xkeyboard + blacklist-0 = num lock + label-layout = %layout% + label-layout-foreground = ${colors.primary} + label-indicator-padding = 2 + label-indicator-margin = 1 + label-indicator-foreground = ${colors.background} + label-indicator-background = ${colors.secondary} + + [module/memory] + type = internal/memory + interval = 2 + format-prefix = "RAM " + format-prefix-foreground = ${colors.primary} + label = %percentage_used:2%% + + [module/cpu] + type = internal/cpu + interval = 2 + format-prefix = "CPU " + format-prefix-foreground = ${colors.primary} + label = %percentage:2%% + + [network-base] + type = internal/network + interval = 5 + format-connected = <label-connected> + format-disconnected = <label-disconnected> + label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected + + [module/wlan] + inherit = network-base + interface-type = wireless + label-connected = %{F#F0C674}%ifname%%{F-} %essid% + + [module/eth] + inherit = network-base + interface-type = wired + label-connected = %{F#F0C674}%ifname%%{F-} + + [module/date] + type = internal/date + interval = 1 + date = %H:%M + date-alt = %Y-%m-%d %H:%M:%S + label = %date% + label-foreground = ${colors.primary} + + [settings] + screenchange-reload = true + pseudo-transparency = true + + [module/battery] + type = internal/battery + full-at = 100 + low-at = 15 + battery = BAT0 + adapter = ADP1 + poll-interval = 5 + + [module/spotify] + type = custom/script + tail = true + interval = 1 + format-prefix = "♫" + format = <label> + exec = get-spotify-status + + [module/spotify-prev] + type = custom/script + exec = echo "◀◀" + format = <label> + click-left = playerctl previous -p spotify + + [module/spotify-play-pause] + type = custom/ipc + hook-0 = echo "▶" + hook-1 = echo "▶" + initial = 1 + click-left = playerctl play-pause -p spotify + + [module/spotify-next] + type = custom/script + exec = echo "▶▶" + format = <label> + click-left = playerctl next -p spotify + ''; + + script = "polybar example --config=~/.config/polybar/config.ini &"; + }; +}
\ No newline at end of file |
