diff --git a/modules/misc/news.nix b/modules/misc/news.nix index b177d6ce4..dff74cc58 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -448,6 +448,20 @@ in A new program module is available: 'programs.neovim'. ''; } + { + time = "2017-11-14T19:56:49+00:00"; + condition = with config.xsession.windowManager; ( + i3.enable && i3.config != null && i3.config.startup != [] + ); + message = '' + A new 'notification' option was added to + xsession.windowManager.i3.startup submodule. + + Startup commands are now executed with the startup-notification + support enabled by default. Please, set 'notification' to false + where --no-startup-id option is necessary. + ''; + } ]; }; } diff --git a/modules/services/window-managers/i3.nix b/modules/services/window-managers/i3.nix index 608e94546..9ec8829bb 100644 --- a/modules/services/window-managers/i3.nix +++ b/modules/services/window-managers/i3.nix @@ -20,6 +20,15 @@ let description = "Whether to run command on each i3 restart."; }; + notification = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable startup-notification support for the command. + See option description in the i3 user guide. + ''; + }; + workspace = mkOption { type = types.nullOr types.string; default = null; @@ -388,8 +397,8 @@ let ''; example = literalExample '' [ - { command = "systemctl --user restart polybar"; always = true; } - { command = "dropbox start"; } + { command = "systemctl --user restart polybar"; always = true; notification = false; } + { command = "dropbox start"; notification = false; } { command = "firefox"; workspace = "1: web"; } ]; ''; @@ -479,8 +488,10 @@ let floatingCriteriaStr = criteria: "for_window ${criteriaStr criteria} floating enable"; - startupEntryStr = { command, always, workspace, ... }: '' - ${if always then "exec_always" else "exec"} --no-startup-id ${ + startupEntryStr = { command, always, notification, workspace, ... }: '' + ${if always then "exec_always" else "exec"} ${ + if (notification && workspace == null) then "" else "--no-startup-id" + } ${ if (workspace == null) then command else