From 8e08b70d862cbbfba9e998c3d732f326ca5db9c4 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 30 Apr 2022 11:32:26 -0400 Subject: [PATCH] move polybar init script into nix --- modules/desktop/i3.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/desktop/i3.nix b/modules/desktop/i3.nix index aee7be0..06d0983 100644 --- a/modules/desktop/i3.nix +++ b/modules/desktop/i3.nix @@ -1,4 +1,14 @@ -{ config, pkgs, lib, user, ... }: { +{ config, pkgs, lib, user, ... }: + +let + + polybarReload = pkgs.writeShellScriptBin "polybarReload" '' + pkill polybar + while pgrep -x polybar > /dev/null; do sleep 1; done + polybar & + ''; + +in { config = lib.mkIf config.services.xserver.enable { @@ -198,7 +208,7 @@ notification = false; } { - command = "~/.config/i3/polybar.sh"; + command = builtins.toString polybarReload; always = true; notification = false; }