Without this, even if you configure a preference for Electron apps to
use Ozone by setting `NIXOS_OZONE_WL=1`, GUI apps launched through
systemd user services use XWayland, since the variable is not set in
their environment.
This fixes that issue by importing it, like we do other variables.
- The `XDG_SESSION_TYPE` environment variable is used by some applications and frameworks to
detect wayland sessions (i.e qt5/6, electron/chromium). It is set by wlroots since version 0.13.0 [1].
- Propagating `XDG_SESSION_TYPE` to the systemd user environment is necessary when processes launched by
services (e.g emacs) need to inherit the environment variable.
[1] - 90c8452959
Constrain the pgrep command to only return results for the current user.
Additionally, quote the socket variables to prevent splitting.
Previously, if multiple users on a system were running `sway`, the
`pgrep` used in finding `swaySocket` would return multiple results. As a
result, reloads of sway would fail.
Fixes#2912.
Before, loading a module would be guarded by an optional platform
condition. This made it possible to avoid loading and evaluating a
module if it did not support the host platform.
Unfortunately, this made it impossible to share a single configuration
between GNU/Linux and Darwin hosts, which some wish to do.
This removes the conditional load and instead inserts host platform
assertions in the modules that are platform specific.
Fixes#1906
* i3, sway: extract border functionality to common function
Converted the i3 module to use default_border and
default_floating_border and extracted that functionality out to be
shared between the i3 and sway modules.
* i3: add sumnerevans as maintainer
Using the final package in the `onChange` block broke some use cases.
This restores the old behavior and instead solves the test
dependencies in a different way.
Fixes#1611
This reverts commit 7c3c64208e.
`pgrep -x somecommand` exits with a non-zero status if it finds no
process running with the given name. When using home-manager as a
NixOS module, on boot (when sway isn't running) this script would
fail and then fail the unit since it seems the onChange scripts
are running with the -e switch.
This change ensures we're always returning a 0 exit status where we
attempt to get the pid of sway - we're only interested in either the
pid or an empty string, the exit status isn't important.