aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/status-bar
diff options
context:
space:
mode:
Diffstat (limited to 'modules/desktop/status-bar')
-rw-r--r--modules/desktop/status-bar/polybar/bar/main.nix6
-rw-r--r--modules/desktop/status-bar/polybar/default.nix12
2 files changed, 11 insertions, 7 deletions
diff --git a/modules/desktop/status-bar/polybar/bar/main.nix b/modules/desktop/status-bar/polybar/bar/main.nix
index 34858d8..d1f05b2 100644
--- a/modules/desktop/status-bar/polybar/bar/main.nix
+++ b/modules/desktop/status-bar/polybar/bar/main.nix
@@ -10,7 +10,7 @@ with config.scheme.withHashtag;
border-bottom-size = 1;
border-left-size = 1;
border-right-size = 1;
- border-color = base02;
+ border-color = base03;
background = base00;
foreground = base05;
@@ -21,13 +21,15 @@ with config.scheme.withHashtag;
padding-left = 1;
padding-right = 1;
+ separator = "%{F${base03}}│%{F-}";
+
module-margin-left = 2;
module-margin-right = 2;
offset-x = "\${env:POLYBAR_OFFSET}";
offset-y = "\${env:POLYBAR_OFFSET}";
- font-0 = "FiraCode Nerd Font:pixelsize=16;3";
+ font-0 = "${config.fonts.normal}:pixelsize=${toString config.fonts.size};3";
modules-left =
if config.desktop.window-manager.bspwm.enable then
diff --git a/modules/desktop/status-bar/polybar/default.nix b/modules/desktop/status-bar/polybar/default.nix
index b8e1907..fb72e5f 100644
--- a/modules/desktop/status-bar/polybar/default.nix
+++ b/modules/desktop/status-bar/polybar/default.nix
@@ -1,4 +1,4 @@
-{ config, lib, ... }:
+{ config, lib, pkgs, ... }:
{
options.desktop.status-bar.polybar = {
@@ -7,11 +7,13 @@
type = lib.types.str;
description = "Command to run polybar.";
# This command calculates the width of the polybar to create those gaps
- default = ''
-MONITOR_WIDTH=$(xrandr | grep '*' | awk '{print $1}' | cut -d'x' -f1 | head -n1); \
-OFFSET=${toString config.desktop.window-manager.gap}; \
+ default = toString (pkgs.writeShellScript "polybar-run.sh" ''
+#!/bin/sh
+
+MONITOR_WIDTH=$(xrandr | grep '*' | awk '{print $1}' | cut -d'x' -f1 | head -n1)
+OFFSET=${toString config.desktop.window-manager.gap}
POLYBAR_WIDTH=$((MONITOR_WIDTH - 2 * OFFSET)) POLYBAR_OFFSET=$OFFSET polybar main &
-'';
+'');
};
};