From 824a42ad72d90420713e6e87d75fedcb1366295e Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 22 Dec 2025 14:48:12 -0500 Subject: Add ef-dream theme and integrate with vim/polybar configs Amp-Thread-ID: https://ampcode.com/threads/T-019b479a-0995-731e-8d63-ed185a1ab54a Co-authored-by: Amp --- lib/common.nix | 52 +++++------ lib/ef-dream.vim | 116 ++++++++++++++++++++++++ lib/linux.nix | 50 ++++++++++- lib/polybar.nix | 235 ++++++++++++++++++++++++++----------------------- lib/vimrc | 5 +- profiles/beryllium.nix | 11 ++- profiles/laptop.nix | 9 +- 7 files changed, 320 insertions(+), 158 deletions(-) create mode 100644 lib/ef-dream.vim diff --git a/lib/common.nix b/lib/common.nix index d0d51fc..5675a23 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -312,20 +312,28 @@ in { # select buffer to paste from bind Space choose-buffer # status line text - set -g status-left-length 30 - set -g status-left '#S | #(whoami)@#(hostname) | ' - set -g status-right '~%Y.%m.%d..%H.%M' + set -g status-left-length 50 + set -g status-left ' #[fg=#f3c09a,bold]#S #[fg=#8f8886]│ #[fg=#efd5c5]#(whoami)@#h #[fg=#8f8886]│ ' + set -g status-right '#[fg=#6fb3c0]%a %Y.%m.%d #[fg=#8f8886]│ #[fg=#f3c09a]%H:%M ' set -g renumber-windows on + # ef-dream colors set -g status-style bg='#232025',fg='#efd5c5' - # highlight current window with magenta-cooler - set -g window-status-current-style fg='#232025',bg='#d0b0ff' - set -g window-status-format '#I) #W ' - set -g window-status-current-format '#I) #W ' + set -g message-style bg='#3b393e',fg='#ffaacf' + set -g message-command-style bg='#3b393e',fg='#57b0ff' + + # window tabs + set -g window-status-format '#[fg=#8f8886] #I:#W ' + set -g window-status-current-format '#[fg=#232025,bg=#f3c09a,bold] #I:#W ' + set -g window-status-separator '#[fg=#3b393e]│' + # pane borders set -g pane-border-style fg='#3b393e' set -g pane-active-border-style fg='#d0b0ff' - # + + # copy mode + set -g mode-style bg='#3b393e',fg='#ffaacf' + set-option -g allow-passthrough on ''; }; @@ -342,38 +350,18 @@ in { #viAlias = true; #vimdiffAlias = true; plugins = with pkgs.vimPlugins; [ - base16-vim - catppuccin-vim editorconfig-vim vim-sensible vim-fugitive vim-sexp-mappings-for-regular-people - # vim-ripgrep # not in nixpkgs :( rainbow_parentheses - vim-plug # just in case + vim-plug vim-addon-local-vimrc fzf-vim (pkgs.vimUtils.buildVimPlugin { - pname = "photon.vim"; - version = "2022.03.14"; - src = pkgs.fetchFromGitHub { - owner = "axvr"; - repo = "photon.vim"; - rev = "32b42c8a12bf9588259b76f3df6807960e0d7386"; - sha256 = "sha256-kM7WP03uE20yr0nCusB3ncHzgtEYxqNzoNoQGen9p+o="; - }; - meta.homepage = "https://github.com/axvr/photon.vim"; - }) - (pkgs.vimUtils.buildVimPlugin { - pname = "skull-vim"; - version = "2022.03.14"; - src = pkgs.fetchFromGitHub { - owner = "kadekillary"; - repo = "skull-vim"; - rev = "abb9d7120c63aad6f9acc26d31c948a93f352e94"; - sha256 = "sha256-tu5aDRjHZtXKoyQBbMEhzjGrRl4GZD121ybs7oNylvs="; - }; - meta.homepage = "https://github.com/kadekillary/skull-vim"; + pname = "ef-dream-vim"; + version = "2024.12.22"; + src = pkgs.writeTextDir "colors/ef-dream.vim" (builtins.readFile ./ef-dream.vim); }) ]; extraConfig = builtins.readFile ./vimrc; diff --git a/lib/ef-dream.vim b/lib/ef-dream.vim new file mode 100644 index 0000000..f12d529 --- /dev/null +++ b/lib/ef-dream.vim @@ -0,0 +1,116 @@ +" ef-dream.vim - Vim colorscheme based on ef-dream Emacs theme +" Author: Generated for Ben's config +" License: GPL-3.0 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "ef-dream" + +" ef-dream palette +let s:bg_main = "#232025" +let s:bg_dim = "#322f34" +let s:bg_alt = "#3b393e" +let s:fg_main = "#efd5c5" +let s:fg_dim = "#8f8886" +let s:fg_alt = "#b0a0cf" +let s:cursor = "#f3c09a" +let s:red = "#ff6f6f" +let s:red_warmer = "#ff7a5f" +let s:green = "#51b04f" +let s:green_warmer = "#7fce5f" +let s:yellow = "#c0b24f" +let s:yellow_warmer = "#d09950" +let s:blue = "#57b0ff" +let s:blue_warmer = "#80aadf" +let s:magenta = "#ffaacf" +let s:magenta_cooler = "#d0b0ff" +let s:cyan = "#6fb3c0" +let s:cyan_warmer = "#8fcfd0" + +" UI elements +exe "hi Normal guifg=".s:fg_main." guibg=".s:bg_main +exe "hi Cursor guifg=".s:bg_main." guibg=".s:cursor +exe "hi CursorLine guibg=".s:bg_dim." cterm=NONE" +exe "hi CursorColumn guibg=".s:bg_dim +exe "hi LineNr guifg=".s:fg_dim." guibg=".s:bg_main +exe "hi CursorLineNr guifg=".s:cursor." guibg=".s:bg_dim +exe "hi VertSplit guifg=".s:bg_alt." guibg=".s:bg_main +exe "hi StatusLine guifg=".s:fg_main." guibg=".s:bg_alt +exe "hi StatusLineNC guifg=".s:fg_dim." guibg=".s:bg_dim +exe "hi Pmenu guifg=".s:fg_main." guibg=".s:bg_dim +exe "hi PmenuSel guifg=".s:bg_main." guibg=".s:cursor +exe "hi PmenuSbar guibg=".s:bg_alt +exe "hi PmenuThumb guibg=".s:fg_dim +exe "hi TabLine guifg=".s:fg_dim." guibg=".s:bg_dim +exe "hi TabLineFill guibg=".s:bg_main +exe "hi TabLineSel guifg=".s:bg_main." guibg=".s:cursor +exe "hi Visual guibg=".s:bg_alt +exe "hi Search guifg=".s:bg_main." guibg=".s:yellow +exe "hi IncSearch guifg=".s:bg_main." guibg=".s:cursor +exe "hi MatchParen guifg=".s:magenta." guibg=".s:bg_alt." gui=bold" +exe "hi NonText guifg=".s:bg_alt +exe "hi SpecialKey guifg=".s:bg_alt +exe "hi Folded guifg=".s:fg_dim." guibg=".s:bg_dim +exe "hi FoldColumn guifg=".s:fg_dim." guibg=".s:bg_main +exe "hi SignColumn guibg=".s:bg_main +exe "hi ColorColumn guibg=".s:bg_dim +exe "hi ErrorMsg guifg=".s:red." guibg=".s:bg_main +exe "hi WarningMsg guifg=".s:yellow +exe "hi ModeMsg guifg=".s:green +exe "hi MoreMsg guifg=".s:cyan +exe "hi Question guifg=".s:cyan +exe "hi Directory guifg=".s:blue +exe "hi Title guifg=".s:magenta." gui=bold" +exe "hi WildMenu guifg=".s:bg_main." guibg=".s:cursor + +" Diff +exe "hi DiffAdd guifg=".s:green." guibg=".s:bg_dim +exe "hi DiffChange guifg=".s:yellow." guibg=".s:bg_dim +exe "hi DiffDelete guifg=".s:red." guibg=".s:bg_dim +exe "hi DiffText guifg=".s:yellow_warmer." guibg=".s:bg_alt." gui=bold" + +" Syntax +exe "hi Comment guifg=".s:fg_dim." gui=italic" +exe "hi Constant guifg=".s:cyan +exe "hi String guifg=".s:green +exe "hi Character guifg=".s:green_warmer +exe "hi Number guifg=".s:cyan_warmer +exe "hi Boolean guifg=".s:cyan +exe "hi Float guifg=".s:cyan_warmer +exe "hi Identifier guifg=".s:fg_main +exe "hi Function guifg=".s:magenta +exe "hi Statement guifg=".s:magenta_cooler +exe "hi Conditional guifg=".s:magenta_cooler +exe "hi Repeat guifg=".s:magenta_cooler +exe "hi Label guifg=".s:magenta_cooler +exe "hi Operator guifg=".s:fg_main +exe "hi Keyword guifg=".s:magenta_cooler +exe "hi Exception guifg=".s:red +exe "hi PreProc guifg=".s:yellow +exe "hi Include guifg=".s:yellow_warmer +exe "hi Define guifg=".s:yellow +exe "hi Macro guifg=".s:yellow_warmer +exe "hi PreCondit guifg=".s:yellow +exe "hi Type guifg=".s:blue +exe "hi StorageClass guifg=".s:blue_warmer +exe "hi Structure guifg=".s:blue +exe "hi Typedef guifg=".s:blue_warmer +exe "hi Special guifg=".s:fg_alt +exe "hi SpecialChar guifg=".s:cursor +exe "hi Tag guifg=".s:magenta +exe "hi Delimiter guifg=".s:fg_main +exe "hi SpecialComment guifg=".s:fg_dim." gui=bold" +exe "hi Debug guifg=".s:red_warmer +exe "hi Underlined guifg=".s:blue." gui=underline" +exe "hi Ignore guifg=".s:bg_alt +exe "hi Error guifg=".s:red." guibg=".s:bg_main." gui=bold" +exe "hi Todo guifg=".s:cursor." guibg=".s:bg_main." gui=bold" + +" Git signs (if using gitgutter or similar) +exe "hi GitGutterAdd guifg=".s:green +exe "hi GitGutterChange guifg=".s:yellow +exe "hi GitGutterDelete guifg=".s:red +exe "hi GitGutterChangeDelete guifg=".s:yellow_warmer diff --git a/lib/linux.nix b/lib/linux.nix index fb9eddf..376ac28 100644 --- a/lib/linux.nix +++ b/lib/linux.nix @@ -223,6 +223,7 @@ in }; settings = { background_opacity = "0.95"; + window_padding_width = 8; symbol_map = "U+1F600-U+1F64F,U+1F300-U+1F5FF,U+1F680-U+1F6FF,U+1F1E0-U+1F1FF,U+2600-U+26FF,U+2700-U+27BF,U+1F900-U+1F9FF,U+1FA00-U+1FA6F,U+1FA70-U+1FAFF,U+231A-U+231B,U+23E9-U+23F3,U+23F8-U+23FA,U+25AA-U+25AB,U+25B6,U+25C0,U+25FB-U+25FE,U+2614-U+2615,U+2648-U+2653,U+267F,U+2693,U+26A1,U+26AA-U+26AB,U+26BD-U+26BE,U+26C4-U+26C5,U+26CE,U+26D4,U+26EA,U+26F2-U+26F3,U+26F5,U+26FA,U+26FD,U+2702,U+2705,U+2708-U+270D,U+270F Noto Color Emoji"; # ef-dream inspired colors @@ -286,8 +287,53 @@ in rofi = { enable = true; pass.enable = true; - font = "Fira Mono 16"; - theme = "purple"; + font = "Fira Code 14"; + theme = let + inherit (config.lib.formats.rasi) mkLiteral; + in { + "*" = { + background-color = mkLiteral "#232025"; + text-color = mkLiteral "#efd5c5"; + border-color = mkLiteral "#d0b0ff"; + }; + "window" = { + border = mkLiteral "2px"; + padding = mkLiteral "20px"; + }; + "inputbar" = { + children = mkLiteral "[prompt, textbox-prompt-colon, entry]"; + padding = mkLiteral "8px"; + }; + "prompt" = { + text-color = mkLiteral "#d0b0ff"; + }; + "textbox-prompt-colon" = { + expand = false; + str = ":"; + margin = mkLiteral "0 0.3em 0 0"; + text-color = mkLiteral "#8f8886"; + }; + "entry" = { + placeholder = "search..."; + placeholder-color = mkLiteral "#8f8886"; + }; + "listview" = { + lines = 8; + scrollbar = false; + padding = mkLiteral "8px 0 0 0"; + }; + "element" = { + padding = mkLiteral "8px"; + }; + "element selected" = { + background-color = mkLiteral "#3b393e"; + text-color = mkLiteral "#f3c09a"; + }; + "element-text" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + }; + }; plugins = with pkgs; [ rofi-calc rofi-emoji diff --git a/lib/polybar.nix b/lib/polybar.nix index dc384f6..d3d5c3d 100644 --- a/lib/polybar.nix +++ b/lib/polybar.nix @@ -5,71 +5,105 @@ let inherit (import ./theme.nix { inherit pkgs lib; }) colors theme; - size-int = fontSize*2; + size-int = fontSize + 3; size = toString size-int; + bar-height = size-int + 16; bar-common = { background = colors."${theme}".background; foreground = colors."${theme}".foreground; - font-0 = "FiraSans:size=${size};0"; - font-1 = "Font Awesome 5:pixelsize=${size};0"; - font-2 = "MaterialIcons:size=${size}:antialias=false;0"; + font-0 = "Fira Code:size=${size};2"; + font-1 = "Font Awesome 5 Free:style=Solid:pixelsize=${size};2"; + font-2 = "Noto Color Emoji:scale=10;2"; - line-size = "${size}pt"; - border-size = "5pt"; + line-size = "2pt"; + border-size = "0pt"; - height = "${toString (size-int+14)}pt"; + height = "${toString bar-height}pt"; width = "100%"; - radius = 6; - padding-left = 0; + radius = 0; + padding-left = 1; padding-right = 1; module-margin = 1; enable-ipc = true; - - # these are deprecated, i need to rework this - tray-background = colors."${theme}".background; - tray-detached = false; - tray-maxsize = size-int; - tray-padding = 5; - tray-scale = 1; }; in { services.polybar = { config = { - "bar/perf" = bar-common // { - modules-center = "date"; - modules-left = [ "eth" ]; - modules-right = [ "mem" "temp" ]; - radius = 0; - separator = "|"; + # Top bar: user-level work stuff (workspaces, date, tray) + "bar/top" = bar-common // { + modules-left = [ "ewmh" ]; + modules-center = [ "date" ]; + modules-right = [ "pulseaudio" "battery" ]; tray-position = "right"; + tray-background = colors."${theme}".background; + tray-padding = 4; + separator = " "; + separator-foreground = colors.${theme}.highlight; }; - "bar/cpu" = bar-common // { - modules-center = ["cpu"]; + # Bottom bar: memory, temp, network (stacked above CPU bar) + "bar/bottom" = bar-common // { + bottom = true; + offset-y = "${toString bar-height}pt"; + modules-left = [ "mem" ]; + modules-center = [ "temp" ]; + modules-right = [ "network-speed" ]; + separator = " │ "; + separator-foreground = colors.${theme}.highlight; }; - "bar/org" = bar-common // { - modules-right = [ "date" ]; - modules-left = ["ewmh" ]; - radius = 0; - separator = "|"; + # CPU bar: very bottom, just CPU cores + "bar/cpu" = bar-common // { + bottom = true; + modules-center = [ "cpu" ]; }; "module/ewmh" = { type = "internal/xworkspaces"; - label-active-foreground = "#fff"; + pin-workspaces = false; + enable-click = true; + enable-scroll = true; + label-active = "%name%"; + label-active-foreground = colors.${theme}.background; + label-active-background = colors.${theme}.cursor; + label-active-padding = 1; + label-occupied = "%name%"; + label-occupied-foreground = colors.${theme}.foreground; + label-occupied-padding = 1; + label-urgent = "%name%"; + label-urgent-foreground = colors.${theme}.background; + label-urgent-background = colors.${theme}.red; + label-urgent-padding = 1; + label-empty = "%name%"; + label-empty-foreground = colors.${theme}.cyan; + label-empty-padding = 1; }; "module/date" = { type = "internal/date"; - internal = 5; - date = "%Y.%m.%d"; - time = "%H.%M"; - label = "%date%..%time%"; + interval = 5; + date = "%a %Y.%m.%d"; + time = "%H:%M"; + label = "%date% %time%"; + label-foreground = colors.${theme}.foreground; + }; + + "module/pulseaudio" = { + type = "internal/pulseaudio"; + use-ui-max = false; + interval = 5; + format-volume = " "; + label-volume = "%percentage%%"; + label-muted = "🔇 muted"; + label-muted-foreground = colors.${theme}.cyan; + ramp-volume-0 = "🔈"; + ramp-volume-1 = "🔉"; + ramp-volume-2 = "🔊"; + click-right = "pwvucontrol &"; }; "module/battery" = { @@ -77,73 +111,55 @@ in { battery = "BAT0"; adapter = "AC"; full-at = 99; - }; - - "module/volume-bar" = { - type = "internal/alsa"; - master-soundcard = "hw:1"; - bar-volume-font = 2; - bar-volume-width = 9; - format-volume = ""; - label-volume = " .) "; - label-muted = " .) mute"; - label-volume-foreground = colors.${theme}.foreground; - format-muted-foreground = colors.${theme}.foreground; - bar-volume-foreground-0 = colors.${theme}.foreground; - bar-volume-foreground-1 = colors.${theme}.foreground; - bar-volume-foreground-2 = colors.${theme}.foreground; - bar-volume-foreground-3 = colors.${theme}.foreground; - bar-volume-foreground-4 = colors.${theme}.foreground; - bar-volume-foreground-5 = colors.${theme}.foreground; - bar-volume-foreground-6 = colors.${theme}.foreground; - bar-volume-gradient = true; - bar-volume-indicator = "•"; - bar-volume-fill = "•"; - bar-volume-empty = "·"; - bar-volume-empty-foreground = colors.${theme}.foreground; - }; - - "network-base" = { - type = "internal/network"; - interval = 5; - format-connected = ""; - format-disconnected = ""; - label-disconnected = "%{F#F0C674}%ifname%%{F#707880} disconnected"; - }; - - "module/eth" = { - "inherit" = "network-base"; - interface-type = "wired"; - label-connected = "%{F#F0C674}%ifname%%{F-} %local_ip%"; - #label-connected = "eth up: %upspeed:9% down: %downspeed%"; - #label-disconnected = "no eth"; - }; - - "module/wifi" = { - type = "internal/network"; - interface = "wlan1"; - label-connected = "wifi up: %upspeed% down: %downspeed%"; - label-disconnected = "no wifi"; + format-charging = "⚡ "; + format-discharging = "🔋 "; + format-full = "✓ "; + label-charging = "%percentage%%"; + label-discharging = "%percentage%%"; + label-full = "%percentage%%"; }; "module/cpu" = { type = "internal/cpu"; - interval = 3; + interval = 2; format-padding = 1; format = "