polybar: redesigned top bar but its buggy

This commit is contained in:
2005 2024-07-31 22:42:24 +02:00
parent 64cc966d0f
commit 09e8f7c3b0
3 changed files with 65 additions and 90 deletions

View file

@ -1,19 +0,0 @@
{ config, pkgs, ... }:
{
nix.buildMachines =
[{
hostName = "pink";
system = "x86_64-linux";
protocol = "ssh-ng";
maxJobs = 3;
speedFactor = 2;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
mandatoryFeatures = [ ];
}];
# required, otherwise remote buildMachines above aren't used
nix.distributedBuilds = true;
# optional, useful when the builder has a faster internet connection than yours
nix.extraOptions = ''
builders-use-substitutes = true
'';
}

View file

@ -15,7 +15,7 @@ in
# Starting compositor and adding background to xroot via nitrogen
startup = [
{
command = "nitrogen --set-zoom-fill /home/grape/Pictures/bg.jpg";
command = "nitrogen --set-zoom-fill /home/grape/dotfiles/bg.jpg";
}
{
command = "picom -b --experimental-backends";
@ -101,6 +101,7 @@ in
# Volume adjustment for current player
"shift+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl volume 0.1+";
"shift+XF86AudioLowerVolume" = "exec --no-startup-id playerctl volume 0.1-";
# seeking for current player
"Control+XF86AudioRaiseVolume" = "exec --no-startup-id playerctl position 10+";
"Control+XF86AudioLowerVolume" = "exec --no-startup-id playerctl position 10-";

133
nix/configs/polybar.nix Executable file → Normal file
View file

@ -1,7 +1,9 @@
let
colors = {
fg = "#FFFFFF";
foreground = "#FFFFFF";
bg = "#191830";
background = "#191830";
border = "#F72585";
warn = "#f00";
altfg = "#F72585";
@ -11,7 +13,7 @@ let
currentWorkspace = "#FAD000";
seperatorColor = "#FAD000";
};
script = "~/.config/scripts";
script = "~/dotifles/scripts";
in
{
@ -24,77 +26,69 @@ in
script = "${script}/polybar.sh";
config = {
"module/date" = {
type = "internal/date";
font-1 = "Jetbrains Mono Nerd font";
interval = 1;
time = "%I:%M:%S";
date = "%Y-%m-%d%";
format = "<label>";
date = "%Y-%m-%d %A";
format = "%{T2}%{F#191830}%{F-}%{T-}<label>%{T2}%{F#191830}%{F-}%{T-}";
label-background = "${colors.bg}";
label = "%time% %date%";
label-foreground = "${colors.fg}";
};
# TODO include labels right into format for each module instea dof having a different module
"module/s" = {
type = "custom/text";
label = " | ";
label-foreground = "${colors.seperatorColor}";
};
"module/gpu-label" = {
type = "custom/text";
label = "GPU ";
label-foreground = "${colors.seperatorColor}";
};
"module/replay-label" = {
type = "custom/text";
label = "REPLAY ";
label-foreground = "${colors.seperatorColor}";
};
"module/battery-label" = {
type = "custom/text";
label = "BAT ";
label-foreground = "${colors.seperatorColor}";
};
"module/fs-label-system" = {
type = "custom/text";
label = "SYS ";
label-foreground = "${colors.seperatorColor}";
};
"module/fs-label-data" = {
type = "custom/text";
label = "DAT ";
label-foreground = "${ colors. seperatorColor}";
};
"module/s" = {
type = "custom/text";
label = " ";
};
"module/ewmh" = {
type = "internal/xworkspaces";
pin-workspaces = false;
label-active-foreground = "${colors.currentWorkspace}";
label-active-background = "${colors.background}";
label-inactive-background = "${colors.background}";
label-urgent-foreground = colors.warn;
label-empty-background = "${colors.background}";
label-occupied-background = "${colors.background}";
format = "%{T2}%{F#191830}%{F-}%{T-}<label-state>%{T2}%{F#191830}%{F-}%{T-}";
};
"module/cpu-temp" = {
type = "internal/temperature";
format = "%{F${colors.seperatorColor}}CPU%{F-} <label> ";
format-warn = "%{F${colors.seperatorColor}}CPU%{F-} <label-warn> ";
base-temperature = 20;
warn-temperature = 85;
label-warn-foreground = "${colors.warn}";
label-foreground = "${colors.fg}";
thermal-zone = 0;
zone-type = "x86_pkg_temp";
label-background = "${colors.foreground}";
label-foreground = "${colors.fg}";
hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input";
format = "%{T2}%{F#${colors.background}}%{F-}%{T-}%{B${colors.bg}}%{F${colors.seperatorColor}}CPU %{F-}%{B-}<label>%{T2}%{F#191830}%{F-}%{T-}";
format-warn = "%{F${colors.seperatorColor}}CPU%{F-} <label-warn> ";
};
"module/cpu-usage" = {
type = "internal/cpu";
interval = "1.5";
format = "<label>";
label = "CPU %percentage%%";
label-background = "${colors.foreground}";
format-foreground = "${colors.fg}";
};
@ -102,77 +96,77 @@ in
type = "custom/script";
interval = "1.5";
exec = "nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits";
format = "<label>";
format-suffix = "°C ";
format = "%{B${colors.bg}}%{F${colors.seperatorColor}}GPU %{F-}%{B-}<label>°C";
label-background = "${colors.foreground}";
label-foreground = "${colors.foreground}";
};
"module/gpu-usage" = {
type = "custom/script";
interval = "1.5";
label-background = "${colors.background}";
label-foreground = "${colors.foreground}";
exec = "nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits";
format-suffix = "mb ";
format = "<label> mb";
};
"module/memory" = {
type = "internal/memory";
interval = 1;
format = "%{F${colors.seperatorColor}}RAM%{F-} <label>";
label-background = "${colors.background}";
format = "%{T2}%{F#191830}%{F-}%{T-}%{B${colors.bg}}%{F${colors.seperatorColor}}RAM %{F-}%{B-}<label>%{T2}%{F#191830}%{F-}%{T-}";
label = "%used%";
label-warn = "%used%";
warn-percentage = 60;
label-warn-foreground = "${colors.warn}";
};
"module/audio" = {
type = "internal/alsa";
use-ui-max = false;
label-volume = "%percentage%%";
label-muted = "muted";
label-muted-foreground = "${colors.altfg}";
};
"module/music" = {
type = "custom/script";
interval = ".5";
exec = "~/.config/scripts/music.sh";
format = "<label>";
};
"fs-base" = {
"module/fs-system" = {
type = "internal/fs";
label-unmounted = "?";
format-prefix-foreground = "${colors.fg}";
warn-precentage = "80%";
};
"module/fs-system" = {
"inherit" = "fs-base";
mount-0 = "/";
interval = 30;
label-mounted-background = "${colors.background}";
format-mounted = "%{T2}%{F#191830}%{F-}%{T-}%{B${colors.bg}}%{F${colors.seperatorColor}}SYS %{F-}%{B-}<label-mounted>%{T2}%{F#191830}%{F-}%{T-}";
label-mounted = "%free%(%total%)";
# FIXME doesn't work
label-warn = "%{F${colors.warn}} !%free%!%{F-}(%total%)";
};
"module/fs-data" = {
"inherit" = "fs-base";
type = "internal/fs";
label-unmounted = "?";
format-prefix-foreground = "${colors.fg}";
warn-precentage = "80%";
label-mounted-background = "${colors.background}";
mount-0 = "/media/terra";
interval = 30;
format-mounted = "%{T2}%{F#191830}%{F-}%{T-}%{B${colors.bg}}%{F${colors.seperatorColor}}DAT %{F-}%{B-}<label-mounted>%{T2}%{F#191830}%{F-}%{T-}";
label-mounted = "%free%(%total%)";
# FIXME doesn't work
label-warn = "%{F${colors.warn}} !%free%!%{F-}(%total%)";
};
"module/battery" = {
type = "internal/battery";
full-at = 95;
low-at = 20;
battery = "BAT0";
adapter = "AC0";
label-background = colors.background;
label-foreground = colors.foreground;
format = "%{T2}%{F#191830}%{F-}%{T-}%{B${colors.bg}}%{F${colors.seperatorColor}}BAT %{F-}%{B-}<label-mounted>%{T2}%{F#191830}%{F-}%{T-}";
poll-interval = 4;
};
"module/keyboard" = {
type = "internal/xkeyboard";
format = "<label-layout> <label-indicator>";
label-layout-background = colors.background;
label-layout-foreground = colors.foreground;
format = "%{T2}%{F#191830}%{F-}%{T-}%{B${colors.background}}<label-layout> <label-indicator>%{B-}%{T2}%{F#191830}%{F-}%{T-}";
};
"global/wm" = {
@ -181,33 +175,32 @@ in
"bar/default" = {
font-0 = "Jetbrains Mono Nerd font:size=11;3";
font-1 = "Jetbrains Mono Nerd font:size=11;1";
font-1 = "Jetbrains Mono Nerd font:size=22;5";
bottom = false;
# dimensons
# Dimensions
width = "100%";
height = 40;
height = 34;
radius = 15;
# Padding for modules
padding-left = 5;
padding-right = 5;
padding-left = 2;
padding-right = 2;
# setting colors
background = "${colors.bg}";
#background = "${colors.bg}";
background = "#00191830";
foreground = "${colors.fg}";
# border for bar
border-size = "10px";
# border-color = ${colors.border}
border-color = "${colors.invisible}";
# Displayed modules
modules-left = "date s keyboard s ewmh";
#modules-center = "cava";
modules-right = "battery-label battery s fs-label-data fs-data s fs-label-system fs-system s memory s gpu-label gpu-usage gpu-temp s cpu-temp cpu-usage";
modules-left = "date s keyboard";
modules-center = "ewmh";
modules-right = "battery-label battery s fs-data s fs-system s memory s start gpu-temp gpu-usage end s cpu-temp cpu-usage";
};
};