From b966751224603b688b8d51d96ef0275b36bea11b Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Fri, 9 Feb 2024 00:34:17 -0600 Subject: [PATCH] Add wezterm as supported terminal and do basic theming --- config/home/default.nix | 1 + config/home/hyprland.nix | 8 +++- config/home/packages.nix | 2 +- config/home/wezterm.nix | 95 ++++++++++++++++++++++++++++++++++++++++ options.nix | 1 + 5 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 config/home/wezterm.nix diff --git a/config/home/default.nix b/config/home/default.nix index 5218c82..8b3a1b3 100644 --- a/config/home/default.nix +++ b/config/home/default.nix @@ -17,6 +17,7 @@ ./swappy.nix ./swaylock.nix ./swaync.nix + ./wezterm.nix ./zsh.nix # Place Home Files Like Pictures diff --git a/config/home/hyprland.nix b/config/home/hyprland.nix index 3425b0c..f80a209 100644 --- a/config/home/hyprland.nix +++ b/config/home/hyprland.nix @@ -6,7 +6,7 @@ let inherit (import ../../options.nix) browser cpuType gpuType wallpaperDir borderAnim - theKBDLayout + theKBDLayout wezterm theSecondKBDLayout; in with lib; { wayland.windowManager.hyprland = { @@ -125,7 +125,11 @@ in with lib; { master { new_is_master = true } - bind = ${modifier},Return,exec,kitty + ${if wezterm == true then '' + bind = ${modifier},Return,exec,wezterm + '' else '' + bind = ${modifier},Return,exec,kitty + ''} bind = ${modifier}SHIFT,Return,exec,rofi-launcher bind = ${modifier}SHIFT,W,exec,web-search bind = ${modifier}SHIFT,S,exec,swaync-client -rs diff --git a/config/home/packages.nix b/config/home/packages.nix index 740d94e..4f0950e 100644 --- a/config/home/packages.nix +++ b/config/home/packages.nix @@ -8,7 +8,7 @@ in { home.packages = with pkgs; [ pkgs."${browser}" discord libvirt swww grim slurp gnome.file-roller swaynotificationcenter rofi-wayland imv transmission-gtk mpv - gimp obs-studio rustup audacity pavucontrol wezterm + gimp obs-studio rustup audacity pavucontrol font-awesome spotify swayidle neovide element-desktop swaylock (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) # Import Scripts diff --git a/config/home/wezterm.nix b/config/home/wezterm.nix new file mode 100644 index 0000000..3e47938 --- /dev/null +++ b/config/home/wezterm.nix @@ -0,0 +1,95 @@ +{ pkgs, config, lib, ... }: + +let + palette = config.colorScheme.palette; + inherit (import ../../options.nix) wezterm; +in lib.mkIf (wezterm == true) { + home.packages = with pkgs; [ + pkgs.wezterm + ]; + + home.file.".config/wezterm/wezterm.lua".text = '' + local wezterm = require 'wezterm' + + -- This will hold the configuration. + local config = wezterm.config_builder() + + config.colors = { + foreground = '#${palette.base05}', + background = '#${palette.base00}', + + -- Overrides the cell background color when the current cell is occupied by the + -- cursor and the cursor style is set to Block + cursor_bg = '#${palette.base07}', + -- Overrides the text color when the current cell is occupied by the cursor + cursor_fg = '#${palette.base00}', + -- Specifies the border color of the cursor when the cursor style is set to Block, + -- or the color of the vertical or horizontal bar when the cursor style is set to + -- Bar or Underline. + cursor_border = '#${palette.base07}', + + -- the foreground color of selected text + selection_fg = '#${palette.base01}', + -- the background color of selected text + selection_bg = '#${palette.base0D}', + + -- The color of the scrollbar "thumb"; the portion that represents the current viewport + scrollbar_thumb = '#222222', + + -- The color of the split lines between panes + split = '#444444', + + ansi = { + '#${palette.base00}', + '#${palette.base0C}', + '#${palette.base09}', + '#${palette.base0A}', + '#${palette.base0F}', + '#${palette.base0E}', + '#${palette.base07}', + '#${palette.base05}', + }, + brights = { + '#${palette.base01}', + '#${palette.base0C}', + '#${palette.base09}', + '#${palette.base0B}', + '#${palette.base03}', + '#${palette.base0E}', + '#${palette.base0D}', + '#${palette.base05}', + }, + + -- Arbitrary colors of the palette in the range from 16 to 255 + indexed = { [136] = '#af8700' }, + + -- Since: 20220319-142410-0fcdea07 + -- When the IME, a dead key or a leader key are being processed and are effectively + -- holding input pending the result of input composition, change the cursor + -- to this color to give a visual cue about the compose state. + compose_cursor = 'orange', + + -- Colors for copy_mode and quick_select + -- available since: 20220807-113146-c2fee766 + -- In copy_mode, the color of the active text is: + -- 1. copy_mode_active_highlight_* if additional text was selected using the mouse + -- 2. selection_* otherwise + copy_mode_active_highlight_bg = { Color = '#000000' }, + -- use `AnsiColor` to specify one of the ansi color palette values + -- (index 0-15) using one of the names "Black", "Maroon", "Green", + -- "Olive", "Navy", "Purple", "Teal", "Silver", "Grey", "Red", "Lime", + -- "Yellow", "Blue", "Fuchsia", "Aqua" or "White". + copy_mode_active_highlight_fg = { AnsiColor = 'Black' }, + copy_mode_inactive_highlight_bg = { Color = '#52ad70' }, + copy_mode_inactive_highlight_fg = { AnsiColor = 'White' }, + + quick_select_label_bg = { Color = 'peru' }, + quick_select_label_fg = { Color = '#ffffff' }, + quick_select_match_bg = { AnsiColor = 'Navy' }, + quick_select_match_fg = { Color = '#ffffff' }, + } + + -- and finally, return the configuration to wezterm + return config + ''; +} diff --git a/options.nix b/options.nix index 12742fc..672ba92 100644 --- a/options.nix +++ b/options.nix @@ -41,5 +41,6 @@ in { kdenlive = true; blender = true; logitech = true; + wezterm = false; }