9 cfg = config.xdg.terminal-exec;
19 meta.maintainers = with lib.maintainers; [ Cryolitia ];
25 enable = mkEnableOption "xdg-terminal-exec, the [proposed](https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/46) Default Terminal Execution Specification";
26 package = mkPackageOption pkgs "xdg-terminal-exec" { };
28 type = with types; attrsOf (listOf str);
31 Configuration options for the Default Terminal Execution Specification.
33 The keys are the desktop environments that are matched (case-insensitively) against `$XDG_CURRENT_DESKTOP`,
34 or `default` which is used when the current desktop environment is not found in the configuration.
35 The values are a list of terminals' [desktop file IDs](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s02.html#desktop-file-id) to try in order of decreasing priority.
38 default = [ "kitty.desktop" ];
40 "com.raggesilver.BlackBox.desktop"
41 "org.gnome.Terminal.desktop"
50 config = mkIf cfg.enable {
52 systemPackages = [ cfg.package ];
56 # map desktop name such as GNOME to `xdg/gnome-xdg-terminals.list`, default to `xdg/xdg-terminals.list`
58 "xdg/${if desktop == "default" then "" else "${lib.toLower desktop}-"}xdg-terminals.list"
59 ) { text = lib.concatLines terminals; }