polybar: move bar config to nixexpr

This commit is contained in:
Jez Cope 2022-07-25 21:57:31 +01:00
parent 8dd4e56243
commit 4b5da0e0a6
2 changed files with 69 additions and 44 deletions

View File

@ -25,49 +25,6 @@ secondary = #8ABEB7
alert = #A54242
disabled = #707880
[bar/main]
width = 100%
height = 24pt
; radius = 6
; dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
border-size = 12pt
border-bottom-size = 0pt
border-color = #00000000
padding-left = 0
padding-right = 1
module-margin = 1
separator = |
separator-foreground = ${colors.disabled}
font-0 = monospace;2
modules-left = xworkspaces xwindow
modules-center = date
modules-right = pulseaudio xkeyboard memory cpu wlan
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
[module/xworkspaces]
type = internal/xworkspaces
@ -87,10 +44,34 @@ label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1
pin-workspaces = true
[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%
[module/i3]
type = internal/i3
label-focused = %name%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 1
label-unfocused = %name%
label-unfocused-padding = 1
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-visible = %name%
; label-visible-foreground = ${colors.disabled}
label-visible-underline = ${colors.secondary}
label-visible-padding = 1
pin-workspaces = true
[module/filesystem]
type = internal/fs
interval = 25

View File

@ -11,8 +11,52 @@
};
script = ''
polybar main &
polybar secondary &
'';
config = { };
config = let
common = {
width = "100%";
height = "24pt";
background = "\${colors.background}";
foreground = "\${colors.foreground}";
line-size = "3pt";
border-size = "12pt";
border-bottom-size = "0pt";
border-color = "#00000000";
padding-left = 0;
padding-right = 1;
module-margin = 1;
separator = "|";
separator-foreground = "\${colors.disabled}";
font-0 = "monospace";
cursor-click = "pointer";
cursor-scroll = "ns-resize";
enable-ipc = "true";
wm-restack = "i3";
};
in {
"bar/main" = {
monitor = "DisplayPort-0";
modules-left = "i3 xwindow";
modules-center = "date";
modules-right = "pulseaudio xkeyboard memory cpu wlan";
tray-position = "right";
} // common;
"bar/secondary" = {
monitor = "DisplayPort-1";
modules-left = "i3 xwindow";
} // common;
};
extraConfig = lib.readFile ./polybar.ini;
};
}