From 464e39e3d96b513c0ae9d9b07bcc5ae47b48e622 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:46:40 -0500 Subject: start using the terminal more on jupiter => make some changes --- hosts/jupiter/config.nix | 4 ++ modules/desktop/home/default.nix | 6 +++ modules/desktop/options.nix | 1 + modules/desktop/system/default.nix | 1 + modules/desktop/system/programs/alacritty.nix | 76 +++++++++++++++++++++++++++ modules/desktop/system/programs/blackbox.nix | 2 + modules/terminal/options.nix | 1 + modules/terminal/system/programs/broot.nix | 31 +++++------ modules/terminal/system/programs/helix.nix | 2 +- modules/terminal/system/programs/tmux.nix | 38 ++++++++------ 10 files changed, 131 insertions(+), 31 deletions(-) create mode 100644 modules/desktop/system/programs/alacritty.nix diff --git a/hosts/jupiter/config.nix b/hosts/jupiter/config.nix index 27bda45..be07242 100644 --- a/hosts/jupiter/config.nix +++ b/hosts/jupiter/config.nix @@ -39,10 +39,14 @@ }; helix = { + theme = "adwaita"; enable = true; hardMode = false; }; + tmux.enable = true; + broot.enable = true; + git = { enable = true; userName = "Collin Williams"; diff --git a/modules/desktop/home/default.nix b/modules/desktop/home/default.nix index be5e97f..914b450 100644 --- a/modules/desktop/home/default.nix +++ b/modules/desktop/home/default.nix @@ -1,5 +1,11 @@ { + lib, + config, + ... +}: { imports = [ ./gtk ]; + + qt.style = lib.optionalAttrs (config.collinux.theme == "adwaita") {name = "adwaita-dark";}; } diff --git a/modules/desktop/options.nix b/modules/desktop/options.nix index 9bc4099..6b1e991 100644 --- a/modules/desktop/options.nix +++ b/modules/desktop/options.nix @@ -52,6 +52,7 @@ in { foot.enable = mkEnableOption "foot"; blackbox.enable = mkEnableOption "blackbox"; + alacritty.enable = mkEnableOption "alacritty"; }; }; }; diff --git a/modules/desktop/system/default.nix b/modules/desktop/system/default.nix index efc39bc..8827070 100644 --- a/modules/desktop/system/default.nix +++ b/modules/desktop/system/default.nix @@ -6,6 +6,7 @@ ./programs/firefox.nix ./programs/foot.nix ./programs/blackbox.nix + ./programs/alacritty.nix ./components/fuzzel.nix ./components/dunst.nix diff --git a/modules/desktop/system/programs/alacritty.nix b/modules/desktop/system/programs/alacritty.nix new file mode 100644 index 0000000..f73a901 --- /dev/null +++ b/modules/desktop/system/programs/alacritty.nix @@ -0,0 +1,76 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.collinux.desktop.programs.alacritty; +in + lib.mkIf cfg.enable { + hjem.users."${config.collinux.user.name}" = { + files.".config/alacritty/alacritty.toml" = { + value = { + general = { + import = ["keys.toml" "colors.toml"]; + live_config_reload = true; + }; + font = { + normal.family = "Iosevka Nerd Font"; + size = 12; + }; + }; + generator = (pkgs.formats.toml {}).generate "alacritty.toml"; + }; + + files.".config/alacritty/colors.toml".text = '' + [colors] + draw_bold_text_with_bright_colors = false + + # Default colors + [colors.primary] + background = '#242424' + foreground = '#C5C6C5' + + # Colors the cursor will use if `custom_cursor_colors` is true + [colors.cursor] + text = '#2D3234' + cursor = '#C5C6C5' + + # Normal colors + [colors.normal] + black = '#2D3234' + red = '#FFA500' + green = '#6FEE91' + yellow = '#91EE6F' + blue = '#916FB4' + magenta = '#EE6F91' + cyan = '#6F91B4' + white = '#C5C6C5' + + # Bright colors + [colors.bright] + black = '#566164' + red = '#FFFF60' + green = '#33393B' + yellow = '#4B5356' + blue = '#919494' + magenta = '#D3D4D5' + cyan = '#EE6F6F' + white = '#EEEEEC' + ''; + + files.".config/alacritty/keys.toml".text = '' + [[keyboard.bindings]] + chars = "\u001b[27;5;9~" + key = "Tab" + mods = "Control" + + [[keyboard.bindings]] + chars = "\u001b[27;5;13~" + key = "Enter" + mods = "Control" + ''; + + packages = [pkgs.alacritty]; + }; + } diff --git a/modules/desktop/system/programs/blackbox.nix b/modules/desktop/system/programs/blackbox.nix index 37567b5..9cff44a 100644 --- a/modules/desktop/system/programs/blackbox.nix +++ b/modules/desktop/system/programs/blackbox.nix @@ -20,6 +20,8 @@ in show-scrollbars = false; terminal-padding = lib.gvariant.mkTuple (builtins.map lib.gvariant.mkInt16 [10 10 10 10]); + font = "Iosevka Nerd Font 12"; + floating-controls = false; show-headerbar = true; }; diff --git a/modules/terminal/options.nix b/modules/terminal/options.nix index f7510d0..af7f0ee 100644 --- a/modules/terminal/options.nix +++ b/modules/terminal/options.nix @@ -64,6 +64,7 @@ in { fzf = mkProgramOption "fzf fuzzy finder"; bat = mkProgramOption "bat cat replacement"; eza = mkProgramOption "eza ls replacement"; + broot = mkProgramOption "broot"; }; }; }; diff --git a/modules/terminal/system/programs/broot.nix b/modules/terminal/system/programs/broot.nix index b2060d8..fdb480a 100644 --- a/modules/terminal/system/programs/broot.nix +++ b/modules/terminal/system/programs/broot.nix @@ -4,21 +4,22 @@ lib, ... }: let - cfg = config.collinux.terminal.shells.fish; - - conf = { - skin = catppuccin_skin; - verbs = [ - { - name = "open-code"; - key = "enter"; - execution = "$EDITOR +{line} {file}"; - working_dir = "{root}"; - apply_to = "file"; - leave_broot = true; - } - ]; - }; + cfg = config.collinux.terminal.programs.broot; + + conf = + { + verbs = [ + { + name = "open-code"; + key = "enter"; + execution = "$EDITOR +{line} {file}"; + working_dir = "{root}"; + apply_to = "file"; + leave_broot = true; + } + ]; + } + // (lib.optionalAttrs (cfg.theme == "catppuccin") {skin = catppuccin_skin;}); catppuccin_skin = { input = "rgb(205, 214, 244) none"; diff --git a/modules/terminal/system/programs/helix.nix b/modules/terminal/system/programs/helix.nix index 71dad76..49389ef 100644 --- a/modules/terminal/system/programs/helix.nix +++ b/modules/terminal/system/programs/helix.nix @@ -134,7 +134,7 @@ if cfg.theme == "catppuccin" then "catppuccin_mocha_transparent" else if cfg.theme == "adwaita" - then "adwaita_dark" + then "adwaita-dark" else ""; }; in diff --git a/modules/terminal/system/programs/tmux.nix b/modules/terminal/system/programs/tmux.nix index 322a912..3fb7b73 100644 --- a/modules/terminal/system/programs/tmux.nix +++ b/modules/terminal/system/programs/tmux.nix @@ -30,7 +30,7 @@ width=$(tmux display -p "#{pane_width}") height=$(tmux display -p "#{pane_height}") - if (( $(echo "$width / $height > 2.5" | bc -l) )); then + if (( $(echo "$width / $height > 2.5" | ${pkgs.bc}/bin/bc -l) )); then tmux split-window -h "$@" else tmux split-window -v "$@" @@ -104,7 +104,7 @@ done ''; - scripts.launchSessionizer = ''broot --only-folders --conf ~/.config/tmux/broot/sessionizer.toml''; + scripts.launchSessionizer = ''${pkgs.broot}/bin/broot --only-folders --conf ~/.config/tmux/broot/sessionizer.toml''; # -- FIND FILE -- broot_file_config = { @@ -132,7 +132,7 @@ ]; }; - scripts.launchFindFile = ''broot --conf ~/.config/tmux/broot/file.toml''; + scripts.launchFindFile = ''${pkgs.broot}/bin/broot --conf ~/.config/tmux/broot/file.toml''; # -- BAR -- scripts.battery = '' @@ -161,20 +161,27 @@ tmux set -g window-status-separator "" tmux set -g status-right "#[fg=color243]%l:%M #[fg=red]#(${scriptsDir}/battery.sh) " + ''; - bg_dark="#181825" + scripts.catpuccinNoBorders = + if (cfg.theme == "catppuccin") + then '' + bg_dark="#181825" - ## pane borders - tmux set -g pane-border-style fg=$bg_dark,bg=$bg_dark - tmux set -g pane-active-border-style fg=$bg_dark,bg=$bg_dark + ## pane borders + tmux set -g pane-border-style fg=$bg_dark,bg=$bg_dark + tmux set -g pane-active-border-style fg=$bg_dark,bg=$bg_dark - ## pane backgrounds - # Set the foreground/background color for the active window - tmux set -g window-active-style bg=$bg + ## pane backgrounds + # Set the foreground/background color for the active window + tmux set -g window-active-style bg=bg - # Set the foreground/background color for all other windows - tmux set -g window-style bg=$bg_dark - ''; + # Set the foreground/background color for all other windows + tmux set -g window-style bg=$bg_dark + '' + else '' + tmux set -g status-bg "#262626" + ''; # -- FZF EXEC -- scripts.tmuxDoc = '' @@ -194,7 +201,7 @@ tmux list-commands -F $'#{command_list_name}#{?command_list_alias,\n#{command_list_alias},}' } - selected_cmd=$(all_cmds | fzf --bind 'enter:accept-or-print-query,tab:replace-query,alt-backspace:clear-query' --prompt : --preview "~/.config/tmux/scripts/tmux-doc.sh $(printf '{}' | cut -d' ' -f1)") + selected_cmd=$(all_cmds | ${pkgs.fzf}/bin/fzf --bind 'enter:accept-or-print-query,tab:replace-query,alt-backspace:clear-query' --prompt : --preview "~/.config/tmux/scripts/tmux-doc.sh $(printf '{}' | cut -d' ' -f1)") test -z "$selected_cmd" && exit tmux $(echo "$selected_cmd" | sed "s@~@$HOME@g") @@ -242,7 +249,6 @@ tmux-conf = '' set -g mouse on - set -g default-terminal "tmux" # Panes bind-key -n C-w kill-pane @@ -272,6 +278,7 @@ # Statusbar run-shell "${scriptsDir}/bar.sh" + run-shell "${scriptsDir}/catppuccin-borders.sh" # Scrollback set-window-option -g mode-keys vi @@ -324,6 +331,7 @@ in # Bar ".config/tmux/scripts/battery.sh" = e scripts.battery; ".config/tmux/scripts/bar.sh" = e scripts.bar; + ".config/tmux/scripts/catppuccin-borders.sh" = e scripts.catpuccinNoBorders; ".config/tmux/tmux.conf".text = tmux-conf; }; -- cgit v1.3.1