diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2024-09-26 23:53:50 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2024-09-27 00:04:04 +0530 |
| commit | b20945970ba46999c8c4f234ea0456ca368e179a (patch) | |
| tree | 63fe1a428af8dfc6b57371bfc9b7795d491422c4 /modules/desktop/status-bar/polybar | |
| parent | 86aaaabfd153a1710b6773f17925d2e5191bf522 (diff) | |
| download | home-manager-config-b20945970ba46999c8c4f234ea0456ca368e179a.tar.gz home-manager-config-b20945970ba46999c8c4f234ea0456ca368e179a.zip | |
Using kitty terminal instead of alacritty.
Setup xdg-desktop-portal.
Diffstat (limited to 'modules/desktop/status-bar/polybar')
| -rw-r--r-- | modules/desktop/status-bar/polybar/bar/main.nix | 6 | ||||
| -rw-r--r-- | modules/desktop/status-bar/polybar/default.nix | 12 |
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 & -''; +''); }; }; |
