Skip to content

Commit

Permalink
fix(wezterm): Finally fixed shell integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
chevcast committed Jan 15, 2025
1 parent 59b9419 commit ee45126
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 90 deletions.
87 changes: 47 additions & 40 deletions .wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ config.adjust_window_size_when_changing_font_size = false
config.bold_brightens_ansi_colors = "BrightAndBold"
config.default_cursor_style = "BlinkingBlock"
config.enable_scroll_bar = false
config.enable_wayland = true
-- config.enable_wayland = true
config.exit_behavior_messaging = "Verbose"
-- config.front_end = "OpenGL" -- ["OpenGL", "Software", "WebGpu"]
config.hide_mouse_cursor_when_typing = true
Expand All @@ -48,63 +48,70 @@ config.native_macos_fullscreen_mode = true
config.scrollback_lines = 100000
config.show_tab_index_in_tab_bar = true
config.tab_bar_at_bottom = true
config.term = "wezterm"
-- config.term = "wezterm"
config.use_fancy_tab_bar = false
config.webgpu_power_preference = "HighPerformance"
-- config.webgpu_preferred_adapter = wezterm.gui.enumerate_gpus()[2]
-- config.window_background_opacity = 1
config.window_close_confirmation = "NeverPrompt"
-- config.window_close_confirmation = "NeverPrompt"
config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"
-- config.window_padding = { left = 10, right = 10, top = 25, bottom = 10 }
config.window_padding = { left = 0, right = 0, top = 0, bottom = 0 }

local function get_random_wallpaper()
-- Determine system path.
local root_path = "~/.dotfiles/images/wezterm-wallpapers/"
if wezterm.target_triple:match("windows") then
config.default_domain = "WSL:Arch"
config.default_cwd = "/home/chev"
config.win32_system_backdrop = "Disable" -- ["Auto", "Acrylic", "Mica", "Tabbed" "Disable"]
root_path = "\\\\wsl.localhost\\Arch\\home\\chev\\.dotfiles\\images\\wezterm-wallpapers\\"
elseif wezterm.target_triple:match("darwin") then
root_path = "/Users/alexford/.dotfiles/images/wezterm-wallpapers/"
end
-- Determine system path.
local dotfiles_path = "~/.dotfiles/images/wezterm-wallpapers/"
if wezterm.target_triple:match("windows") then
dotfiles_path = "\\\\wsl.localhost\\Arch\\home\\chev\\.dotfiles\\images\\wezterm-wallpapers\\"
config.wsl_domains = {
{
name = "WSL:Arch",
distribution = "Arch",
username = "chev",
default_cwd = "/home/chev",
},
}
config.default_domain = "WSL:Arch"
config.default_cwd = "/home/chev"
-- config.default_prog = { "wsl.exe" }
config.win32_system_backdrop = "Disable" -- ["Auto", "Acrylic", "Mica", "Tabbed" "Disable"]
elseif wezterm.target_triple:match("darwin") then
dotfiles_path = "/Users/alexford/.dotfiles/images/wezterm-wallpapers/"
end

