From b55cec1458cd0408a7f0e456914b1fe8a584a0bf Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Mon, 4 Nov 2024 09:42:06 -0800 Subject: [PATCH] wezterm update to use workspaces better --- flake.lock | 12 ++++++------ home.nix | 1 + programs/wezterm/wezterm.lua | 11 +++++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index dbd1448..1465e44 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1730448474, - "narHash": "sha256-qE/cYKBhzxHMtKtLK3hlSR3uzO1pWPGLrBuQK7r0CHc=", + "lastModified": 1730600078, + "narHash": "sha256-BoyFmE59HDF3uybBySsWVoyjNuHvz3Wv8row/mSb958=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "683d0c4cd1102dcccfa3f835565378c7f3cbe05e", + "rev": "4652874d014b82cb746173ffc64f6a70044daa7e", "type": "github" }, "original": { @@ -58,11 +58,11 @@ }, "nur": { "locked": { - "lastModified": 1730510022, - "narHash": "sha256-/FKsDxYEDNScuYuh9UjBwW8+f6WxjoRke8LvbF+ckjc=", + "lastModified": 1730612615, + "narHash": "sha256-l5mlB45tLEcMGGEucbGs06CvsrXrxGM4NKueWh7Pkuo=", "owner": "nix-community", "repo": "nur", - "rev": "41c8b0a22b37fb114413b504c74ae64065d2fb83", + "rev": "88b6dea6f574d59dd0f3bd48d1da32d37118de34", "type": "github" }, "original": { diff --git a/home.nix b/home.nix index e677893..380415b 100644 --- a/home.nix +++ b/home.nix @@ -248,6 +248,7 @@ set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH eval (direnv hook fish) any-nix-shell fish --info-right | source + eval (ssh-agent -c) ssh-add ~/.ssh/id_ed25519 --apple-use-keychain --apple-load-keychain ''; diff --git a/programs/wezterm/wezterm.lua b/programs/wezterm/wezterm.lua index 8bb2853..60e997a 100644 --- a/programs/wezterm/wezterm.lua +++ b/programs/wezterm/wezterm.lua @@ -1,4 +1,5 @@ local wezterm = require 'wezterm' +local mux = wezterm.mux local act = wezterm.action local function is_vim(pane) @@ -38,6 +39,12 @@ wezterm.on('update-right-status', function(window, pane) window:set_right_status(window:active_workspace()) end) +wezterm.on('gui-startup', function(cmd) + local tab, pane, window = mux.spawn_window(cmd or {}) + window:gui_window():maximize() + pane:split { size = 0.2 } +end) + return { adjust_window_size_when_changing_font_size = false, check_for_updates = false, @@ -96,8 +103,8 @@ return { { key = 'q', mods = 'SUPER', action = act.QuitApplication }, { key = 'i', mods = 'CTRL|SHIFT', action = act.SwitchToWorkspace }, { - key = 'S', - mods = 'CTRL|SHIFT', + key = '8', + mods = 'ALT', action = wezterm.action_callback(function(window, pane) -- Here you can dynamically construct a longer list if needed