Compare commits

..

2 Commits

Author SHA1 Message Date
Noah Masur
9ec448ad9c move keybinds to sxhkd 2023-08-06 16:38:37 -04:00
Noah Masur
f22768545b start to add sway config 2023-08-06 16:38:37 -04:00
7 changed files with 20 additions and 122 deletions

View File

@ -44,8 +44,7 @@
# Better local mail search # Better local mail search
programs.notmuch = { programs.notmuch = {
enable = true; enable = true;
new.ignore = new.ignore = [ ".mbsyncstate.lock" ".mbsyncstate.journal" ];
[ ".mbsyncstate.lock" ".mbsyncstate.journal" ".mbsyncstate.new" ];
}; };
accounts.email = { accounts.email = {

View File

@ -5,7 +5,7 @@
programs.gh = programs.gh =
lib.mkIf config.home-manager.users.${config.user}.programs.git.enable { lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
enable = true; enable = true;
gitCredentialHelper.enable = true; enableGitCredentialHelper = true;
settings.git_protocol = "https"; settings.git_protocol = "https";
}; };

View File

@ -3,7 +3,6 @@
imports = [ imports = [
./dunst.nix ./dunst.nix
./fonts.nix ./fonts.nix
./gtk.nix
./i3.nix ./i3.nix
./picom.nix ./picom.nix
./polybar.nix ./polybar.nix

View File

@ -1,116 +0,0 @@
{ config, pkgs, lib, ... }:
let
# Based on: https://gitlab.com/rycee/nur-expressions/-/blob/7ae92e3497e1f1805fb849510120e2ee393018cd/pkgs/materia-theme/default.nix
gtkTheme = pkgs.stdenv.mkDerivation rec {
pname = "materia-custom";
version = "20210322";
src = pkgs.fetchFromGitHub {
owner = "nana-4";
repo = "materia-theme";
rev = "v${version}";
sha256 = "1fsicmcni70jkl4jb3fvh7yv0v9jhb8nwjzdq8vfwn256qyk0xvl";
};
nativeBuildInputs = with pkgs; [
bc
optipng
sassc
(runCommandLocal "rendersvg" { } ''
mkdir -p $out/bin
ln -s ${resvg}/bin/resvg $out/bin/rendersvg
'')
];
dontConfigure = true;
# Fixes problem "Fontconfig error: Cannot load default config file"
FONTCONFIG_FILE =
pkgs.makeFontsConf { fontDirectories = [ pkgs.cantarell-fonts ]; };
# Derivation adds an extra # so we need to remove it from our colorscheme
theme = let stripHash = color: lib.strings.removePrefix "#" color;
in lib.generators.toKeyValue { } {
# Color selection copied from
# https://github.com/pinpox/nixos-home/blob/1cefe28c72930a0aed41c20d254ad4d193a3fa37/gtk.nix#L11
ACCENT_BG = stripHash config.theme.colors.base0B;
ACCENT_FG = stripHash config.theme.colors.base00;
BG = stripHash config.theme.colors.base00;
BTN_BG = stripHash config.theme.colors.base02;
BTN_FG = stripHash config.theme.colors.base06;
FG = stripHash config.theme.colors.base05;
HDR_BG = stripHash config.theme.colors.base02;
HDR_BTN_BG = stripHash config.theme.colors.base01;
HDR_BTN_FG = stripHash config.theme.colors.base05;
HDR_FG = stripHash config.theme.colors.base05;
MATERIA_SURFACE = stripHash config.theme.colors.base01;
MATERIA_VIEW = stripHash config.theme.colors.base01;
MENU_BG = stripHash config.theme.colors.base02;
MENU_FG = stripHash config.theme.colors.base06;
SEL_BG = stripHash config.theme.colors.base04;
SEL_FG = stripHash config.theme.colors.base05;
TXT_BG = stripHash config.theme.colors.base02;
TXT_FG = stripHash config.theme.colors.base07;
WM_BORDER_FOCUS = stripHash config.theme.colors.base03;
WM_BORDER_UNFOCUS = stripHash config.theme.colors.base02;
MATERIA_COLOR_VARIANT = if config.theme.dark then "dark" else "light";
MATERIA_STYLE_COMPACT = "True";
UNITY_DEFAULT_LAUNCHER_STYLE = "False";
};
passAsFile = [ "theme" ];
postPatch = ''
patchShebangs .
sed -e '/handle-horz-.*/d' -e '/handle-vert-.*/d' \
-i ./src/gtk-2.0/assets.txt
'';
buildPhase = ''
export HOME="$NIX_BUILD_ROOT"
./change_color.sh \
-i False \
-t $out/share/themes \
-o "materia-custom" \
"$themePath"
'';
};
in {
config = lib.mkIf config.gui.enable {
home-manager.users.${config.user} = {
gtk = let
gtkExtraConfig = {
gtk-application-prefer-dark-theme = config.theme.dark;
};
in {
enable = true;
theme = {
name = "materia-custom";
package = gtkTheme;
};
gtk3.extraConfig = gtkExtraConfig;
gtk4.extraConfig = gtkExtraConfig;
};
};
# Make the login screen dark
services.xserver.displayManager.lightdm.greeters.gtk.theme = {
name = config.home-manager.users.${config.user}.gtk.theme.name;
package = gtkTheme;
};
environment.sessionVariables = {
GTK_THEME = config.home-manager.users.${config.user}.gtk.theme.name;
};
};
}

View File

@ -25,7 +25,7 @@ in {
| ${rofi}/bin/rofi \ | ${rofi}/bin/rofi \
-theme-str '@import "power.rasi"' \ -theme-str '@import "power.rasi"' \
-hover-select \ -hover-select \
-me-select-entry "" \ -me-select-entry ''' \
-me-accept-entry MousePrimary \ -me-accept-entry MousePrimary \
-dmenu \ -dmenu \
-sep ';' \ -sep ';' \

View File

@ -32,7 +32,7 @@ done
chosen=$(printf '%s;%s\n' "$yes" "$no" | chosen=$(printf '%s;%s\n' "$yes" "$no" |
rofi -theme-str '@import "prompt.rasi"' \ rofi -theme-str '@import "prompt.rasi"' \
-hover-select \ -hover-select \
-me-select-entry "" \ -me-select-entry '' \
-me-accept-entry MousePrimary \ -me-accept-entry MousePrimary \
-p "$query" \ -p "$query" \
-dmenu \ -dmenu \

View File

@ -36,6 +36,9 @@
enable = config.services.xserver.enable; enable = config.services.xserver.enable;
background = config.wallpaper; background = config.wallpaper;
# Make the login screen dark
greeters.gtk.theme = gtkTheme;
# Show default user # Show default user
# Also make sure /var/lib/AccountsService/users/<user> has SystemAccount=false # Also make sure /var/lib/AccountsService/users/<user> has SystemAccount=false
extraSeatDefaults = '' extraSeatDefaults = ''
@ -56,6 +59,8 @@
services.dbus.packages = [ pkgs.dconf ]; services.dbus.packages = [ pkgs.dconf ];
programs.dconf.enable = true; programs.dconf.enable = true;
environment.sessionVariables = { GTK_THEME = config.gtk.theme.name; };
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.fish.shellAliases = { programs.fish.shellAliases = {
@ -63,6 +68,17 @@
pbpaste = "xclip -selection clipboard -out"; pbpaste = "xclip -selection clipboard -out";
}; };
gtk = let
gtkExtraConfig = {
gtk-application-prefer-dark-theme = config.theme.dark;
};
in {
enable = true;
theme = gtkTheme;
gtk3.extraConfig = gtkExtraConfig;
gtk4.extraConfig = gtkExtraConfig;
};
}; };
}; };