local function get_random_wallpaper()
-- Get random wallpaper image.
local wallpapers = wezterm.read_dir(root_path)
local wallpapers = wezterm.read_dir(dotfiles_path)
if #wallpapers > 0 then
math.randomseed(os.time())
return wallpapers[math.random(#wallpapers)]
end
return nil
end

local wallpaper = get_random_wallpaper()
print(wallpaper)
if wallpaper then
config.background = {
{
source = {
File = wallpaper,
},
opacity = 1,
attachment = "Fixed",
repeat_x = "NoRepeat",
repeat_y = "NoRepeat",
vertical_align = "Bottom",
horizontal_align = "Center",
height = "Cover",
width = "Cover",
-- if wallpaper then
config.background = {
{
source = {
File = get_random_wallpaper(),
},
{
source = {
Color = color_schemes[config.color_scheme].background,
},
opacity = 0.8,
width = "100%",
height = "100%",
opacity = 1,
attachment = "Fixed",
repeat_x = "NoRepeat",
repeat_y = "NoRepeat",
vertical_align = "Bottom",
horizontal_align = "Center",
height = "Cover",
width = "Cover",
},
{
source = {
Color = color_schemes[config.color_scheme].background,
},
}
end
opacity = 0.9,
width = "100%",
height = "100%",
},
}
-- end

return config
2 changes: 2 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[[ -r "$HOME/.dotfiles/wezterm-shell-integration.sh" ]] && source "$HOME/.dotfiles/wezterm-shell-integration.sh"

# Set the terminal title to the current directory.
function chpwd {
echo "\x1b]1337;SetUserVar=panetitle=$(echo -n $(basename $(pwd)) | base64)\x07"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ to run my full Neovim setup and nothing extra.
- [firenvim](https://github.com/glacambre/firenvim.git)
- [flash.nvim](https://github.com/folke/flash.nvim.git)
- [friendly-snippets](https://github.com/rafamadriz/friendly-snippets.git)
- [fzf-lua](https://github.com/ibhagwan/fzf-lua.git)
- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim.git)
- [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim.git)
- [gruvbox.nvim](https://github.com/ellisonleao/gruvbox.nvim.git)
- [inc-rename.nvim](https://github.com/smjonas/inc-rename.nvim.git)
- [kulala.nvim](https://github.com/mistweaverco/kulala.nvim.git)
- [lazydev.nvim](https://github.com/folke/lazydev.nvim.git)
- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim.git)
Expand Down
4 changes: 2 additions & 2 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"firenvim": { "branch": "master", "commit": "f8a5fa6f1ed42536490acf0840497c40331c184f" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"fzf-lua": { "branch": "main", "commit": "6f7249741168c0751356e3b6c5c1e3bade833b6b" },
"gitsigns.nvim": { "branch": "main", "commit": "76d88f3b584e1f83b2aa51663a32cc6ee8d97eff" },
"grug-far.nvim": { "branch": "main", "commit": "8e8f3429038d45a6d4144c0642d92f470e5480f3" },
"gruvbox.nvim": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" },
"inc-rename.nvim": { "branch": "main", "commit": "4d00cd5029e99f176128bc37ef245e2dd348191d" },
"kulala.nvim": { "branch": "main", "commit": "d1d2a13ab2751a1c5afa1b6ec9a4270c139000b6" },
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
"lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" },
Expand All @@ -38,7 +38,7 @@
"mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
"mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" },
"neo-tree.nvim": { "branch": "main", "commit": "83222b30a1f35ab90ccb8ae87a835301f438816f" },
"neoconf.nvim": { "branch": "main", "commit": "82fc98b05ad1824b906dc9b4a414f6c096a0310c" },
"neoconf.nvim": { "branch": "main", "commit": "3262e646120c11b7e58dba371d40185d7a5c9588" },
"neogen": { "branch": "main", "commit": "dd0301bfba1f83a3bc009b5430fce7aa3cee6941" },
"neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
"neotest-elixir": { "branch": "master", "commit": "c5067bcc3ec6a0bba7b5694fa15aeb17f16aeb3c" },
Expand Down
2 changes: 2 additions & 0 deletions nvim/lazyvim.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"lazyvim.plugins.extras.dap.core",
"lazyvim.plugins.extras.dap.nlua",
"lazyvim.plugins.extras.editor.dial",
"lazyvim.plugins.extras.editor.inc-rename",
"lazyvim.plugins.extras.editor.mini-files",
"lazyvim.plugins.extras.editor.overseer",
"lazyvim.plugins.extras.editor.snacks_picker",
"lazyvim.plugins.extras.formatting.prettier",
"lazyvim.plugins.extras.lang.angular",
"lazyvim.plugins.extras.lang.astro",
Expand Down
24 changes: 10 additions & 14 deletions nvim/lua/plugins/lualine.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
return {
"nvim-lualine/lualine.nvim",
optional = true,
opts = function(_, opts)
return vim.tbl_deep_extend("force", opts, {
sections = {
lualine_z = {
{
"datetime",
style = " %I:%M %p",
},
},
},
})
end,
"nvim-lualine/lualine.nvim",
optional = true,
opts = function(_, opts)
opts.sections.lualine_z = {
{
"datetime",
style = " %I:%M %p",
},
}
end,
}
66 changes: 33 additions & 33 deletions nvim/lua/plugins/theme.lua
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
return {
-- https://github.com/catppuccin/nvim/discussions/323#discussioncomment-3952454
{
"catppuccin/nvim",
lazy = false,
name = "catppuccin",
opts = {
-- flavour = "frappe",
-- flavour = "macchiato",
flavour = "mocha",
transparent_background = true,
},
},
{
"ellisonleao/gruvbox.nvim",
lazy = false,
opts = {
contrast = "hard",
invert_tabline = false,
inverse = false,
transparent_mode = true,
},
},
{
"folke/tokyonight.nvim",
lazy = false,
opts = {
-- style = "storm",
-- style = "moon",
style = "night",
transparent = true,
},
},
{ "LazyVim/LazyVim", opts = { colorscheme = "gruvbox" } },
-- https://github.com/catppuccin/nvim/discussions/323#discussioncomment-3952454
{
"catppuccin/nvim",
lazy = false,
name = "catppuccin",
opts = {
-- flavour = "frappe",
-- flavour = "macchiato",
flavour = "mocha",
transparent_background = true,
},
},
{
"ellisonleao/gruvbox.nvim",
lazy = false,
opts = {
contrast = "hard",
invert_tabline = false,
inverse = false,
transparent_mode = true,
},
},
{
"folke/tokyonight.nvim",
lazy = false,
opts = {
-- style = "storm",
-- style = "moon",
style = "night",
transparent = true,
},
},
{ "LazyVim/LazyVim", opts = { colorscheme = "gruvbox" } },
}

0 comments on commit ee45126

Please sign in to comment.