diff --git a/modules/base/default.nix b/modules/base/default.nix index fdc43802..3497c842 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -60,24 +60,6 @@ boot.kernelParams = [ "mitigations=off" ]; console = { - colors = [ - "eff1f5" - "d20f39" - "40a02b" - "df8e1d" - "1e66f5" - "ea76cb" - "179299" - "6c6f85" - "acb0be" - "d20f39" - "40a02b" - "df8e1d" - "1e66f5" - "ea76cb" - "179299" - "4c4f69" - ]; font = "Lat2-Terminus16"; keyMap = "us"; }; diff --git a/modules/base/zsh/default.nix b/modules/base/zsh/default.nix index 69f152ba..994c79ca 100644 --- a/modules/base/zsh/default.nix +++ b/modules/base/zsh/default.nix @@ -36,6 +36,67 @@ let shift 1 nix shell nixpkgs#$drv -c $@ } + + lightmode() { + printf "\033]10;rgb:4c/4f/69\007" + printf "\033]11;rgb:ef/f1/f5\007" + printf "\033]17;rgb:cc/d0/da\007" + printf "\033]19;rgb:4c/4f/69\007" + printf "\033]4;0;rgb:5c/5f/77\007" + printf "\033]4;1;rgb:d2/0f/39\007" + printf "\033]4;2;rgb:40/a0/2b\007" + printf "\033]4;3;rgb:df/8e/1d\007" + printf "\033]4;4;rgb:1e/66/f5\007" + printf "\033]4;5;rgb:ea/76/cb\007" + printf "\033]4;6;rgb:17/92/99\007" + printf "\033]4;7;rgb:ac/b0/be\007" + printf "\033]4;8;rgb:6c/6f/85\007" + printf "\033]4;9;rgb:d2/0f/39\007" + printf "\033]4;10;rgb:40/a0/2b\007" + printf "\033]4;11;rgb:df/8e/1d\007" + printf "\033]4;12;rgb:1e/66/f5\007" + printf "\033]4;13;rgb:ea/76/cb\007" + printf "\033]4;14;rgb:17/92/99\007" + printf "\033]4;15;rgb:bc/c0/cc\007" + } + + darkmode() { + printf "\033]10;rgb:c6/d0/f5\007" + printf "\033]11;rgb:30/34/46\007" + printf "\033]17;rgb:41/45/59\007" + printf "\033]19;rgb:c6/d0/f5\007" + printf "\033]4;0;rgb:51/57/6d\007" + printf "\033]4;1;rgb:e7/82/84\007" + printf "\033]4;2;rgb:a6/d1/89\007" + printf "\033]4;3;rgb:e5/c8/90\007" + printf "\033]4;4;rgb:8c/aa/ee\007" + printf "\033]4;5;rgb:f4/b8/e4\007" + printf "\033]4;6;rgb:81/c8/be\007" + printf "\033]4;7;rgb:b5/bf/e2\007" + printf "\033]4;8;rgb:62/68/80\007" + printf "\033]4;9;rgb:e7/82/84\007" + printf "\033]4;10;rgb:a6/d1/89\007" + printf "\033]4;11;rgb:e5/c8/90\007" + printf "\033]4;12;rgb:8c/aa/ee\007" + printf "\033]4;13;rgb:f4/b8/e4\007" + printf "\033]4;14;rgb:81/c8/be\007" + printf "\033]4;15;rgb:a5/ad/ce\007" + } + + TRAPUSR1() { + lightmode + } + + TRAPUSR2() { + darkmode + } + + if [ "$(darkman get)" = "dark" ] + then + darkmode + else + lightmode + fi ''; sessionVariables = { DEFAULT_USER = "charlotte"; }; oh-my-zsh = { diff --git a/modules/graphical/compositor/default.nix b/modules/graphical/compositor/default.nix index 4957b8ff..a7235ab3 100644 --- a/modules/graphical/compositor/default.nix +++ b/modules/graphical/compositor/default.nix @@ -13,6 +13,14 @@ let echo "{ \"text\": \"📭\" }" fi ''; + lock = pkgs.writeShellScript "lock" '' + if [ "$(darkman get)" == "light" ] + then + ${pkgs.swaylock}/bin/swaylock -fF -c eff1f5 + else + ${pkgs.swaylock}/bin/swaylock -fF -c 303446 + fi + ''; baseWrapper = pkgs.writeShellScriptBin "river" '' export XDG_SESSION_TYPE=wayland export XDG_CURRENT_DESKTOP=river @@ -46,9 +54,9 @@ let }; river-init = pkgs.writeShellScript "river-init" '' riverctl map normal Super Return spawn footclient - riverctl map normal Super D spawn 'footclient --app-id launcher -- ${launcher}/bin/launcher' + riverctl map normal Super D spawn 'footclient --app-id launcher -- zsh -ic ${launcher}/bin/launcher' - riverctl map normal Super C spawn ${pkgs.swaylock}/bin/swaylock + riverctl map normal Super C spawn ${lock} riverctl map normal Super+Shift C close @@ -132,10 +140,10 @@ let rivertile -view-padding 0 -outer-padding 0 & riverctl attach-mode bottom - riverctl background-color 0x000000 - riverctl border-color-focused 0x6aaeff - riverctl border-color-unfocused 0xf2eff3 - riverctl border-color-urgent 0xff8892 + riverctl background-color 0xeff1f5 + riverctl border-color-focused 0x04e5e5 + riverctl border-color-unfocused 0xdce0e8 + riverctl border-color-urgent 0xea76cb riverctl border-width 1 riverctl focus-follows-cursor normal riverctl hide-cursor when-typing enabled @@ -280,36 +288,7 @@ in }; }; style = '' - @define-color base #eff1f5; - @define-color mantle #e6e9ef; - @define-color crust #dce0e8; - - @define-color text #4c4f69; - @define-color subtext0 #6c6f85; - @define-color subtext1 #5c5f77; - - @define-color surface0 #ccd0da; - @define-color surface1 #bcc0cc; - @define-color surface2 #acb0be; - - @define-color overlay0 #9ca0b0; - @define-color overlay1 #8c8fa1; - @define-color overlay2 #7c7f93; - - @define-color blue #1e66f5; - @define-color lavender #7287fd; - @define-color sapphire #209fb5; - @define-color sky #04a5e5; - @define-color teal #179299; - @define-color green #40a02b; - @define-color yellow #df8e1d; - @define-color peach #fe640b; - @define-color maroon #e64553; - @define-color red #d20f39; - @define-color mauve #8839ef; - @define-color pink #ea76cb; - @define-color flamingo #dd7878; - @define-color rosewater #dc8a78; + @import "colors.css"; * { font-family: Hack, monospace; @@ -317,7 +296,9 @@ in } #window, #idle_inhibitor, #network, #battery, #backlight, #mpris, #pulseaudio, #custom-mail-status, #clock, #tray { + margin: 0; padding: 0 5px; + background-color: @surface0; } button { @@ -335,52 +316,47 @@ in } #backlight { - background-color: @sky; + color: @sky; } #battery { - background-color: @green; + color: @green; } #battery.good { - background-color: @sky; + color: @sky; } #battery.warning { - background-color: @yellow; + color: @yellow; } #battery.critical { - background-color: @pink; - } - - #clock { - padding-right: 0px; + color: @pink; } #custom-mail-status.has-mail { - background-color: @sky; + color: @sky; } #idle_inhibitor.activated { - background-color: @sky; + color: @sky; } #pulseaudio { - background-color: @yellow; + color: @yellow; } #tags button { padding: 0; box-shadow: inset 0 -3px transparent - background-color: @base; color: @text; } #tags button.occupied { - background-color: @crust; + background-color: @surface1; } #tags button.focused { - background-color: @sky; + color: @sky; } #tags button.urgent { - background-color: @pink; + color: @pink; } #tags button:hover { box-shadow: inset 0 -3px @text; @@ -430,10 +406,10 @@ in swayidle = { enable = true; systemdTarget = "river-session.target"; - events = [{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }]; + events = [{ event = "before-sleep"; command = "${lock}"; }]; timeouts = [ { timeout = 150; command = "${pkgs.wlopm}/bin/wlopm --off '*'"; resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'"; } - { timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -fF"; } + { timeout = 300; command = "${lock}"; } ]; }; }; @@ -450,19 +426,85 @@ in After = [ "graphical-session.target" ]; }; }; - xdg.configFile."river/init" = { - source = river-init; - onChange = '' - if [ -d /run/user/$UID ] - then - WAYLAND_DISPLAY="$(${pkgs.findutils}/bin/find /run/user/$UID -mindepth 1 -maxdepth 1 -type s -name wayland-\*)" - if [ -S "WAYLAND_DISPLAY" ] + xdg.configFile = { + "river/init" = { + source = river-init; + onChange = '' + if [ -d /run/user/$UID ] then - ${river-init} + WAYLAND_DISPLAY="$(${pkgs.findutils}/bin/find /run/user/$UID -mindepth 1 -maxdepth 1 -type s -name wayland-\*)" + if [ -S "WAYLAND_DISPLAY" ] + then + ${river-init} + fi fi - fi + ''; + }; + "waybar/frappe.css".text = '' + @define-color base #303446; + @define-color mantle #292c3c; + @define-color crust #232634; + + @define-color text #c6d0f5; + @define-color subtext0 #a5adce; + @define-color subtext1 #b5bfe2; + + @define-color surface0 #414559; + @define-color surface1 #51576d; + @define-color surface2 #626880; + + @define-color overlay0 #737994; + @define-color overlay1 #838ba7; + @define-color overlay2 #949cbb; + + @define-color blue #8caaee; + @define-color lavender #babbf1; + @define-color sapphire #85c1dc; + @define-color sky #99d1db; + @define-color teal #81c8be; + @define-color green #a6d189; + @define-color yellow #e5c890; + @define-color peach #ef9f76; + @define-color maroon #ea999c; + @define-color red #e78284; + @define-color mauve #ca9ee6; + @define-color pink #f4b8e4; + @define-color flamingo #eebebe; + @define-color rosewater #f2d5cf; + ''; + "waybar/latte.css".text = '' + @define-color base #eff1f5; + @define-color mantle #e6e9ef; + @define-color crust #dce0e8; + + @define-color text #4c4f69; + @define-color subtext0 #6c6f85; + @define-color subtext1 #5c5f77; + + @define-color surface0 #ccd0da; + @define-color surface1 #bcc0cc; + @define-color surface2 #acb0be; + + @define-color overlay0 #9ca0b0; + @define-color overlay1 #8c8fa1; + @define-color overlay2 #7c7f93; + + @define-color blue #1e66f5; + @define-color lavender #7287fd; + @define-color sapphire #209fb5; + @define-color sky #04a5e5; + @define-color teal #179299; + @define-color green #40a02b; + @define-color yellow #df8e1d; + @define-color peach #fe640b; + @define-color maroon #e64553; + @define-color red #d20f39; + @define-color mauve #8839ef; + @define-color pink #ea76cb; + @define-color flamingo #dd7878; + @define-color rosewater #dc8a78; ''; }; }; }; -} +} diff --git a/modules/graphical/firefox/default.nix b/modules/graphical/firefox/default.nix index 55d5b102..3aa98b71 100644 --- a/modules/graphical/firefox/default.nix +++ b/modules/graphical/firefox/default.nix @@ -72,6 +72,7 @@ in extensions = with pkgs.nur.repos.rycee.firefox-addons; [ belgium-eid cookie-autodelete + darkreader decentraleyes ff2mpv keepassxc-browser diff --git a/modules/graphical/terminal/default.nix b/modules/graphical/terminal/default.nix index c7970b8f..ef8a487d 100644 --- a/modules/graphical/terminal/default.nix +++ b/modules/graphical/terminal/default.nix @@ -22,10 +22,7 @@ notify = true; }; scrollback.lines = 10000; - cursor = { - blink = true; - color = "ffffff 777777"; - }; + cursor.blink = true; mouse.hide-when-typing = true; colors = { foreground = "4c4f69"; diff --git a/modules/graphical/theme/default.nix b/modules/graphical/theme/default.nix index 1c636a64..7d916157 100644 --- a/modules/graphical/theme/default.nix +++ b/modules/graphical/theme/default.nix @@ -34,7 +34,7 @@ }; programs.dconf.enable = true; - home-manager.users.charlotte = { pkgs, ... }: { + home-manager.users.charlotte = { pkgs, lib, ... }: { home.packages = [ pkgs.catppuccin-cursors.latteLight # Also install dark mode to profile for darkman @@ -100,10 +100,23 @@ gtk = '' ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Frappe-Compact-Blue-Dark ''; + river = '' + riverctl background-color 0x303446 + riverctl border-color-focused 0x99d1db + riverctl border-color-unfocused 0x232634 + riverctl border-color-urgent 0xf4b8e4 + ''; qt = '' sed -i "s/Latte/Frappe/" ~/.config/qt5ct/qt5ct.conf sed -i "s/Latte/Frappe/" ~/.config/qt6ct/qt6ct.conf ''; + terminal = '' + pkill -SIGUSR2 zsh + ''; + waybar = '' + ln -sf ~/.config/waybar/frappe.css ~/.config/waybar/colors.css + systemctl --user restart waybar.service + ''; }; lightModeScripts = { emacs = '' @@ -113,12 +126,30 @@ gtk = '' ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Latte-Compact-Blue-Light ''; + river = '' + riverctl background-color 0xeff1f5 + riverctl border-color-focused 0x04e5e5 + riverctl border-color-unfocused 0xdce0e8 + riverctl border-color-urgent 0xea76cb + ''; qt = '' sed -i "s/Frappe/Latte/" ~/.config/qt5ct/qt5ct.conf sed -i "s/Frappe/Latte/" ~/.config/qt6ct/qt6ct.conf ''; + terminal = '' + pkill -SIGUSR1 zsh + ''; + waybar = '' + ln -sf ~/.config/waybar/latte.css ~/.config/waybar/colors.css + systemctl --user restart waybar.service + ''; }; }; + home.activation = { + linkWaybarCssColors = lib.hm.dag.entryAfter ["writeBoundary"] '' + $DRY_RUN_CMD ln -sf $VERBOSE_ARG ~/.config/waybar/latte.css ~/.config/waybar/colors.css + ''; + }; }; }; }