Minor refactors

This commit is contained in:
Henrik Lissner 2020-10-17 23:38:38 -04:00
parent b7c00a985c
commit 8f57daf4bd
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 9 additions and 5 deletions

View file

@ -9,9 +9,9 @@ with lib;
with lib.my; with lib.my;
let cfg = config.modules.desktop.browsers.qutebrowser; let cfg = config.modules.desktop.browsers.qutebrowser;
in { in {
options.modules.desktop.browsers.qutebrowser = { options.modules.desktop.browsers.qutebrowser = with types; {
enable = mkBoolOpt false; enable = mkBoolOpt false;
userStyles = mkOpt types.lines ""; userStyles = mkOpt lines "";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -32,7 +32,7 @@ in {
source = "${configDir}/qutebrowser"; source = "${configDir}/qutebrowser";
recursive = true; recursive = true;
}; };
dataFile."qutebrowser/userstyles.css".text = userStyles; dataFile."qutebrowser/userstyles.css".text = cfg.userStyles;
}; };
}; };
} }

View file

@ -114,13 +114,17 @@ in {
env.GTK_DATA_PREFIX = [ "${config.system.path}" ]; env.GTK_DATA_PREFIX = [ "${config.system.path}" ];
env.QT_QPA_PLATFORMTHEME = "gtk2"; env.QT_QPA_PLATFORMTHEME = "gtk2";
qt5 = { style = "gtk2"; platformTheme = "gtk2"; }; qt5 = { style = "gtk2"; platformTheme = "gtk2"; };
# Also, read xresources files in ~/.config/xtheme/* and init scripts in
# ~/.config/xsessions/*, so I can centralize my theme config files.
services.xserver.displayManager.sessionCommands = services.xserver.displayManager.sessionCommands =
let cfg = config.services.xserver.desktopManager.wallpaper; in '' let cfg = config.services.xserver.desktopManager.wallpaper; in ''
# Also, read xresources files in ~/.config/xtheme/* and init scripts in
# ~/.config/xsessions/*, so I can centralize my theme config files.
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc" export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
source "$XDG_CONFIG_HOME"/xsession/*.sh source "$XDG_CONFIG_HOME"/xsession/*.sh
xrdb -merge "$XDG_CONFIG_HOME"/xtheme/* xrdb -merge "$XDG_CONFIG_HOME"/xtheme/*
# Set the wallpaper ourselves so we don't need .background-image and/or
# .fehbg polluting $HOME
if [ -e "$XDG_DATA_HOME/wallpaper" ]; then if [ -e "$XDG_DATA_HOME/wallpaper" ]; then
${pkgs.feh}/bin/feh --bg-${cfg.mode} \ ${pkgs.feh}/bin/feh --bg-${cfg.mode} \
${optionalString cfg.combineScreens "--no-xinerama"} \ ${optionalString cfg.combineScreens "--no-xinerama"} \