Compare commits

...

5 commits

7 changed files with 145 additions and 12 deletions

View file

@ -82,7 +82,11 @@ in
# https://wiki.hyprland.org/Configuring/Binds
bind = [
# Programs
"$mod, RETURN, exec, kitty"
(
if config.profile.programs.wezterm.enable
then "$mod, RETURN, exec, wezterm-gui"
else "$mod, RETURN, exec, kitty"
)
"$mod, E, exec, thunar"
"$mod, B, exec, microsoft-edge"
"$mod, D, exec, rofi -show drun -replace -i"

View file

@ -1,6 +1,7 @@
local wezterm = require('wezterm')
local shortcuts = require('keys')
require('event_config')
return {
enable_wayland = false,

View file

@ -0,0 +1,117 @@
local wezterm = require('wezterm')
local process_icons = {
['docker'] = wezterm.nerdfonts.linux_docker,
['docker-compose'] = wezterm.nerdfonts.linux_docker,
['btm'] = '',
['psql'] = '󱤢',
['usql'] = '󱤢',
['kuberlr'] = wezterm.nerdfonts.linux_docker,
['ssh'] = wezterm.nerdfonts.fa_exchange,
['ssh-add'] = wezterm.nerdfonts.fa_exchange,
['kubectl'] = wezterm.nerdfonts.linux_docker,
['stern'] = wezterm.nerdfonts.linux_docker,
['nvim'] = wezterm.nerdfonts.custom_vim,
['make'] = wezterm.nerdfonts.seti_makefile,
['vim'] = wezterm.nerdfonts.dev_vim,
['node'] = wezterm.nerdfonts.mdi_hexagon,
['go'] = wezterm.nerdfonts.seti_go,
['python3'] = '',
['zsh'] = wezterm.nerdfonts.dev_terminal,
['bash'] = wezterm.nerdfonts.cod_terminal_bash,
['htop'] = wezterm.nerdfonts.mdi_chart_donut_variant,
['cargo'] = wezterm.nerdfonts.dev_rust,
['sudo'] = wezterm.nerdfonts.fa_hashtag,
['lazydocker'] = wezterm.nerdfonts.linux_docker,
['git'] = wezterm.nerdfonts.dev_git,
['lua'] = wezterm.nerdfonts.seti_lua,
['wget'] = wezterm.nerdfonts.mdi_arrow_down_box,
['curl'] = wezterm.nerdfonts.mdi_flattr,
['gh'] = wezterm.nerdfonts.dev_github_badge,
['ruby'] = wezterm.nerdfonts.cod_ruby,
}
local function get_current_working_dir(tab)
local current_dir = tab.active_pane and tab.active_pane.current_working_dir or { file_path = '' }
local HOME_DIR = os.getenv('HOME')
return current_dir.file_path == HOME_DIR and '~' or string.gsub(current_dir.file_path, '(.*[/\\])(.*)', '%2')
end
local function get_process(tab)
if not tab.active_pane or tab.active_pane.foreground_process_name == '' then
return nil
end
local process_name = string.gsub(tab.active_pane.foreground_process_name, '(.*[/\\])(.*)', '%2')
if string.find(process_name, 'kubectl') then
process_name = 'kubectl'
end
return process_icons[process_name] or string.format('[%s]', process_name)
end
wezterm.on('format-tab-title', function(tab, tabs, panes, config, hover, max_width)
local has_unseen_output = false
if not tab.is_active then
for _, pane in ipairs(tab.panes) do
if pane.has_unseen_output then
has_unseen_output = true
break
end
end
end
local cwd = wezterm.format({
{ Text = get_current_working_dir(tab) },
})
local process = get_process(tab)
local title = process and string.format(' %s (%s) ', process, cwd) or ' [?] '
if has_unseen_output then
return {
{ Foreground = { Color = '#28719c' } },
{ Text = title },
}
end
return {
{ Text = title },
}
end)
local state = {
debug_mode = false,
}
wezterm.on('update-right-status', function(window, pane)
local process = ''
if state.debug_mode then
local info = pane:get_foreground_process_info()
if info then
process = info.name
for i = 2, #info.argv do
process = info.argv[i]
end
end
end
local status = (#process > 0 and ' | ' or '')
local name = window:active_key_table()
if name then
status = string.format('󰌌 { %s }', name)
end
if window:get_dimensions().is_full_screen then
status = status .. wezterm.strftime(' %R ')
end
window:set_right_status(wezterm.format({
{ Foreground = { Color = '#7eb282' } },
{ Text = process },
{ Foreground = { Color = '#808080' } },
{ Text = status },
}))
end)

View file

@ -65,5 +65,6 @@
programs.easyeffects.enable = true;
steam.enable = true;
programs.wezterm.enable = true;
};
}

View file

@ -12,10 +12,11 @@
noto-fonts-emoji
noto-fonts-color-emoji
# nerdfonts
(nerdfonts.override {
fonts = [ "FiraCode" "JetBrainsMono" "Iosevka" ];
})
nerdfonts
# (nerdfonts.override {
# fonts = [ "FiraCode" "JetBrainsMono" "Iosevka" ];
# })
];
# use fonts specified by user rather than default ones

View file

@ -55,7 +55,6 @@ in
};
fonts.packages = with pkgs; [
nerdfonts
meslo-lgs-nf
font-awesome
roboto

View file

@ -68,15 +68,14 @@ in
"onyx"
];
};
"/nas/Syncthing/Sync/VPN" = {
label = "OpenVPN";
id = "OpenVPN";
devices = lib.attrsets.mapAttrsToList (key: _value: key) config.services.syncthing.settings.devices;
};
"/nas/Syncthing/Sync/WireGuard" = {
label = "WireGuard";
id = "WireGuard";
devices = lib.attrsets.mapAttrsToList (key: _value: key) config.services.syncthing.settings.devices;
# devices = lib.attrsets.mapAttrsToList (key: _value: key) config.services.syncthing.settings.devices;
devices = [
"s20fe"
"work-laptop"
];
};
"/nas/photos/mama" = {
label = "Camera Mama";
@ -101,6 +100,13 @@ in
"work-laptop"
];
};
"/nas/EmuDeck" = {
label = "EmuDeck";
id = "EmuDeck";
devices = [
"steam-deck"
];
};
};
devices = {
s20fe = {
@ -123,6 +129,10 @@ in
name = "Samsung S22 Mama";
id = "5G2Q7XE-HILUI46-GWTE6P6-NJHAG3A-HSZKMAU-K5PBOKR-QN3IFQO-GX7KTQU";
};
steam-deck = {
name = "Steam Deck";
id = "6SOR4SU-MVT2XIS-4J6IGVP-LITFLDB-ZH6LA7T-PUSQK26-P6RVWZ7-YB7P4AX";
};
};
};
overrideFolders = true;