devilspie2: add module (#1477)
Co-authored-by: Sumner Evans <me@sumnerevans.com> Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
This commit is contained in:
parent
ac319fd314
commit
97d183e2e4
7 changed files with 98 additions and 0 deletions
|
|
@ -159,6 +159,7 @@ let
|
|||
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/compton.nix { })
|
||||
(loadModule ./services/devilspie2.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/dropbox.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/dunst.nix { })
|
||||
(loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; })
|
||||
|
|
|
|||
42
modules/services/devilspie2.nix
Normal file
42
modules/services/devilspie2.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let cfg = config.services.devilspie2;
|
||||
in {
|
||||
meta.maintainers = [ maintainers.dawidsowa ];
|
||||
|
||||
options = {
|
||||
services.devilspie2 = {
|
||||
enable = mkEnableOption ''
|
||||
Devilspie2, a window matching utility, allowing the user to
|
||||
perform scripted actions on windows as they are created'';
|
||||
|
||||
config = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
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 {
|
||||
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;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue