Cursor Themes: Difference between revisions

AveryKoen (talk | contribs)
mNo edit summary
Pigs (talk | contribs)
m Add category configuration
 
(One intermediate revision by one other user not shown)
Line 34: Line 34:
         "Fuchsia-Pop";  
         "Fuchsia-Pop";  
</syntaxHighlight>
</syntaxHighlight>
== Troubleshooting ==
=== Cursor themes in Gnome apps under Hyprland are different / not applied ===
Try giving the Gnome apps an extra kick with:<syntaxhighlight lang="nix">
wayland.windowManager.hyprland.settings = {
  exec-once = [
    # Fixes cursor themes in gnome apps under hyprland
    "gsettings set org.gnome.desktop.interface cursor-theme '${config.home.pointerCursor.name}'"
    "gsettings set org.gnome.desktop.interface cursor-size ${toString home.pointerCursor.size}"
  ];
};
</syntaxhighlight>
=== Cursor themes in flatpaks are different / not applied ===
==== Set <code>xdg-desktop-portal-gtk</code> as fallback ====
Most flatpaks need the functions implemented by <code>xdg-desktop-portal-gtk</code> and other desktop portals are not always implementing everything in <code>xdg-desktop-portal-gtk</code> themself. So its a good idea to set<code>xdg-desktop-portal-gtk</code> as a fallback.
This can be achieved in home-manager through <code>xdg.portals.config</code>:<syntaxhighlight lang="nix">
xdg.portal = {
  config = {
    # example with hyprland
    hyprland.preferred = [ "hyprland" "gtk" ];
  };
};
</syntaxhighlight>OR in home-manager through <code>xdg.portals.configPackages</code>:<syntaxhighlight lang="nix">
xdg.portal = {
  # example with hyprland
  configPackages = [ pkgs.hyprland ];
  # has a file with /nix/store/...-hyprland-.../share/xdg-desktop-portal/hyprland-portals.conf
  # 1 │ [preferred]
  # 2 │ default=hyprland;gtk
};
</syntaxhighlight>Keep in mind that with the home-manager module <code>wayland.windowManager.hyprland.enable</code> this is already done. See [./Https://github.com/nix-community/home-manager/blob/22b418c13fb0be43f4bc5c185f323a3237028594/modules/services/window-managers/hyprland.nix#L298 github.com/nix-community/home-manager/blob/master/modules/services/window-managers/hyprland.nix]
==== Make sure <code>xdg-desktop-portal-gtk</code> is running ====
For flatpaks you need to make sure the <code>xdg-desktop-portal-gtk</code> is running in userspace, which is not automatically always the case (espacially on tiling windowManagers). So in home-manager you can set:<syntaxhighlight lang="nix">
xdg.portal = {
  enable = true;
  extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; # Fixes OpenURI and cursor themes in flatpaks
};
</syntaxhighlight>
==== Giving flatpaks permission to ''<code>/nix/store</code>'' ====
This already fixes themes for most apps like gnome. But not all (e.g. Obsidian or Logseq).
And since flatpaks are sandboxed and dont have access to the nix-store you need to give them permission, since the cursors are eventually linked to ''<code>/nix/store/...</code>'':<syntaxhighlight lang="shell">
flatpak --user override --filesystem=/nix/store:ro
</syntaxhighlight>OR with the https://github.com/gmodena/nix-flatpak homeManagerModule:<syntaxhighlight lang="nix">
services.flatpak = {
  enable = true;
  overrides = {
    global = {
      Context.filesystems = [ "/nix/store:ro" ];
    };
  };
};
</syntaxhighlight>
[[Category:Configuration]]