conky: ship on sway

this probably causes double conky on sxmo, but i can fix in future patch
This commit is contained in:
Colin 2023-09-05 08:31:50 +00:00
parent 14b0d1bd37
commit cddba3d35f
6 changed files with 40 additions and 10 deletions

View File

@ -0,0 +1,36 @@
{ config, lib, pkgs, ... }:
{
sane.programs.conky = {
fs.".config/conky/conky.conf".symlink.target =
let
battery_estimate = pkgs.static-nix-shell.mkBash {
pname = "battery_estimate";
src = ./.;
};
in pkgs.substituteAll {
src = ./conky.conf;
bat = "${battery_estimate}/bin/battery_estimate";
weather = "timeout 20 ${pkgs.sane-weather}/bin/sane-weather";
};
};
# TODO: give `sane.programs` native support for defining services
systemd.user.services.conky = lib.mkIf config.sane.programs.conky.enabled {
description = "conky dynamic desktop background";
wantedBy = [ "default.target" ];
# XXX: should be part of graphical-session.target, but whatever mix of greetd/sway
# i'm using means that target's never reached...
# wantedBy = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
# TODO: might want `ConditionUser=!@system`
serviceConfig.ExecStart = "${pkgs.conky}/bin/conky";
serviceConfig.Type = "simple";
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
# serviceConfig.Slice = "session.slice";
# don't start conky until after sway
preStart = ''test -n "$SWAYSOCK"'';
};
}

View File

@ -7,6 +7,7 @@
./assorted.nix
./cantata.nix
./chatty.nix
./conky
./cozy.nix
./dino.nix
./element-desktop.nix

View File

@ -117,6 +117,7 @@ in
package = null;
suggestedPrograms = [
"guiApps"
"conky" # for a nice background
"splatmoji" # used by us, but 'enabling' it gets us persistence & cfg
"swaylock"
"swayidle"

View File

@ -339,16 +339,8 @@ in
in
lib.generators.toKeyValue { inherit mkKeyValue; } cfg.settings;
sane.user.fs.".config/sxmo/conky.conf".symlink.target = let
battery_estimate = pkgs.static-nix-shell.mkBash {
pname = "battery_estimate";
src = ./.;
};
in pkgs.substituteAll {
src = ./conky-config;
bat = "${battery_estimate}/bin/battery_estimate";
weather = "timeout 20 ${pkgs.sane-weather}/bin/sane-weather";
};
sane.user.fs.".config/sxmo/conky.conf".symlink.target
= "../conky/conky.conf";
}
(lib.mkIf (cfg.greeter == "lightdm-mobile") {