Sway: Difference between revisions
imported>Svrana m add i3-ratiosplit info (works for i3 and sway) |
imported>Rasmus-kirk Changed systemd sway configuration since the old was broken |
||
Line 167: | Line 167: | ||
In an article on the sway wiki [https://github.com/swaywm/sway/wiki/Systemd-integration], a way to integrate Sway with systemd user services is proposed. Starting sway that way has some benefits: | In an article on the sway wiki [https://github.com/swaywm/sway/wiki/Systemd-integration], a way to integrate Sway with systemd user services is proposed. Starting sway that way has some benefits: | ||
* Services like Waybar, kanshi, redshift can depend on <code>graphical-session.target</code> and can therefore be started as their own user service, including convenient service management and logging. | * Services like Waybar, kanshi, redshift can depend on <code>graphical-session.target</code> and can therefore be started as their own user service, including convenient service management and logging. | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ config, pkgs, lib, ... }: { | { config, pkgs, lib, ... }: { | ||
Line 192: | Line 190: | ||
"xdg/waybar/config".source = ./dotfiles/waybar/config; | "xdg/waybar/config".source = ./dotfiles/waybar/config; | ||
"xdg/waybar/style.css".source = ./dotfiles/waybar/style.css; | "xdg/waybar/style.css".source = ./dotfiles/waybar/style.css; | ||
}; | }; | ||
}; | }; | ||
Line 266: | Line 217: | ||
} | } | ||
</syntaxhighlight> | |||
And then simply add the following to the ''end'' of your sway configuration | |||
<syntaxhighlight> | |||
exec "systemctl --user import-environment; systemctl --user start sway-session.target" | |||
</syntaxhighlight> | </syntaxhighlight> | ||