Further progress, improved dark mode handling
This commit is contained in:
1 parent
36c9c7a90d
commit
23c2ef87b0
7 files changed
+295
-163
No files matched your search
@@ -11,6 +11,8 @@
|
||||
./foot/default.nix
|
||||
./mako/default.nix
|
||||
./obsidian/default.nix
|
||||
./rofi/default.nix
|
||||
./rofi/rofi-rbw.nix
|
||||
./shell/bash.nix
|
||||
./shell/fish.nix
|
||||
./steam/default.nix
|
||||
|
||||
@@ -11,6 +11,7 @@ in {
|
||||
];
|
||||
|
||||
options.modules.desktop = {
|
||||
wayland = mkEnableOption "wayland";
|
||||
initScript = mkOption {
|
||||
type = types.lines;
|
||||
default = "${pkgs.bash}/bin/bash";
|
||||
@@ -19,6 +20,11 @@ in {
|
||||
};
|
||||
|
||||
config = {
|
||||
home.packages = optionals cfg.wayland (with pkgs; [
|
||||
pkgs.wl-clipboard
|
||||
pkgs.wtype
|
||||
]);
|
||||
|
||||
home.file.".initrc" = {
|
||||
enable = true;
|
||||
executable = true;
|
||||
|
||||
@@ -10,6 +10,9 @@ in {
|
||||
# };
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Set desktop type to wayland
|
||||
modules.desktop.wayland = true;
|
||||
|
||||
# Change desktop to execute river
|
||||
modules.desktop.initScript = ''
|
||||
river
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rofi;
|
||||
theme = config.theming;
|
||||
colors = theme.colors;
|
||||
in {
|
||||
options.modules.rofi.enable = mkEnableOption "rofi";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
package = pkgs.rofi-wayland;
|
||||
font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}";
|
||||
theme = let
|
||||
inherit (config.lib.formats.rasi) mkLiteral;
|
||||
in {
|
||||
"*" = {
|
||||
background-color = mkLiteral "rgba(0, 0, 0, 0%)";
|
||||
border-color = mkLiteral "#${colors.fg}";
|
||||
text-color = mkLiteral "#${colors.fg}";
|
||||
};
|
||||
mainbox = {
|
||||
background-color = mkLiteral "#${colors.bg}";
|
||||
border = mkLiteral "${toString theme.layout.borderSize}px";
|
||||
};
|
||||
element-text = {
|
||||
highlight = mkLiteral "#${colors.accent}";
|
||||
};
|
||||
inputbar = {
|
||||
children = mkLiteral "[textbox-search, entry]";
|
||||
};
|
||||
listview = {
|
||||
padding = mkLiteral "2px 0px";
|
||||
};
|
||||
textbox-search = {
|
||||
expand = false;
|
||||
content = "> ";
|
||||
};
|
||||
"inputbar, message" = {
|
||||
padding = mkLiteral "2px";
|
||||
};
|
||||
element = {
|
||||
padding = mkLiteral "0px 2px";
|
||||
};
|
||||
"element selected" = {
|
||||
background-color = mkLiteral "#${colors.focused}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rofi-rbw;
|
||||
in {
|
||||
options.modules.rofi-rbw.enable = mkEnableOption "rofi-rbw";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
modules.rofi.enable = true;
|
||||
|
||||
home.packages = [
|
||||
pkgs.rofi-rbw
|
||||
];
|
||||
|
||||
# TODO: Move to separate module and make configurable
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
base_url = "https://keys.bulthuis.dev";
|
||||
identity_url = "https://keys.bulthuis.dev";
|
||||
email = "jan@bulthuis.dev";
|
||||
pinentry = pkgs.pinentry;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -104,6 +104,12 @@ in {
|
||||
description = "Base 16 color scheme to use for styling. See stylix documentation for more information.";
|
||||
};
|
||||
|
||||
clientSideDecorations = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable client side decorations for windows.";
|
||||
};
|
||||
|
||||
schemeColors = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
default = config.lib.stylix.colors;
|
||||
@@ -208,6 +214,45 @@ in {
|
||||
# Install configured fonts
|
||||
home.packages = fontPackageList;
|
||||
|
||||
# Configure gnome theme
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = if cfg.darkMode then "prefer-dark" else "prefer-light";
|
||||
};
|
||||
};
|
||||
|
||||
# Configure qt theme
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "adwaita";
|
||||
style.name = if cfg.darkMode then "adwaita-dark" else "adwaita-light";
|
||||
};
|
||||
|
||||
# Configure gtk theme
|
||||
gtk = let
|
||||
disableCSD = ''
|
||||
headerbar.default-decoration {
|
||||
margin-bottom: 50px;
|
||||
margin-top: -100px;
|
||||
}
|
||||
|
||||
window.csd,
|
||||
window.csd decoration {
|
||||
box-shadow: none;
|
||||
}
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
|
||||
theme = {
|
||||
name = if cfg.darkMode then "Adwaita-dark" else "Adwaita-light";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
|
||||
gtk3.extraCss = mkIf !cfg.clientSideDecorations disableCSD;
|
||||
gtk4.extraCss = mkIf !cfg.clientSideDecorations disableCSD;
|
||||
}
|
||||
|
||||
# Enable stylix
|
||||
# TODO: Move to own module
|
||||
stylix = {
|
||||
|
||||
Reference in new issue
Block a user