2021-07-05 22:29:34 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let cfg = config.services.devilspie2;
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.dawidsowa ];
|
|
|
|
|
|
|
|
options = {
|
|
|
|
services.devilspie2 = {
|
2023-07-01 01:30:13 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc ''
|
2021-07-05 22:29:34 +02:00
|
|
|
Devilspie2, a window matching utility, allowing the user to
|
2023-07-01 01:30:13 +02:00
|
|
|
perform scripted actions on windows as they are created'');
|
2021-07-05 22:29:34 +02:00
|
|
|
|
|
|
|
config = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc ''
|
2021-07-05 22:29:34 +02:00
|
|
|
Content of file placed in the devilspie2 config directory.
|
|
|
|
'';
|
|
|
|
example = ''
|
|
|
|
if (get_window_class() == "Gnome-terminal") then
|
|
|
|
make_always_on_top();
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-07-07 23:24:27 +02:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.devilspie2" pkgs
|
|
|
|
lib.platforms.linux)
|
|
|
|
];
|
|
|
|
|
2021-07-05 22:29:34 +02:00
|
|
|
systemd.user.services.devilspie2 = {
|
|
|
|
Service.ExecStart = "${pkgs.devilspie2}/bin/devilspie2";
|
|
|
|
Unit = {
|
|
|
|
Description = "devilspie2";
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
Install.WantedBy = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
xdg.configFile."devilspie2/config.lua".text = cfg.config;
|
|
|
|
};
|
|
|
|
}
|