92 lines
2.2 KiB
Nix
92 lines
2.2 KiB
Nix
{ lib, pkgs, ... }:
|
|
|
|
let
|
|
polybar = pkgs.polybar.override { pulseSupport = true; };
|
|
in
|
|
{
|
|
home.packages = [
|
|
polybar
|
|
pkgs.nerd-fonts.jetbrains-mono
|
|
];
|
|
fonts.fontconfig.enable = true;
|
|
|
|
xdg.configFile."polybar/config.ini".text = ''
|
|
[colors]
|
|
background = #1a1b26
|
|
foreground = #c0caf5
|
|
primary = #7aa2f7
|
|
dim = #565f89
|
|
|
|
[bar/main]
|
|
width = 100%
|
|
height = 22pt
|
|
background = ''${colors.background}
|
|
foreground = ''${colors.foreground}
|
|
font-0 = JetBrainsMono Nerd Font:size=10;2
|
|
padding = 1
|
|
module-margin = 1
|
|
separator = |
|
|
separator-foreground = ''${colors.dim}
|
|
wm-restack = bspwm
|
|
enable-ipc = true
|
|
|
|
modules-left = bspwm
|
|
modules-center = date
|
|
modules-right = pulseaudio cpu memory
|
|
|
|
tray-position = right
|
|
|
|
[module/bspwm]
|
|
type = internal/bspwm
|
|
label-focused = %name%
|
|
label-focused-background = ''${colors.primary}
|
|
label-focused-foreground = ''${colors.background}
|
|
label-focused-padding = 1
|
|
label-occupied = %name%
|
|
label-occupied-padding = 1
|
|
label-empty = %name%
|
|
label-empty-foreground = ''${colors.dim}
|
|
label-empty-padding = 1
|
|
label-urgent = %name%
|
|
label-urgent-background = #f7768e
|
|
label-urgent-padding = 1
|
|
|
|
[module/date]
|
|
type = internal/date
|
|
interval = 5
|
|
date = %a %b %d %H:%M
|
|
|
|
[module/cpu]
|
|
type = internal/cpu
|
|
interval = 2
|
|
label = CPU %percentage%%
|
|
|
|
[module/memory]
|
|
type = internal/memory
|
|
interval = 5
|
|
label = RAM %percentage_used%%
|
|
|
|
[module/pulseaudio]
|
|
type = internal/pulseaudio
|
|
label-volume = VOL %percentage%%
|
|
label-muted = muted
|
|
label-muted-foreground = ''${colors.dim}
|
|
'';
|
|
|
|
xdg.configFile."polybar/launch.sh" = {
|
|
executable = true;
|
|
text = ''
|
|
#!/bin/sh
|
|
${pkgs.procps}/bin/pkill -x polybar
|
|
while ${pkgs.procps}/bin/pgrep -x polybar >/dev/null; do sleep 0.2; done
|
|
${pkgs.util-linux}/bin/setsid -f ${polybar}/bin/polybar main
|
|
'';
|
|
};
|
|
|
|
# home.activation.reloadPolybar = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
# if ${pkgs.procps}/bin/pgrep -x bspwm >/dev/null; then
|
|
# DISPLAY=:0 $HOME/.config/polybar/launch.sh || true
|
|
# fi
|
|
# '';
|
|
}
|