nixos-config/profiles/workspace/kde/qt.nix

223 lines
6.4 KiB
Nix
Raw Normal View History

2020-02-17 17:00:59 +04:00
{ pkgs, lib, config, ... }:
2023-02-16 18:51:34 +04:00
with pkgs.my-lib;
let
colorTheme = with (thmDec config.themes.colors); {
"Colors:Button" = {
BackgroundAlternate = base01;
BackgroundNormal = base01;
DecorationFocus = base0D;
DecorationHover = base0D;
ForegroundActive = base0D;
ForegroundInactive = base01;
ForegroundLink = base0D;
ForegroundNegative = base08;
ForegroundNeutral = base09;
ForegroundNormal = base05;
ForegroundPositive = base0B;
ForegroundVisited = base03;
};
"Colors:Complementary" = {
BackgroundAlternate = base01;
BackgroundNormal = base03;
DecorationFocus = base0D;
DecorationHover = base0D;
ForegroundActive = base0D;
ForegroundInactive = base01;
ForegroundLink = base0D;
ForegroundNegative = base08;
ForegroundNeutral = base0A;
ForegroundNormal = base05;
ForegroundPositive = base0B;
ForegroundVisited = base02;
};
"Colors:Selection" = {
BackgroundAlternate = base0D;
BackgroundNormal = base0D;
DecorationFocus = base0D;
DecorationHover = base0D;
ForegroundActive = base05;
ForegroundInactive = base05;
ForegroundLink = base0D;
ForegroundNegative = base08;
ForegroundNeutral = base09;
ForegroundNormal = base05;
ForegroundPositive = base0B;
ForegroundVisited = base02;
};
"Colors:Tooltip" = {
BackgroundAlternate = base01;
BackgroundNormal = base00;
DecorationFocus = base0D;
DecorationHover = base0D;
ForegroundActive = base0D;
ForegroundInactive = base01;
ForegroundLink = base0D;
ForegroundNegative = base08;
ForegroundNeutral = base09;
ForegroundNormal = base05;
ForegroundPositive = base0B;
ForegroundVisited = base03;
};
"Colors:View" = {
BackgroundAlternate = base01;
BackgroundNormal = base00;
DecorationFocus = base0D;
DecorationHover = base0D;
ForegroundActive = base0D;
ForegroundInactive = base01;
ForegroundLink = base0D;
ForegroundNegative = base08;
ForegroundNeutral = base09;
ForegroundNormal = base05;
ForegroundPositive = base0B;
ForegroundVisited = base03;
};
"Colors:Window" = {
BackgroundAlternate = base01;
BackgroundNormal = base00;
DecorationFocus = base0D;
DecorationHover = base0D;
ForegroundActive = base0D;
ForegroundInactive = base01;
ForegroundLink = base0D;
ForegroundNegative = base08;
ForegroundNeutral = base09;
ForegroundNormal = base05;
ForegroundPositive = base0B;
ForegroundVisited = base03;
};
General = {
ColorScheme = "Generated";
Name = "Generated";
shadeSortColumn = true;
};
KDE.contrast = 4;
WM = {
activeBackground = base00;
activeBlend = base06;
activeForeground = base05;
inactiveBackground = base01;
inactiveBlend = base02;
inactiveForeground = base04;
};
};
misc = with config.themes; {
Icons.Theme = "breeze-dark";
KDE = {
DoubleClickInterval = 400;
ShowDeleteCommand = true;
SingleClick = false;
StartDragDist = 4;
StartDragTime = 500;
WheelScrollLines = 3;
widgetStyle = "Breeze";
};
General = {
2023-02-24 14:33:13 +04:00
TerminalApplication = config.defaultApplications.term.cmd;
2023-02-16 18:51:34 +04:00
fixed =
"${fonts.mono.family},${toString fonts.mono.size},-1,5,50,0,0,0,0,0";
font =
"${fonts.main.family},${toString fonts.main.size},-1,5,50,0,0,0,0,0";
menuFont =
"${fonts.main.family},${toString fonts.main.size},-1,5,50,0,0,0,0,0";
smallestReadableFont = "${fonts.main.family},${
toString fonts.main.size
},-1,5,57,0,0,0,0,0,Medium";
toolBarFont =
"${fonts.main.family},${toString fonts.main.size},-1,5,50,0,0,0,0,0";
};
};
effects = with (thmDec config.themes.colors); {
"ColorEffects:Disabled" = {
Color = base02;
ColorAmount = "0";
ColorEffect = "0";
ContrastAmount = "0.65";
ContrastEffect = "1";
IntensityAmount = "0.1";
IntensityEffect = "2";
};
"ColorEffects:Inactive" = {
ChangeSelectionColor = "true";
Color = base03;
ColorAmount = "0.025";
ColorEffect = "2";
ContrastAmount = "0.1";
ContrastEffect = "2";
Enable = "false";
IntensityAmount = "0";
IntensityEffect = "0";
};
};
desktopThemeColors = pkgs.writeText "generated-plasma-theme-colors"
(lib.generators.toGitINI
(builtins.foldl' lib.recursiveUpdate { } [ colorTheme effects ]));
desktopThemeRc = pkgs.writeText "generated-plasma-theme-rc"
(lib.generators.toGitINI {
Wallpaper = {
defaultWallpaperTheme = "Next";
defaultFileSuffix = ".png";
defaultWidth = "1920";
defaultHeight = "1080";
};
ContrastEffect = {
enabled = "true";
contrast = "0.17";
intensity = "1.25";
saturation = "9";
};
AdaptiveTransparency.enabled = "true";
});
desktopTheme = pkgs.linkFarm "generated-plasma-theme" [
{
name = "share/plasma/desktoptheme/generated/plasmarc";
path = desktopThemeRc;
}
{
name = "share/plasma/desktoptheme/generated/colors";
path = desktopThemeColors;
}
];
in {
environment.systemPackages = [ desktopTheme ];
2020-02-17 17:00:59 +04:00
xdg.portal.enable = true;
2023-08-07 13:59:30 +04:00
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
2023-02-16 18:51:34 +04:00
services.dbus.packages = [ pkgs.systemd pkgs.breeze-icons ];
2021-01-21 22:13:53 +04:00
services.udev.packages = [ pkgs.libmtp pkgs.media-player-info ];
2020-06-21 20:23:14 +04:00
2023-02-16 18:51:34 +04:00
qt.enable = false;
2021-09-12 22:24:48 +04:00
2020-02-17 17:00:59 +04:00
environment.sessionVariables = {
QT_XFT = "true";
QT_SELECT = "5";
KDE_SESSION_VERSION = "5";
QT_SCALE_FACTOR = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "0";
2020-04-28 21:48:57 +04:00
QT_QPA_PLATFORMTHEME = "kde";
2023-02-22 00:34:25 +04:00
QT_QUICK_CONTROLS_STYLE = "org.kde.breeze";
2021-01-21 22:13:53 +04:00
KDEDIRS =
"/run/current-system/sw:/run/current-system/sw/share/kservices5:/run/current-system/sw/share/kservicetypes5:/run/current-system/sw/share/kxmlgui5";
2020-02-17 17:00:59 +04:00
};
2023-01-24 17:51:04 +04:00
defaultApplications = {
fm = {
cmd = "${pkgs.dolphin}/bin/dolphin";
desktop = "org.kde.dolphin";
};
archive = {
cmd = "${pkgs.ark}/bin/ark";
desktop = "org.kde.ark";
};
};
2023-02-16 18:51:34 +04:00
home-manager.users.balsoft = {
2023-01-24 17:51:04 +04:00
home.packages = [ pkgs.ark pkgs.dolphin ];
2021-01-21 22:13:53 +04:00
2023-02-16 18:51:34 +04:00
xdg.configFile."kdeglobals".text = lib.generators.toGitINI
2023-02-22 00:34:25 +04:00
(builtins.foldl' lib.recursiveUpdate { } [ colorTheme effects misc ]);
2020-02-17 17:00:59 +04:00
};
}