gtk: moved the theme directory from '~/.themes' to '~/.local/share/themes'
changed one variable to make gtk themes generate in ~/.local/share/themes to adhere to the xdg specifications
could/should this be done with xdg.dataFile?
when I try replacing ${config.home.homeDirectory} to ${config.xdg.dataFile}
I get this error:
warning: Git tree '/home/starry/.local/nix' is dirty
building the system configuration...
warning: Git tree '/home/starry/.local/nix' is dirty
error:
… while calling the 'head' builtin
at /nix/store/5ds20jm3x2s4z7wn3581r6lc9ybmh45b-source/lib/attrsets.nix:1534:13:
1533| if length values == 1 || pred here (elemAt values 1) (head values) then
1534| head values
| ^
1535| else
… while evaluating the attribute 'value'
at /nix/store/5ds20jm3x2s4z7wn3581r6lc9ybmh45b-source/lib/modules.nix:1084:7:
1083| // {
1084| value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
1085| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/store/5ds20jm3x2s4z7wn3581r6lc9ybmh45b-source/nixos/modules/system/activation/top-level.nix':
… while evaluating the option `warnings':
… while evaluating definitions from `/nix/store/5ds20jm3x2s4z7wn3581r6lc9ybmh45b-source/nixos/modules/system/boot/systemd.nix':
… while evaluating the option `systemd.services.home-manager-starry.serviceConfig':
… while evaluating definitions from `/nix/store/dpn4lj4ll8972gsdhjrhamxyxri8g6ql-source/nixos':
… while evaluating the option `home-manager.users.starry.home.file."/home/starry/.local/share/flatpak/overrides/global".source':
… while evaluating definitions from `/nix/store/dpn4lj4ll8972gsdhjrhamxyxri8g6ql-source/modules/files.nix':
… while evaluating the option `home-manager.users.starry.home.file."/home/starry/.local/share/flatpak/overrides/global".text':
… while evaluating definitions from `/nix/store/dpn4lj4ll8972gsdhjrhamxyxri8g6ql-source/modules/misc/xdg.nix':
… while evaluating the option `home-manager.users.starry.xdg.dataFile."flatpak/overrides/global".text':
… while evaluating definitions from `/nix/store/fk2xyq5r00135cvpsaz091cld1cgfjaa-source/modules/gtk/hm.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: cannot coerce a set to a string: { "fcitx5/themes/stylix/highlight.svg" = { enable = true; executable = null; force = false; onChange = ""; recursive = false; source = "/nix/store/vri736vjyfc75ahwvws4lzf4j3cp49i9-catppuccin-frappe/base16-catppuccin-frappesvg"; target = ".local/share/fcitx5/themes/stylix/highlight.svg"; text = null; }; "fcitx5/themes/stylix/panel.svg" = { enable = true; «7 attributes elided» }; «7 attributes elided» }
It actually worked fine this time :DD
lol I forgot :P
yipeeeeeeeeeeeee :3
there is one issue however
flatpak apps doesn't seem to support the theme
It seems like the issue is from the GTK_THEME variable not pointing to the correct theme for some reason
Perhaps something is different inside the Flatpak environment so that it only looks at ~/.themes? Is there a way to mount the filesystem inside Flatpak at that path while still using the new path outside?
the override mount the ~/.local/share/themes directory but for some reason the app can't detect the theme
It turns out that flatpak can't detect themes in the ~/.local/share/themes directory even if they are mounted to the flatpak environment
https://discussion.fedoraproject.org/t/flatpaks-dont-use-applied-theme-even-when-giving-them-access/126475
It turns out that flatpak can't detect themes in the
~/.local/share/themesdirectory even if they are mounted to the flatpak environmenthttps://discussion.fedoraproject.org/t/flatpaks-dont-use-applied-theme-even-when-giving-them-access/126475
Maybe a similar approach to commit 963e77a3a4fc ("gtk: add support for theming Flatpak applications (#693)") is possible here.
It turns out that flatpak can't detect themes in the
~/.local/share/themesdirectory even if they are mounted to the flatpak environment https://discussion.fedoraproject.org/t/flatpaks-dont-use-applied-theme-even-when-giving-them-access/126475Maybe a similar approach to commit 963e77a ("gtk: add support for theming Flatpak applications (#693)") is possible here.
does it use the ~/.themes only when flatpak compatibility is enabled and when it's disabled it uses ~/.local/share/themes ?
It turns out that flatpak can't detect themes in the
~/.local/share/themesdirectory even if they are mounted to the flatpak environment https://discussion.fedoraproject.org/t/flatpaks-dont-use-applied-theme-even-when-giving-them-access/126475Maybe a similar approach to commit 963e77a ("gtk: add support for theming Flatpak applications (#693)") is possible here.
does it use the
~/.themesonly when flatpak compatibility is enabled and when it's disabled it uses~/.local/share/themes?
IIUC, it simply adds a
(lib.mkIf cfg.flatpakSupport.enable /* ... */)
clause to handle Flatpak additionally.
okay :3
tbh I don't know what to do from here :v
I was thinking of making a symlink to ~/.local/themes in the ~/.themes of the flatpak local home directory but I don't think there is a way to do such thing
@brckd, do you mind helping out? You might be more familiar with the Flatpak workings.
Hi, thanks for mentioning me! As you have figured out, placing the theme files in ~/.themes was a workaround to make Flatpak apps work with GTK. These files are exclusively used for Flatpak support. IIRC the GTK theme set by Home Manager is already located in the recommended XDG directory. I chose the non-standard directory in order to not override that theme and because it had more legacy support.
I apologize for not making this fact more clear before. However, I think this discussion is still valuable, since the Flatpak support had issues with some apps, which weren't colored correctly. Last time I checked I couldn't find a workaround for it, but I believe it was caused by this non-standard theming approach.