Manage waybar start with systemd

This commit is contained in:
Simon Bruder 2020-12-07 19:49:43 +01:00
parent 7fd198edcf
commit 289f760252
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -32,6 +32,8 @@ let
cfg = config.wayland.windowManager.sway.config;
thinsp = "";
waybar = (pkgs.waybar.override { pulseSupport = true; }); # FIXME: Remove override with 21.03 (https://github.com/NixOS/nixpkgs/pull/98490)
in
lib.mkIf config.sbruder.gui.enable {
wayland.windowManager.sway = {
@ -166,9 +168,7 @@ lib.mkIf config.sbruder.gui.enable {
"--locked ${cfg.modifier}+q" = ''exec 'test $(swaymsg -t get_outputs | ${pkgs.jq}/bin/jq "[.[].dpms] | any") = "true" && swaymsg "output * dpms off" || swaymsg "output * dpms on"'';
};
bars = [
{ command = "waybar"; }
];
bars = [ ]; # started by systemd service
assigns = {
"2" = [
@ -251,14 +251,36 @@ lib.mkIf config.sbruder.gui.enable {
fi
'';
home.packages = with pkgs; [
home.packages = (with pkgs; [
alacritty # terminal
brightnessctl # control screen brightness
sway-contrib.grimshot # screenshots
(waybar.override { pulseSupport = true; }) # better status bar FIXME: Remove override with 21.03 (https://github.com/NixOS/nixpkgs/pull/98490)
wdisplays # graphical output manager
]) ++ [
waybar # better status bar FIXME: see above
];
# taken from <home-manager/modules/programs/waybar.nix>
systemd.user.services.waybar = {
Unit = {
Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
Documentation = "https://github.com/Alexays/Waybar/wiki";
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "dbus";
BusName = "fr.arouillard.waybar";
ExecStart = "${waybar}/bin/waybar"; # FIXME see above
Restart = "always";
RestartSec = "1sec";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
xdg.configFile = {
# home-managers waybar module performs additional checks that are overly strict
"waybar/config".text = builtins.toJSON {