From e1358eef49165dad0b812ed4cfc9d0e9bcd76471 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 26 Aug 2024 11:41:38 +0100 Subject: wayland updates --- programs/alacritty.nix | 63 +++++++++++++++++++++++++++++++++++++++++++++++ programs/atuin.nix | 20 +++++++++------ programs/bash.nix | 16 ++---------- programs/default.nix | 16 +++++++++--- programs/fuzzel.nix | 42 ++++++++++++++++++++++++++++++++ programs/git.nix | 66 +++++++++++++++++++++++++------------------------- programs/init.vim | 3 ++- programs/rofi.nix | 7 +++--- programs/st/config.h | 2 +- programs/tmux.nix | 11 ++++++--- 10 files changed, 179 insertions(+), 67 deletions(-) create mode 100644 programs/alacritty.nix create mode 100644 programs/fuzzel.nix (limited to 'programs') diff --git a/programs/alacritty.nix b/programs/alacritty.nix new file mode 100644 index 0000000..280c667 --- /dev/null +++ b/programs/alacritty.nix @@ -0,0 +1,63 @@ +{ config +, pkgs +, lib +, theme +, font +, ... +}: +let + + fontConfig = { + normal = { family = "${font.name}"; style = "Regular"; }; + bold = { family = "${font.name}"; style = "Bold"; }; + italic = { family = "${font.name}"; style = "Italic"; }; + size = 10.0; + }; +in +{ + programs.alacritty = { + enable = true; + settings = { + env = { + TERM = "xterm-256color"; + }; + window = { + padding.x = 20; + padding.y = 20; + dynamic_padding = true; + decorations = "None"; + }; + + font = fontConfig; + + colors = { + primary = { + background = "${theme.base00}"; + foreground = "${theme.base05}"; + }; + normal = { + black = "${theme.base00}"; + red = "${theme.base08}"; + green = "${theme.base0B}"; + yellow = "${theme.base0A}"; + blue = "${theme.base0D}"; + magenta = "${theme.base0E}"; + cyan = "${theme.base0C}"; + white = "${theme.base05}"; + }; + bright = { + black = "${theme.base03}"; + red = "${theme.base09}"; + green = "${theme.base01}"; + yellow = "${theme.base02}"; + blue = "${theme.base04}"; + magenta = "${theme.base06}"; + cyan = "${theme.base0F}"; + white = "${theme.base07}"; + }; + }; + + }; + }; +} + diff --git a/programs/atuin.nix b/programs/atuin.nix index 898e848..39e5d89 100644 --- a/programs/atuin.nix +++ b/programs/atuin.nix @@ -2,15 +2,19 @@ programs.atuin = { enable = true; enableBashIntegration = true; + flags = [ + "--disable-up-arrow" + ]; settings = { - invert = true; - history_format = "{command}"; - theme.name = "minimal"; - style = "compact"; - inline_height = 15; - prefers_reduced_motion = true; - show_help = false; - show_tabs = false; + invert = true; + history_format = "{command}"; + theme.name = "minimal"; + style = "compact"; + inline_height = 15; + prefers_reduced_motion = true; + show_help = false; + show_tabs = false; + enter_accept = true; }; }; } diff --git a/programs/bash.nix b/programs/bash.nix index 7d3c25e..d4a52f2 100644 --- a/programs/bash.nix +++ b/programs/bash.nix @@ -53,27 +53,15 @@ ]; sessionVariables = { - - PF_INFO = "ascii title os kernel uptime pkgs shell"; - PF_SEP = " "; - PF_COL1 = 7; - PF_COL2 = 7; - PF_COL3 = 6; - PF_ALIGN = "9"; - PF_ASCII = "nixos"; - - _JAVA_AWT_WM_NONREPARENTING = 1; - - TERM = "xterm-256color-italic"; + TERM = "alacritty"; EDITOR = "nvim"; MANPAGER = "nvim +Man!"; GPG_TTY = "\$(tty)"; - }; initExtra = '' export PATH=$PATH:"$HOME/scripts" - export PROMPT_COMMAND="tmux refresh-client -S > /dev/null"; + export PROMPT_COMMAND="tmux refresh-client -S &> /dev/null"; export PS1="\n\001\e[0;36m\002λ\001\e[0m\002 "; export PS2="> "; diff --git a/programs/default.nix b/programs/default.nix index 32eaf18..b45f476 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -18,8 +18,10 @@ ./neovim.nix ./readline.nix ./rofi.nix + ./alacritty.nix ./tmux.nix ./zathura.nix + ./fuzzel.nix ]; programs = { @@ -53,9 +55,17 @@ enable = true; enableBashIntegration = true; settings = { - imports = [ - "native-16.hjson" - ]; + imports = [ + "native-16.hjson" + ]; + verbs = [ + { + key = "enter"; + working_dir = "{root}"; + execution = ''$EDITOR +{line} {file}''; + leave_broot = false; + } + ]; }; }; }; diff --git a/programs/fuzzel.nix b/programs/fuzzel.nix new file mode 100644 index 0000000..8a87911 --- /dev/null +++ b/programs/fuzzel.nix @@ -0,0 +1,42 @@ +{ config +, pkgs +, theme +, font +, ... +}: + +with theme; +let + fuzzelColor = themeColor: (builtins.replaceStrings [ "#" ] [ "" ] themeColor) + "ff"; +in +{ + programs.fuzzel = { + enable = true; + settings = { + main = { + font = "${font.name}:size=12"; + prompt = ""; + anchor = "top-left"; + icons-enabled = "no"; + fields = "filename,exec,name,generic"; + horizontal-pad = 12; + vertical-pad = 12; + }; + colors = { + background = "${fuzzelColor theme.base00}"; + text = "${fuzzelColor theme.base02}"; + match = "${fuzzelColor theme.base0C}"; + selection = "${fuzzelColor theme.base00}"; + selection-text = "${fuzzelColor theme.base05}"; + selection-match = "${fuzzelColor theme.base0C}"; + border = "${fuzzelColor theme.base02}"; + }; + border = { + width = 2; + radius = 0; + }; + }; + }; +} + + diff --git a/programs/git.nix b/programs/git.nix index d4fac67..9901d2d 100644 --- a/programs/git.nix +++ b/programs/git.nix @@ -12,39 +12,39 @@ with theme; userEmail = "nerdy@peppe.rs"; userName = "Akshay"; lfs.enable = true; - delta = { - enable = true; - options = { - features = "decorations labels"; - syntax-theme = "none"; - zero-style = "8"; - navigate = "true"; - line-numbers = "true"; - keep-plus-minus-markers = "true"; - line-numbers-zero-style = "8"; - line-numbers-left-style = "8"; - line-numbers-right-style = "8"; - line-numbers-minus-style = "${base08}"; - line-numbers-plus-style = "${base0B}"; - decorations = { - file-decoration-style = "none"; - whitespace-error-style = "22 reverse"; - minus-style = "${base08}"; - minus-emph-style = "${base08} bold"; - plus-style = "${base0B}"; - plus-emph-style = "${base0B} bold"; - file-style = "7 bold"; - hunk-header-style = "7"; - hunk-header-decoration-style = "8 ul"; - }; - labels = { - file-modified-label = " MODIFIED "; - file-removed-label = " REMOVED "; - file-added-label = " ADDED "; - file-renamed-label = " RENAMED "; - }; - }; - }; + # delta = { + # enable = true; + # options = { + # features = "decorations labels"; + # syntax-theme = "none"; + # zero-style = "8"; + # navigate = "true"; + # line-numbers = "true"; + # keep-plus-minus-markers = "true"; + # line-numbers-zero-style = "8"; + # line-numbers-left-style = "8"; + # line-numbers-right-style = "8"; + # line-numbers-minus-style = "${base08}"; + # line-numbers-plus-style = "${base0B}"; + # # decorations = { + # # file-decoration-style = "none"; + # # whitespace-error-style = "22 reverse"; + # # minus-style = "${base08}"; + # # minus-emph-style = "${base08} bold"; + # # plus-style = "${base0B}"; + # # plus-emph-style = "${base0B} bold"; + # # file-style = "7 bold"; + # # hunk-header-style = "7"; + # # hunk-header-decoration-style = "8 ul"; + # # }; + # labels = { + # file-modified-label = " MODIFIED "; + # file-removed-label = " REMOVED "; + # file-added-label = " ADDED "; + # file-renamed-label = " RENAMED "; + # }; + # }; + # }; aliases = { co = "checkout"; rb = "rebase"; diff --git a/programs/init.vim b/programs/init.vim index af74f32..3dbd4b5 100644 --- a/programs/init.vim +++ b/programs/init.vim @@ -56,6 +56,7 @@ set dir=/tmp syntax on set nocursorline +set notermguicolors set omnifunc=syntaxcomplete#Complete set completefunc=LanguageClient#complete set list @@ -159,7 +160,7 @@ highlight GitGutterAdd ctermfg=8 highlight GitGutterChange ctermfg=8 highlight GitGutterDelete ctermfg=8 -let g:rustfmt_autosave = 1 +let g:rustfmt_autosave = 0 let g:latex_view_general_viewer = "zathura" let g:vimtex_view_method = "zathura" diff --git a/programs/rofi.nix b/programs/rofi.nix index 8ce77bf..c140f63 100644 --- a/programs/rofi.nix +++ b/programs/rofi.nix @@ -53,8 +53,9 @@ let in { programs.rofi = { + package = pkgs.rofi-wayland; enable = true; - font = "${font.name} 21"; + font = "${font.name} 12"; location = "top-left"; xoffset = 20; yoffset = 20; @@ -65,8 +66,8 @@ in combi-modes = mkLiteral "[ window, run ]"; # window = mkLiteral ''{ display-name: "[w]"; }''; # run = mkLiteral ''{ display-name: "[r]"; }''; - kb-clear-line = "Control+c"; - kb-remove-word-back = "Control+w"; + # kb-clear-line = "Control+u"; + # kb-remove-word-back = "Control+w"; }; }; } diff --git a/programs/st/config.h b/programs/st/config.h index c9fca58..e7f79e3 100644 --- a/programs/st/config.h +++ b/programs/st/config.h @@ -27,7 +27,7 @@ char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; char *vtiden = "\033[?6c"; /* Kerning / character bounding-box multipliers */ -static float cwscale = 0.9; +static float cwscale = 1.0; static float chscale = 1.0; /* diff --git a/programs/tmux.nix b/programs/tmux.nix index c8745c7..bfda915 100644 --- a/programs/tmux.nix +++ b/programs/tmux.nix @@ -28,12 +28,15 @@ let date-bst = date-tz "Europe/London"; date-hel = date-tz "Europe/Helsinki"; + copy = "${pkgs.wl-clipboard-rs}/bin/wl-copy"; + paste = "${pkgs.wl-clipboard-rs}/bin/wl-paste"; + # plugins thumbs = { plugin = pkgs.tmuxPlugins.tmux-thumbs; extraConfig = '' set -g @thumbs-key F - set -g @thumbs-command 'echo -n {} | xclip -i -sel p -f | xclip -i -sel c' + set -g @thumbs-command 'echo -n {} | ${copy}' set -g @thumbs-fg-color white set -g @thumbs-hint-bg-color yellow set -g @thumbs-hint-fg-color black @@ -65,7 +68,7 @@ in plugins = [ thumbs ]; prefix = "C-t"; keyMode = "vi"; - terminal = "xterm-256color-italic"; + terminal = "alacritty"; extraConfig = '' bind r source-file ~/.config/tmux/tmux.conf @@ -112,9 +115,9 @@ in bind-key -r ">" swap-window -d -t +1 bind-key -T copy-mode-vi v send-keys -X begin-selection - bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c " + bind-key -T copy-mode-vi y send-keys -X copy-pipe "${copy}" bind-key -T copy-mode-vi r send-keys -X rectangle-toggle - bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "xclip -i -sel p -f | xclip -i -sel c " + bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "${copy}" bind P paste-buffer set-window-option -g allow-rename off -- cgit v1.2.3