From 4a66e3a8018224dc25bc54c3208c74266dbc8bf9 Mon Sep 17 00:00:00 2001 From: Felix S Date: Wed, 11 Mar 2026 15:27:35 +0100 Subject: [PATCH 1/2] extended okular menu and background options --- modules/apps/okular.nix | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/modules/apps/okular.nix b/modules/apps/okular.nix index b5520f4a..d16601cb 100644 --- a/modules/apps/okular.nix +++ b/modules/apps/okular.nix @@ -128,6 +128,38 @@ with lib.types; "TrimSelect" ]); }; + + showMenuBar = lib.mkOption { + description = "Whether to show the menu bar."; + default = null; + type = nullOr bool; + }; + showSidebar = lib.mkOption { + description = "Whether to show the sidebar."; + default = null; + type = nullOr bool; + }; + lockSidebar = lib.mkOption { + description = "Whether to lock the sidebar from being toggled."; + default = null; + type = nullOr bool; + }; + fullScreen = lib.mkOption { + description = "Whether to open in fullscreen by default."; + default = null; + type = nullOr bool; + }; + useCustomBackgroundColor = lib.mkOption { + description = "Whether to set a custom background color (the color around the displayed page). By default, the Qt™ toolkit color is used when this option is unchecked. "; + default = null; + type = nullOr bool; + }; + backgroundColor = lib.mkOption { + description = "The RGB color that will fill the part of the screen not covered by the page when on presentation mode."; + default = null; + example = "255,255,255"; + type = nullOr str; + }; }; # ================================== @@ -246,6 +278,8 @@ with lib.types; "ViewContinuous" = applyIfSet gen.viewContinuous; "ViewMode" = applyIfSet gen.viewMode; "MouseMode" = applyIfSet gen.mouseMode; + "UseCustomBackgroundColor" = applyIfSet gen.useCustomBackgroundColor; + "BackgroundColor" = applyIfSet gen.backgroundColor; }; "Zoom" = { @@ -282,4 +316,25 @@ with lib.types; }; } ); + + config.programs.plasma.configFile."okularrc" = lib.mkIf cfg.enable ( + let + gen = cfg.general; + applyIfSet = opt: lib.mkIf (opt != null) opt; + in + { + "Desktop Entry" = { + "FullScreen" = applyIfSet gen.fullScreen; + }; + + "General" = { + "LockSidebar" = applyIfSet gen.lockSidebar; + "ShowSidebar" = applyIfSet gen.showSidebar; + }; + + "MainWindow" = { + "MenuBar" = applyIfSet (if gen.showMenuBar then "Enabled" else "Disabled"); + }; + } + ); } From 876f39b8068d774cb3975fea4163fab0cb631d1b Mon Sep 17 00:00:00 2001 From: Felix Schmitt <84468933+FelixSmtt@users.noreply.github.com> Date: Sat, 30 May 2026 11:12:40 +0200 Subject: [PATCH 2/2] Added color scheme to okular options --- modules/apps/okular.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/apps/okular.nix b/modules/apps/okular.nix index d16601cb..654c7e6d 100644 --- a/modules/apps/okular.nix +++ b/modules/apps/okular.nix @@ -160,6 +160,11 @@ with lib.types; example = "255,255,255"; type = nullOr str; }; + colorScheme = lib.mkOption { + description = "The color scheme used for the user interface. This does not affect the colors of the documents."; + default = null; + type = nullOr str; + }; }; # ================================== @@ -335,6 +340,10 @@ with lib.types; "MainWindow" = { "MenuBar" = applyIfSet (if gen.showMenuBar then "Enabled" else "Disabled"); }; + + "UiSettings" = { + "ColorScheme" = applyIfSet gen.colorScheme; + }; } ); }