aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/status-bar/polybar/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-26 23:53:50 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-27 00:04:04 +0530
commitb20945970ba46999c8c4f234ea0456ca368e179a (patch)
tree63fe1a428af8dfc6b57371bfc9b7795d491422c4 /modules/desktop/status-bar/polybar/default.nix
parent86aaaabfd153a1710b6773f17925d2e5191bf522 (diff)
downloadhome-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/default.nix')
-rw-r--r--modules/desktop/status-bar/polybar/default.nix12
1 files changed, 7 insertions, 5 deletions
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 &
-'';
+'');
};
};