flakes/modules/user/polybar.nix

135 lines
3.2 KiB
Nix
Raw Normal View History

2021-05-30 21:37:07 +07:00
{ config, ... }: {
2021-11-19 14:30:38 +07:00
services.polybar =
let
colours = {
background1 = "#1a1b26";
background2 = "#9d7cd8";
accent = "#c0caf5";
foreground2 = "#1a1b26";
foreground2trans = "#cc1a1b26";
};
in {
2021-05-30 21:37:07 +07:00
enable = true;
script = builtins.readFile ../../scripts/polybar.sh;
2021-05-30 21:37:07 +07:00
settings = {
"bar/top" = {
monitor = "eDP-1";
width = "100%";
2021-11-19 14:30:38 +07:00
height = 29;
background = colours.background1;
2021-05-30 21:37:07 +07:00
foreground = "#fff";
2021-11-19 14:30:38 +07:00
offset-y = 3;
2021-05-30 21:37:07 +07:00
spacing = 2;
padding = {
left = 5;
right = 5;
bottom = 5;
};
override-redirect = true;
2021-07-03 10:50:22 +07:00
wm-restack = "bspwm";
2021-05-30 21:37:07 +07:00
font = [
2021-07-15 08:49:41 +07:00
"NotoSans:style=SemiBold:size=11:antialias=true;2"
2021-05-30 21:37:07 +07:00
"NotoSans:size=11:antialias=true;2"
"MaterialIcons:size=17:antialias=true;6"
2021-11-19 14:30:38 +07:00
"Iosevka:style=Medium:antialias=false:size=19;4"
2021-05-30 21:37:07 +07:00
"HanaMinA:size=9.8;1"
"HanaMinB:size=9.8;1"
];
modules = {
2021-11-19 14:30:38 +07:00
left = "left workspaces right";
2021-05-30 21:37:07 +07:00
center = "title";
2021-11-19 14:30:38 +07:00
right = "left datetime right";
2021-05-30 21:37:07 +07:00
};
enable-ipc = true;
scroll = {
up = "#workspaces.prev";
down = "#workspaces.next";
};
};
2021-11-19 14:30:38 +07:00
"module/left" = {
type = "custom/text";
content = {
text = "%{T4}";
background = colours.background1;
foreground = colours.background2;
};
};
"module/right" = {
type = "custom/text";
content = {
text = "%{T4}";
background = colours.background1;
foreground = colours.background2;
};
};
2021-05-30 21:37:07 +07:00
"module/workspaces" = {
type = "internal/bspwm";
pin-workspaces = true;
2021-05-31 01:22:03 +07:00
enable-click = true;
2021-05-30 21:37:07 +07:00
enable-scroll = false;
reverse-scroll = false;
label = {
monitor = "";
2021-11-19 14:30:38 +07:00
focused = {
text = "%{T3}"; # ef4a
background = colours.background2;
foreground = colours.accent;
};
2021-05-30 21:37:07 +07:00
occupied = {
text = "%{T3}"; # e837
2021-11-19 14:30:38 +07:00
background = colours.background2;
foreground = colours.background1;
2021-05-30 21:37:07 +07:00
};
empty = {
2021-11-19 14:30:38 +07:00
text = "%{T3}"; # ef4a
background = colours.background2;
foreground = colours.background1;
2021-05-30 21:37:07 +07:00
};
urgent = {
text = "%{T3}"; # e837
2021-11-19 14:30:38 +07:00
background = colours.background2;
foreground = colours.background1;
2021-05-30 21:37:07 +07:00
};
separator = {
text = " ";
2021-11-19 14:30:38 +07:00
background = colours.background2;
2021-05-30 21:37:07 +07:00
padding = "0";
};
};
};
"module/title" = {
type = "internal/xwindow";
format = {
text = "%{T1}<label>";
padding = 4;
};
};
"module/datetime" = {
type = "internal/date";
date = {
2021-11-19 14:30:38 +07:00
text = "%{T1}%%{F${colours.foreground2}}%H:%M%%{F-}";
alt = "%{T2}%%{F${colours.foreground2trans}}%A, %d %B %Y %{T1}%%{F${colours.foreground2}}%H:%M%%{F${colours.foreground2trans}}:%{T2}%S%%{F-}";
2021-05-30 21:37:07 +07:00
};
format = {
2021-11-19 14:30:38 +07:00
background = colours.background2;
2021-05-30 21:37:07 +07:00
};
};
};
};
}