mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01:00
sway: writeText -> writeTextFile
The latter is more flexible and shall be used soon, splitting this change out for simpler diff later.
This commit is contained in:
parent
7c61e400a9
commit
95888b153c
1 changed files with 60 additions and 56 deletions
|
@ -261,62 +261,66 @@ let
|
||||||
systemdActivation = ''
|
systemdActivation = ''
|
||||||
exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"'';
|
exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"'';
|
||||||
|
|
||||||
configFile = pkgs.writeText "sway.conf" (concatStringsSep "\n"
|
configFile = pkgs.writeTextFile {
|
||||||
((optional (cfg.extraConfigEarly != "") cfg.extraConfigEarly)
|
name = "sway.conf";
|
||||||
++ (if cfg.config != null then
|
text = (concatStringsSep "\n"
|
||||||
with cfg.config;
|
((optional (cfg.extraConfigEarly != "") cfg.extraConfigEarly)
|
||||||
([
|
++ (if cfg.config != null then
|
||||||
(fontConfigStr fonts)
|
with cfg.config;
|
||||||
"floating_modifier ${floating.modifier}"
|
([
|
||||||
(windowBorderString window floating)
|
(fontConfigStr fonts)
|
||||||
"hide_edge_borders ${window.hideEdgeBorders}"
|
"floating_modifier ${floating.modifier}"
|
||||||
"focus_wrapping ${focus.wrapping}"
|
(windowBorderString window floating)
|
||||||
"focus_follows_mouse ${focus.followMouse}"
|
"hide_edge_borders ${window.hideEdgeBorders}"
|
||||||
"focus_on_window_activation ${focus.newWindow}"
|
"focus_wrapping ${focus.wrapping}"
|
||||||
"mouse_warping ${
|
"focus_follows_mouse ${focus.followMouse}"
|
||||||
if builtins.isString (focus.mouseWarping) then
|
"focus_on_window_activation ${focus.newWindow}"
|
||||||
focus.mouseWarping
|
"mouse_warping ${
|
||||||
else if focus.mouseWarping then
|
if builtins.isString (focus.mouseWarping) then
|
||||||
"output"
|
focus.mouseWarping
|
||||||
else
|
else if focus.mouseWarping then
|
||||||
"none"
|
"output"
|
||||||
}"
|
else
|
||||||
"workspace_layout ${workspaceLayout}"
|
"none"
|
||||||
"workspace_auto_back_and_forth ${
|
}"
|
||||||
lib.hm.booleans.yesNo workspaceAutoBackAndForth
|
"workspace_layout ${workspaceLayout}"
|
||||||
}"
|
"workspace_auto_back_and_forth ${
|
||||||
"client.focused ${colorSetStr colors.focused}"
|
lib.hm.booleans.yesNo workspaceAutoBackAndForth
|
||||||
"client.focused_inactive ${colorSetStr colors.focusedInactive}"
|
}"
|
||||||
"client.unfocused ${colorSetStr colors.unfocused}"
|
"client.focused ${colorSetStr colors.focused}"
|
||||||
"client.urgent ${colorSetStr colors.urgent}"
|
"client.focused_inactive ${colorSetStr colors.focusedInactive}"
|
||||||
"client.placeholder ${colorSetStr colors.placeholder}"
|
"client.unfocused ${colorSetStr colors.unfocused}"
|
||||||
"client.background ${colors.background}"
|
"client.urgent ${colorSetStr colors.urgent}"
|
||||||
(keybindingsStr {
|
"client.placeholder ${colorSetStr colors.placeholder}"
|
||||||
keybindings = keybindingDefaultWorkspace;
|
"client.background ${colors.background}"
|
||||||
bindsymArgs =
|
(keybindingsStr {
|
||||||
lib.optionalString (cfg.config.bindkeysToCode) "--to-code";
|
keybindings = keybindingDefaultWorkspace;
|
||||||
})
|
bindsymArgs =
|
||||||
(keybindingsStr {
|
lib.optionalString (cfg.config.bindkeysToCode) "--to-code";
|
||||||
keybindings = keybindingsRest;
|
})
|
||||||
bindsymArgs =
|
(keybindingsStr {
|
||||||
lib.optionalString (cfg.config.bindkeysToCode) "--to-code";
|
keybindings = keybindingsRest;
|
||||||
})
|
bindsymArgs =
|
||||||
(keycodebindingsStr keycodebindings)
|
lib.optionalString (cfg.config.bindkeysToCode) "--to-code";
|
||||||
] ++ mapAttrsToList inputStr input
|
})
|
||||||
++ mapAttrsToList outputStr output # outputs
|
(keycodebindingsStr keycodebindings)
|
||||||
++ mapAttrsToList seatStr seat # seats
|
] ++ mapAttrsToList inputStr input
|
||||||
++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes
|
++ mapAttrsToList outputStr output # outputs
|
||||||
++ mapAttrsToList assignStr assigns # assigns
|
++ mapAttrsToList seatStr seat # seats
|
||||||
++ map barStr bars # bars
|
++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes
|
||||||
++ optional (gaps != null) gapsStr # gaps
|
++ mapAttrsToList assignStr assigns # assigns
|
||||||
++ map floatingCriteriaStr floating.criteria # floating
|
++ map barStr bars # bars
|
||||||
++ map windowCommandsStr window.commands # window commands
|
++ optional (gaps != null) gapsStr # gaps
|
||||||
++ map startupEntryStr startup # startup
|
++ map floatingCriteriaStr floating.criteria # floating
|
||||||
++ map workspaceOutputStr workspaceOutputAssign # custom mapping
|
++ map windowCommandsStr window.commands # window commands
|
||||||
)
|
++ map startupEntryStr startup # startup
|
||||||
else
|
++ map workspaceOutputStr workspaceOutputAssign # custom mapping
|
||||||
[ ]) ++ (optional cfg.systemd.enable systemdActivation)
|
)
|
||||||
++ (optional (!cfg.xwayland) "xwayland disable") ++ [ cfg.extraConfig ]));
|
else
|
||||||
|
[ ]) ++ (optional cfg.systemd.enable systemdActivation)
|
||||||
|
++ (optional (!cfg.xwayland) "xwayland disable")
|
||||||
|
++ [ cfg.extraConfig ]));
|
||||||
|
};
|
||||||
|
|
||||||
defaultSwayPackage = pkgs.sway.override {
|
defaultSwayPackage = pkgs.sway.override {
|
||||||
extraSessionCommands = cfg.extraSessionCommands;
|
extraSessionCommands = cfg.extraSessionCommands;
|
||||||
|
|
Loading…
Reference in a new issue