From 0c34d3cd805a42e26a9a7a91cfc2dad5a51296d5 Mon Sep 17 00:00:00 2001 From: Jez Cope Date: Fri, 13 Jan 2023 15:29:40 +0000 Subject: [PATCH] i3: configure autorandr to restart polybar --- home/profiles/i3/default.nix | 4 +++- home/profiles/i3/polybar.nix | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/home/profiles/i3/default.nix b/home/profiles/i3/default.nix index 4dc4d45..007292f 100644 --- a/home/profiles/i3/default.nix +++ b/home/profiles/i3/default.nix @@ -20,7 +20,9 @@ let in { imports = [ ./polybar.nix ]; - home.packages = with pkgs; [ arandr autorandr ]; + home.packages = with pkgs; [ arandr ]; + + programs.autorandr.enable = true; xsession.windowManager.i3 = { enable = true; diff --git a/home/profiles/i3/polybar.nix b/home/profiles/i3/polybar.nix index 17e0485..5dedc69 100644 --- a/home/profiles/i3/polybar.nix +++ b/home/profiles/i3/polybar.nix @@ -59,4 +59,9 @@ }; extraConfig = lib.readFile ./polybar.ini; }; + + programs.autorandr.hooks.postswitch.restart-polybar = '' + sleep 1 + systemctl --user restart polybar.service + ''; }