1
0
Fork 0

Switch from kitty to wezterm

This commit is contained in:
Daniel Kempkens 2022-12-19 22:02:48 +01:00
parent bb61ff0a93
commit 4983fb551e
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
7 changed files with 114 additions and 22 deletions

View file

@ -325,7 +325,15 @@
(set mod.scrollbar {:init (fn [self]
(set self.current-line (get-current-line))
(set self.total-lines (get-total-lines)))
:static {:scrollbar-icons ["🭶"
:static {:scrollbar-icons-block ["▁"
"▂"
"▃"
"▄"
"▅"
"▆"
"▇"
"█"]
:scrollbar-icons-line ["🭶"
"🭷"
"🭸"
"🭹"
@ -335,9 +343,10 @@
(let [i (+ (math.floor (* (/ (- self.current-line
1)
self.total-lines)
(length self.scrollbar-icons)))
(length self.scrollbar-icons-block)))
1)
new-scrollbar (. self :scrollbar-icons
new-scrollbar (. self
:scrollbar-icons-block
i)]
(string.rep new-scrollbar 2)))
:hl {:fg colors.purple}})

View file

@ -28,7 +28,7 @@
(when (not= project-root nil)
(set checkstyle.config_file
(.. project-root :/config/checkstyle/checkstyle.xml)))
(set fennel.globals [:vim]))
(set fennel.globals [:vim :wezterm]))
;; Configure Linters per FT
(set lint.linters_by_ft {:dockerfile [:hadolint]
:elixir [:credo]

View file

@ -0,0 +1,37 @@
(let [wezterm (require :wezterm)]
{:default_prog _G.default_shell
;; Appearance
:color_scheme "Dracula (Official)"
:window_padding {:left :6px :right :6px :top :2px :bottom :4px}
:enable_tab_bar true
:use_fancy_tab_bar true
:hide_tab_bar_if_only_one_tab true
;; Fonts
:font (wezterm.font_with_fallback [{:family "JetBrains Mono"
:weight :Medium}
"Symbols Nerd Font"
"Apple Symbols"
"Apple Color Emoji"
"Noto Sans Symbols"
"Noto Sans Symbols2"
:Unifont])
:font_size 13
:line_height 0.9
:freetype_load_target :Light
;:freetype_render_target :HorizontalLcd
;; Mouse
:mouse_bindings [; Only select text and don't open hyperlinks
{:event {:Up {:streak 1 :button :Left}}
:mods :NONE
:action (wezterm.action {:ExtendSelectionToMouseCursor :Cell})}
; Don't copy on double click
{:event {:Up {:streak 2 :button :Left}}
:mods :NONE
:action :Nop}
; CMD-click to open a hyperlink
{:event {:Up {:streak 1 :button :Left}}
:mods :CMD
:action :OpenLinkAtMouseCursor}]
;; Scrollback
:scrollback_lines 5000})

View file

@ -8,7 +8,7 @@ in
../programs/fish.nix
../programs/starship.nix
../programs/direnv.nix
../programs/kitty.nix
../programs/wezterm.nix
../programs/nvim

View file

@ -1,6 +1,8 @@
{ pkgs, config, ... }:
{
home.packages = [ pkgs.terminal-notifier ];
programs.fish = {
enable = true;
@ -27,13 +29,14 @@
};
}
# https://github.com/franciscolourenco/done/releases
{
name = "done-fish";
src = pkgs.fetchFromGitHub {
owner = "nifoc";
owner = "franciscolourenco";
repo = "done";
rev = "2f4e94d8306224f63cd12fb992318985a83d51a8";
sha256 = "Pq8HEISGjpCTXBIyukcLUK8r1hJ3/QXAklRCesm4nQ0=";
rev = "1.16.5";
sha256 = "sha256-E0wveeDw1VzEH2kzn63q9hy1xkccfxQHBV2gVpu2IdQ=";
};
}
@ -43,8 +46,8 @@
src = pkgs.fetchFromGitHub {
owner = "PatrickF1";
repo = "fzf.fish";
rev = "v9.2";
sha256 = "sha256-XmRGe39O3xXmTvfawwT2mCwLIyXOlQm7f40mH5tzz+s=";
rev = "v9.5";
sha256 = "sha256-ZdHfIZNCtY36IppnufEIyHr+eqlvsIUOs0kY5I9Df6A=";
};
}
@ -65,8 +68,8 @@
src = pkgs.fetchFromGitHub {
owner = "nickeb96";
repo = "puffer-fish";
rev = "f8df25bde0875359805967aa999744a28dee0561";
sha256 = "sha256-Gm4In5f03G2ijL1xDTKFsgE+hRXjQ29kk84LQSXXeF0=";
rev = "fd0a9c95da59512beffddb3df95e64221f894631";
sha256 = "sha256-aij48yQHeAKCoAD43rGhqW8X/qmEGGkg8B4jSeqjVU0=";
};
}
@ -76,8 +79,8 @@
src = pkgs.fetchFromGitHub {
owner = "andreiborisov";
repo = "sponge";
rev = "1.0.4";
sha256 = "sha256-+GGfFC/hH7A8n9Wwojt5PW96fSzvRhThnZ3pLeWEqds=";
rev = "1.1.0";
sha256 = "sha256-MdcZUDRtNJdiyo2l9o5ma7nAX84xEJbGFhAVhK+Zm1w=";
};
}

38
home/programs/wezterm.nix Normal file
View file

@ -0,0 +1,38 @@
{ pkgs, ... }:
{
programs.wezterm = {
enable = true;
extraConfig = ''
_G.default_shell = { '${pkgs.fish.outPath}/bin/fish', '--interactive'};
local cfg = require('config');
return cfg
'';
};
xdg.configFile."wezterm" = {
source = pkgs.runCommand "wezterm-fennel-files"
{
nativeBuildInputs = with pkgs; [ lua53Packages.fennel stylua ];
} ''
mkdir -p $out
config_store_path="${../config/wezterm}"
fennel="fennel --use-bit-lib --compile"
echo "Using fennel command: $fennel"
# Change PWD to config directory
cd "$config_store_path"
# Init
echo "Compiling init.fnl ..."
$fennel "$config_store_path/config.fnl" > "$out/config.lua"
stylua "$out/"
'';
recursive = true;
};
}

View file

@ -5,11 +5,16 @@
fontDir.enable = true;
fonts = with pkgs; [
jetbrains-mono
victor-mono
noto-fonts
unifont
(nerdfonts.override {
fonts = [
"FiraCode"
"JetBrainsMono"
"VictorMono"
"NerdFontsSymbolsOnly"
# "JetBrainsMono"
# "VictorMono"
];
})
];