move polybar init script into nix

This commit is contained in:
Noah Masur 2022-04-30 11:32:26 -04:00
parent 70d50a8681
commit 8e08b70d86

View File

@ -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 { config = lib.mkIf config.services.xserver.enable {
@ -198,7 +208,7 @@
notification = false; notification = false;
} }
{ {
command = "~/.config/i3/polybar.sh"; command = builtins.toString polybarReload;
always = true; always = true;
notification = false; notification = false;
} }