diff options
| author | Dylan <boss@tehbox.org> | 2026-10-17 21:53:43 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-10-17 21:53:43 +1300 |
| commit | 280e1bbe5e733128a451260685cc8ecd10a042a3 (patch) | |
| tree | 78bab82353bbfa00f9a781015e246c274a5c983b /modules/home-manager/polybar | |
| parent | bcfc69e424802276cc52fb6e00fb4a42e9c37816 (diff) | |
| download | nixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.tar.gz nixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.zip | |
feat: Dendritic pattern
This re-write was done with the help of claude, and still needs a
decent amount of changes before it properly follows the dendritic
pattern
Diffstat (limited to 'modules/home-manager/polybar')
| -rw-r--r-- | modules/home-manager/polybar/config.ini | 186 | ||||
| -rw-r--r-- | modules/home-manager/polybar/default.nix | 24 | ||||
| -rwxr-xr-x | modules/home-manager/polybar/launch.sh | 20 |
3 files changed, 230 insertions, 0 deletions
diff --git a/modules/home-manager/polybar/config.ini b/modules/home-manager/polybar/config.ini new file mode 100644 index 0000000..b7cf83e --- /dev/null +++ b/modules/home-manager/polybar/config.ini @@ -0,0 +1,186 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== +;;; +[colors] +background = #cc292d3e +background-alt = #cc292d3e +foreground = #676e96 +primary = #676e96 +secondary = #8ABEB7 +alert = #BF00F6 +disabled = #515772 +active = #eeffff +inactive = #515772 + +[section/bar-defaults] +width = 100% +height = 19pt +radius = 10 + +monitor = ${env:MONITOR:} + +bottom = true + +; dpi = 96 + +background = ${colors.background} +foreground = ${colors.foreground} + +border-size = 6px +border-color = #00000000 + +padding-left = 0 +padding-right = 1 +border-top-size = 0 + +module-margin = 1 + +separator = "|" +separator-foreground = ${colors.disabled} + +font-0 = Cousine Nerd Font;1 + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +; wm-restack = generic +; wm-restack = bspwm +wm-restack = generic + +override-redirect = false + +[bar/mainbar] +inherit = section/bar-defaults +modules-left = xworkspaces +modules-right = pipewire xkeyboard memory cpu battery date tray +modules-center = xwindow + +[bar/extrabar] +inherit = section/bar-defaults +modules-left = xworkspaces +modules-right = pipewire xkeyboard memory cpu battery date +modules-center = xwindow + +[module/xworkspaces] +type = internal/xworkspaces + +pin-workspaces = true + +label-active = %name% +label-active-foreground = ${colors.active} +label-active-padding = 1 + +label-occupied = %name% +label-occupied-foreground = ${colors.inactive} +label-occupied-padding = 1 + +label-urgent = %name% +label-urgent-foreground = ${colors.inactive} +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = +label-empty-foreground = ${colors.inactive} +label-empty-padding = 0 + +[module/pipewire] +type = internal/pulseaudio + +master-soundcard = hw:2 +master-mixer = Master +mapped = true + +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/battery] +type = internal/battery +low-at = 20 +full-at = 100 +battery = BAT1 +adapter = ACAD + +time-format = "%H:%M" + +format-charging-prefix = "BAT " +format-discharging-prefix = "BAT " +format-full-prefix = "BAT " +format-charging-prefix-foreground = ${colors.primary} +format-discharging-prefix-foreground = ${colors.primary} +format-full-prefix-foreground = ${colors.primary} +format-charging = "<label-charging>" +format-discharging = "<label-discharging>" +format-full = <label-full> + +label-charging = "%percentage%% - %time%" +label-discharging = "%percentage%% - %time%" +label-full = "FULL" + +[module/memory] +type = internal/memory +interval = 1 +format-prefix = "RAM " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 1 +format-prefix = "CPU " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M:%S +date-alt = %H:%M:%S %d-%m-%Y + +label = %date% +label-foreground = ${colors.primary} + +[module/tray] +type = internal/tray +tray-spacing = 5 + +[module/xwindow] +type = internal/xwindow +format = <label> +label = %title% +label-maxlen = 60 + +[module/xkeyboard] +type = internal/xkeyboard +format = <label-indicator> +label-indicator-on-numlock = "NL" +label-indicator-off-numlock = "" + +[settings] +screenchange-reload = true +pseudo-transparency = true + +; vim:ft=dosini diff --git a/modules/home-manager/polybar/default.nix b/modules/home-manager/polybar/default.nix new file mode 100644 index 0000000..101e8a8 --- /dev/null +++ b/modules/home-manager/polybar/default.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + flake.modules.homeManager.polybar = + { + config, + pkgs, + ... + } : { + home.file.".config/polybar/launch.sh" = { + source = ./launch.sh; + executable = true; + }; + home.file.".config/polybar/config.ini" = { + source = ./config.ini; + # onChange = '' + #${pkgs.procps}/bin/pkill polybar + #PATH=$PATH:${pkgs.polybarFull}/bin:${pkgs.lxrandr}/bin ~/.config/polybar/launch.sh + #''; + }; + home.packages = with pkgs; [ + polybarFull + ]; + }; +} diff --git a/modules/home-manager/polybar/launch.sh b/modules/home-manager/polybar/launch.sh new file mode 100755 index 0000000..41d5f3d --- /dev/null +++ b/modules/home-manager/polybar/launch.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# Terminate already running bar instances +# If all your bars have ipc enabled, you can use +polybar-msg cmd quit +# Otherwise you can use the nuclear option: +# killall -q polybar + +# Launch bar1 and bar2 +echo "---" | tee -a /tmp/polybarstatus.log + +for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + if [ $(xrandr | grep $m | grep primary | wc -l) -eq 1 ]; then + MONITOR=$m polybar mainbar | tee -a /tmp/mainpolybar.log & disown + else + MONITOR=$m polybar extrabar | tee -a /tmp/extrapolybar.log & disown + fi +done + +echo "Bars launched..." |
