Sway: Difference between revisions

Phobos (talk | contribs)
m Added link to flameshot page
Phobos (talk | contribs)
m Additions and syntax updates
Line 39: Line 39:


=== Using Home Manager ===
=== Using Home Manager ===
To set up Sway using [[Home Manager]], you must first enable [[Polkit]] in your NixOS configuration:
To set up Sway using [[Home Manager]], you must first enable [[Polkit]] in your NixOS configuration.
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
security.polkit.enable = true;
security.polkit.enable = true;
Line 192: Line 192:


In ~/.config/sway/config
In ~/.config/sway/config
<syntaxhighlight>
<syntaxhighlight>seat "*" xcursor_theme Adwaita 32</syntaxhighlight>
seat "*" xcursor_theme Adwaita 32
</syntaxhighlight>


==== With Home Manager ====
==== With Home Manager ====


Using [[Home Manager]] try configuring a general mouse cursor size and theme. The reason that your cursor might be missing in some applications, is because <code>XCURSOR_THEME</code>is missing, which will cause applications relying on <code>XWAYLAND</code> to misbehave. Setting <code>sway.enable = true</code>, combined with the <code>name</code>, <code>package</code> and size will set the correct environment variables, which sway will then use.
Using [[Home Manager]] you may configure the mouse cursor size and theme. The reason that your cursor might be missing in some applications, is because <code>XCURSOR_THEME</code> is missing, which will cause applications relying on <code>XWAYLAND</code> to misbehave. Setting <code>sway.enable = true</code>, combined with the <code>name</code>, <code>package</code> and size will set the correct environment variables, which sway will then use.


<syntaxhighlight lang="nix">home-manager.users.myUser = {
{{File|3=home.pointerCursor = {
     home.pointerCursor = {
     name = "Adwaita";
      name = "Adwaita";
    package = pkgs.adwaita-icon-theme;
      package = pkgs.adwaita-icon-theme;
    size = 24;
      size = 24;
    x11 = {
      x11 = {
      enable = true;
        enable = true;
      defaultCursor = "Adwaita";
        defaultCursor = "Adwaita";
      };
      sway.enable = true;
     };
     };
};</syntaxhighlight>


Replace <code>myUser</code> with your user running the graphical environment.
  sway.enable = true;
 
};|name=/etc/nixos/home.nix|lang=nix}}


=== Missing fonts on Xorg applications ===
=== Missing fonts in Xorg applications ===


If fonts for certain languages are missing in Xorg applications (e.g. Japanese fonts don't appear in Discord) even though they're in the system, you can set them as default fonts in your configuration file.
If fonts for certain languages are missing in Xorg applications (e.g. Japanese fonts don't appear in Discord) even though they're in the system, you can set them as default fonts in your configuration file.


<syntaxhighlight lang="nix>
<syntaxhighlight lang="nix>