plasma: configure default gtk theme
This commit is contained in:
parent
da33ec4712
commit
bab66bc390
1 changed files with 55 additions and 0 deletions
|
|
@ -1,7 +1,62 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
themeName = "Breeze";
|
||||
gtk3and4settings = lib.generators.toINI {} {
|
||||
Settings = {
|
||||
gtk-theme-name = themeName;
|
||||
gtk-cursor-theme-name = "breeze_cursors";
|
||||
};
|
||||
};
|
||||
|
||||
# The configuration files that Plasma made have set the theme in gtkrc, not gtkrc-2.0
|
||||
# which is weird cause applying the theme to gtk1 but not 2 is dumb. I'll write it to
|
||||
# both files just in case :3
|
||||
gtk1and2settings = ''
|
||||
include "/run/current-system/sw/share/themes/${themeName}/gtk-2.0/gtkrc"
|
||||
gtk-theme-name="${themeName}"
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
# Enable the Plasma 5 Desktop Environment.
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
|
||||
# GTK apps need dconf to grab the correct theme on Wayland
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# The NixOS dconf module doesn't support creating databases
|
||||
# (https://github.com/NixOS/nixpkgs/issues/54150), so I'm
|
||||
# doing it manualy
|
||||
|
||||
# https://help.gnome.org/admin/system-admin-guide/stable/dconf-custom-defaults.html.en
|
||||
environment.etc = {
|
||||
"dconf/profile/user".text = "user-db:user\nsystem-db:local";
|
||||
"dconf/db/local.d/00-defaultTheme".text = ''
|
||||
[org/gnome/desktop/interface]
|
||||
gtk-theme='${themeName}'
|
||||
'';
|
||||
};
|
||||
|
||||
system.activationScripts = {
|
||||
dconf = {
|
||||
text= ''
|
||||
echo "updating system dconf database..."
|
||||
${pkgs.dconf}/bin/dconf update
|
||||
touch /testfile
|
||||
'';
|
||||
deps = [ "etc" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Set up GTK to use Breeze instead of adwaita by default
|
||||
# Theese only seem to work on X11, not wayland
|
||||
environment.etc = {
|
||||
"xdg/gtk-4.0/settings.ini".text = gtk3and4settings;
|
||||
"xdg/gtk-3.0/settings.ini".text = gtk3and4settings;
|
||||
"xdg/gtkrc-2.0".text = gtk1and2settings;
|
||||
"xdg/gtkrc".text = gtk1and2settings;
|
||||
};
|
||||
environment.systemPackages = [pkgs.yaru-theme];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue