dotfiles/hm/desktop/frobar/module.nix

33 lines
986 B
Nix
Raw Normal View History

2024-12-15 00:29:51 +01:00
{
pkgs,
lib,
config,
...
}:
2024-06-17 20:36:50 +02:00
{
config = lib.mkIf config.frogeye.desktop.xorg {
xsession.windowManager.i3.config.bars = [ ];
programs.autorandr.hooks.postswitch = {
frobar = "${pkgs.systemd}/bin/systemctl --user restart frobar";
};
systemd.user.services.frobar = {
Unit = {
Description = "frobar";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
# Wait for i3 to start. Can't use ExecStartPre because otherwise it blocks graphical-session.target, and there's nothing i3/systemd
# TODO Do that better
2024-12-15 00:29:51 +01:00
ExecStart = ''${pkgs.bash}/bin/bash -c "while ! ${pkgs.i3}/bin/i3-msg; do ${pkgs.coreutils}/bin/sleep 1; done; ${pkgs.callPackage ./. { }}/bin/frobar"'';
2024-06-17 20:36:50 +02:00
};
2024-12-15 00:29:51 +01:00
Install = {
WantedBy = [ "graphical-session.target" ];
};
2024-06-17 20:36:50 +02:00
};
};
}
# TODO Connection with i3 is lost on start sometimes, more often than with Arch?