KDE: Difference between revisions

From NixOS Wiki
imported>Appetrosyan
m (Added file template)
imported>Appetrosyan
(Better heading hierarchy)
Line 4: Line 4:
</nowiki>}}
</nowiki>}}


== Enable GTK themes in KDE ==
== Tips and Tricks ==
=== Enable GTK themes in KDE ===


=== Enable GTK themes in KDE in KDE System Settings ===
==== Enable GTK themes in KDE in KDE System Settings ====


Nixpkgs now provides the GTK configuration module for KDE system settings, which you can install with:
Nixpkgs now provides the GTK configuration module for KDE system settings, which you can install with:
Line 14: Line 15:
You should also install any GTK themes you like. You can choose a GTK theme and set related options in <code>System Settings > Application Appearance > GTK</code>.
You should also install any GTK themes you like. You can choose a GTK theme and set related options in <code>System Settings > Application Appearance > GTK</code>.


=== Enable GTK themes in KDE manually ===
==== Enable GTK themes in KDE manually ====


As a normal nix user you can install the Oxygen GTK theme:
As a normal nix user you can install the Oxygen GTK theme:

Revision as of 13:05, 17 July 2021

Installation

/etc/nixos/configuration.nix
services.xserver.desktopManager.plasma5.enable = true;

Tips and Tricks

Enable GTK themes in KDE

Enable GTK themes in KDE in KDE System Settings

Nixpkgs now provides the GTK configuration module for KDE system settings, which you can install with:

$ nix-env -i kde-gtk-config

You should also install any GTK themes you like. You can choose a GTK theme and set related options in System Settings > Application Appearance > GTK.

Enable GTK themes in KDE manually

As a normal nix user you can install the Oxygen GTK theme:

$ nix-env -i oxygen-gtk

KDE will run any scripts you place in ~/.kde/env on startup so this is a good place to set the GTK_PATH so that applications can find the theme engine. If the path is wrong/unset you will see errors like this:

Gtk-WARNING **: Unable to locate theme engine in module_path

To set Oxygen-GTK as the gtk theme create the following file and make it executable: ~/.kde/env/set-gtk-theme.sh

#!/bin/sh

export GTK_PATH=$GTK_PATH:~/.nix-profile/lib/gtk-2.0
export GTK2_RC_FILES=$GTK2_RC_FILES:~/.nix-profile/share/themes/oxygen-gtk/gtk-2.0/gtkrc

Alternatively, on NixOS:

configuration.nix
environment = {
  systemPackages = [ pkgs.oxygen_gtk ];
  shellInit = ''
    export GTK_PATH=$GTK_PATH:${pkgs.oxygen_gtk}/lib/gtk-2.0
    export GTK2_RC_FILES=$GTK2_RC_FILES:${pkgs.oxygen_gtk}/share/themes/oxygen-gtk/gtk-2.0/gtkrc
  '';
};

Or alternatively, copy the themes folder in the home directory

$ cp -R ~/.nix-profile/share/themes/ ~/.themes