This commit is contained in:
Evan Reichard 2025-09-23 15:44:57 -04:00
parent bf4148dab0
commit be5c3e9cb8
3 changed files with 95 additions and 27 deletions

View File

@ -18,6 +18,7 @@ in
programs = {
terminal = {
bash = enabled;
tmux = enabled;
btop = enabled;
direnv = enabled;
git = enabled;

View File

@ -3,8 +3,12 @@ local cached_pr_status = ""
-- Read process output
local function read_output(err, data)
if err then return end
if not data then return end
if err then
return
end
if not data then
return
end
cached_pr_status = data
end
@ -14,12 +18,13 @@ local function execute_command()
local spawn_opts = {
detached = true,
stdio = {nil, stdout, nil},
args = {"-c", "gh pr checks | awk -F'\t' '{ print $2 }'"}
stdio = { nil, stdout, nil },
args = { "-c", "gh pr checks | awk -F'\t' '{ print $2 }'" },
}
vim.loop.spawn("bash", spawn_opts,
function() stdout:read_start(read_output) end)
vim.loop.spawn("bash", spawn_opts, function()
stdout:read_start(read_output)
end)
end
-- Spawn & schedule process
@ -34,16 +39,20 @@ function pr_status()
-- PENDING COLOR - #d29922
-- PASS COLOR - #3fb950
-- FAIL COLOR - #f85149
return cached_pr_status:gsub("\n", ""):gsub("fail", ""):gsub("pass",
"")
:gsub("pending", ""):gsub("skipping", ""):sub(1, -2)
return cached_pr_status
:gsub("\n", "")
:gsub("fail", "")
:gsub("pass", "")
:gsub("pending", "")
:gsub("skipping", "")
:sub(1, -2)
end
require('lualine').setup({
require("lualine").setup({
options = {
theme = "gruvbox_dark"
theme = "catppuccin",
-- theme = "nord"
-- theme = "OceanicNext",
},
sections = {lualine_c = {{pr_status}}}
sections = { lualine_c = { { pr_status } } },
})

View File

@ -0,0 +1,58 @@
{ lib, pkgs, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.tmux;
in
{
options.${namespace}.programs.terminal.tmux = {
enable = lib.mkEnableOption "tmux";
};
config = mkIf cfg.enable {
programs.tmux = {
enable = true;
clock24 = true;
plugins = with pkgs.tmuxPlugins; [
{
plugin = catppuccin;
extraConfig = ''
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_status_background "none"
# Style & Separators
set -g @catppuccin_window_status_style "basic"
set -g @catppuccin_status_left_separator ""
set -g @catppuccin_status_middle_separator ""
set -g @catppuccin_status_right_separator ""
# Window Titles
set -g @catppuccin_window_text " #W"
set -g @catppuccin_window_current_text " #W"
'';
}
cpu
yank
];
extraConfig = ''
# Misc Settings
set -g status-position top
set -g mouse on
setw -g mode-keys vi
set -g renumber-windows on
set -ga terminal-overrides ",xterm-256color:Tc"
# Maintain Directory
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Theme
set -g status-left ""
set -g status-right ""
set -ag status-right "#{E:@catppuccin_status_host}"
'';
};
};
}