fish and wezterm
This commit is contained in:
parent
d9d7402234
commit
9129863969
|
|
@ -25,11 +25,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1767391542,
|
||||
"narHash": "sha256-qHXxJuFkQhggyeao/kQb6KcOjgz0Ky+ArfowRX1MHaE=",
|
||||
"lastModified": 1767437240,
|
||||
"narHash": "sha256-OA0dBHhccdupFXp+/eaFfb8K1dQxk61in4aF5ITGVX8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "2f06b726061b7e1aa69f718e943da9ffcecd6397",
|
||||
"rev": "1cfa305fba94468f665de1bd1b62dddf2e0cb012",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
6
home-manager/fish/default.nix
Normal file
6
home-manager/fish/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.fish.enable = true;
|
||||
|
||||
xdg.configFile."fish/functions/fish_prompt.fish".source = ./functions/fish_prompt.fish;
|
||||
}
|
||||
41
home-manager/fish/functions/fish_prompt.fish
Normal file
41
home-manager/fish/functions/fish_prompt.fish
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
function preexec --on-event fish_preexec
|
||||
set -g _play_command_begin_time (date +%s%3N)
|
||||
end
|
||||
|
||||
function postexec --on-event fish_postexec
|
||||
set -l _status $status
|
||||
if test -z $_play_command_begin_time
|
||||
return
|
||||
end
|
||||
|
||||
set -l code
|
||||
if test $_status -eq 0
|
||||
set_color green
|
||||
set code "✔success:$_status"
|
||||
else
|
||||
set_color red
|
||||
set code "✘error:$_status"
|
||||
end
|
||||
|
||||
set -l took_time
|
||||
set -l millis (echo (date +%s%3N)"-$_play_command_begin_time" | bc)
|
||||
if test $millis -ge 10000
|
||||
set took_time (echo "$millis/1000" | bc)s
|
||||
else if test $millis -ge 1000
|
||||
set took_time (echo "scale=2; $millis/1000" | bc)s
|
||||
else
|
||||
set took_time "$millis""ms"
|
||||
end
|
||||
|
||||
echo -s -n $code\ (set_color magenta)\ $took_time\n
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set now_date (set_color cyan)(date +%H:%M:%S)
|
||||
set who_n_where (set_color yellow)$USER::(prompt_hostname)
|
||||
set pwd (prompt_pwd)
|
||||
set enter_mark (set_color red)'❯'(set_color yellow)'❯'(set_color green)'❯'
|
||||
|
||||
echo -e -s -n -- $now_date\ $who_n_where\ (set_color white)\|(set_color yellow)\ $pwd\n$enter_mark\
|
||||
set_color normal
|
||||
end
|
||||
6
home-manager/wezterm/default.nix
Normal file
6
home-manager/wezterm/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.wezterm.enable = true;
|
||||
|
||||
xdg.configFile."wezterm/wezterm.lua".source = ./wezterm.lua;
|
||||
}
|
||||
88
home-manager/wezterm/wezterm.lua
Normal file
88
home-manager/wezterm/wezterm.lua
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
local wezterm = require 'wezterm'
|
||||
local config = {
|
||||
enable_wayland = true,
|
||||
force_reverse_video_cursor = true,
|
||||
|
||||
font_size = 12,
|
||||
|
||||
colors = {
|
||||
foreground = '#dcd7ba',
|
||||
background = 'rgba(31,31,31,0.2)',
|
||||
|
||||
cursor_bg = '#c8c093',
|
||||
cursor_fg = '#c8c093',
|
||||
cursor_border = '#c8c093',
|
||||
|
||||
selection_fg = '#c8c093',
|
||||
selection_bg = '#2d4f67',
|
||||
|
||||
scrollbar_thumb = '#16161d',
|
||||
split = '#16161d',
|
||||
|
||||
ansi = { '#090618', '#c34043', '#76946a', '#c0a36e', '#7e9cd8', '#957fb8', '#6a9589', '#c8c093' },
|
||||
brights = { '#727169', '#e82424', '#98bb6c', '#e6c384', '#7fb4ca', '#938aa9', '#7aa89f', '#dcd7ba' },
|
||||
indexed = { [16] = '#ffa066', [17] = '#ff5d62' },
|
||||
tab_bar = {
|
||||
background = 'rgba(31, 31, 40, 0.5)',
|
||||
new_tab = {
|
||||
bg_color = 'rgba(31, 31, 40, 0.5)',
|
||||
fg_color = '#c8c093',
|
||||
},
|
||||
new_tab_hover = {
|
||||
bg_color = 'rgba(31, 31, 40, 0.5)',
|
||||
fg_color = '#c8c093',
|
||||
intensity = 'Bold'
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
use_fancy_tab_bar = false,
|
||||
show_tab_index_in_tab_bar = false,
|
||||
|
||||
keys = {
|
||||
{ key = 'V', mods = 'CTRL', action = wezterm.action.PasteFrom 'Clipboard' },
|
||||
}
|
||||
}
|
||||
|
||||
local SOLID_LEFT_ARROW = wezterm.nerdfonts.pl_right_hard_divider
|
||||
local SOLID_RIGHT_ARROW = wezterm.nerdfonts.pl_left_hard_divider
|
||||
function tab_title(tab_info)
|
||||
local title = tab_info.tab_title
|
||||
-- if the tab title is explicitly set, take that
|
||||
if title and #title > 0 then
|
||||
return title
|
||||
end
|
||||
-- Otherwise, use the title from the active pane
|
||||
-- in that tab
|
||||
return tab_info.active_pane.title
|
||||
end
|
||||
wezterm.on(
|
||||
'format-tab-title',
|
||||
function(tab, tabs, panes, config, hover, max_width)
|
||||
|
||||
local bg_color = 'rgba(31, 31, 40, 0.5)'
|
||||
local fg_color = '#c8c093'
|
||||
local text_color = '#1f1f28'
|
||||
|
||||
if tab.is_active then
|
||||
fg_color = '#2d4f67'
|
||||
text_color = '#c8c093'
|
||||
end
|
||||
|
||||
local title = wezterm.truncate_right(tab_title(tab), max_width - 4)
|
||||
|
||||
return {
|
||||
{ Background = { Color = bg_color } },
|
||||
{ Foreground = { Color = fg_color } },
|
||||
{ Text = SOLID_LEFT_ARROW },
|
||||
{ Background = { Color = fg_color } },
|
||||
{ Foreground = { Color = text_color } },
|
||||
{ Text = ' ' .. title .. ' ' },
|
||||
{ Background = { Color = bg_color } },
|
||||
{ Foreground = { Color = fg_color } },
|
||||
{ Text = SOLID_RIGHT_ARROW },
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
return config
|
||||
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
./display.nix
|
||||
|
||||
../../home-manager/wezterm
|
||||
../../home-manager/fish
|
||||
|
||||
../../home-manager/vscode.nix
|
||||
../../home-manager/direnv.nix
|
||||
../../home-manager/firefox.nix
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
home.stateVersion = "25.05";
|
||||
imports = [
|
||||
../../home-manager/direnv.nix
|
||||
../../home-manager/wezterm
|
||||
../../home-manager/fish
|
||||
];
|
||||
home.packages = with pkgs; [
|
||||
];
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
../../home-manager/fnott.nix
|
||||
../../home-manager/direnv.nix
|
||||
../../home-manager/obs-studio.nix
|
||||
../../home-manager/wezterm
|
||||
../../home-manager/fish
|
||||
];
|
||||
hare.hyprland = {
|
||||
style = import ../../home-manager/hyprland/styles/thin.nix { inherit lib; };
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user