Skip to content

Commit

Permalink
fix(wezterm): Use background of active theme for opacity layer.
Browse files Browse the repository at this point in the history
  • Loading branch information
chevcast committed Dec 6, 2024
1 parent 893e517 commit c03278c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 58 deletions.
84 changes: 34 additions & 50 deletions .wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ require("mousemaps")
local wezterm = require("wezterm")
local config = require("config")

local color_schemes = wezterm.get_builtin_color_schemes()
for k, v in pairs(config.color_schemes) do
color_schemes[k] = v
end

-- config.color_scheme = "Tokyo Night Storm"
-- config.color_scheme = "Tokyo Night Moon"
config.color_scheme = "Tokyo Night"
config.color_scheme = "Tokyo Night Moon"
-- config.color_scheme = "Tokyo Night"
-- config.color_scheme = "Catppuccin Frappe"
-- config.color_scheme = "Catppuccin Macchiato"
-- config.color_scheme = "Catppuccin Mocha"
-- config.color_scheme = "Catppuccin Pink Mocha"
-- config.color_scheme = "Gruvbox Dark Hard"
-- config.color_scheme = "GruvboxDarkHard"

config.font_size = 14
config.font = wezterm.font_with_fallback({
Expand Down Expand Up @@ -52,59 +57,38 @@ config.window_close_confirmation = "NeverPrompt"
config.window_decorations = "RESIZE" --"INTEGRATED_BUTTONS|RESIZE"
config.window_padding = { left = 10, right = 10, top = 25, bottom = 10 }

local bgpath = "~/.dotfiles/catbg.png"
if wezterm.target_triple:match("windows") then
config.default_domain = "WSL:Arch"
config.default_cwd = "/home/catdad"
config.win32_system_backdrop = "Disable" -- ["Auto", "Acrylic", "Mica", "Tabbed" "Disable"]
config.background = {
{
source = {
File = "\\\\wsl.localhost\\Arch\\home\\chev\\.dotfiles\\images\\catbg.png",
},
opacity = 1,
attachment = "Fixed",
repeat_x = "NoRepeat",
repeat_y = "NoRepeat",
vertical_align = "Bottom",
horizontal_align = "Center",
height = "Cover",
width = "Cover",
},
{
source = {
Color = "#000000",
},
opacity = 0.85,
width = "100%",
height = "100%",
},
}
bgpath = "\\\\wsl.localhost\\Arch\\home\\chev\\.dotfiles\\images\\catbg.png"
elseif wezterm.target_triple:match("darwin") then
-- OSX Does not like to show desktop backgorund behind fullscreen apps.
-- Set a Wezterm background image instead.
config.background = {
{
source = {
File = "/Users/alexford/.dotfiles/images/catbg.png",
},
opacity = 1,
attachment = "Fixed",
repeat_x = "NoRepeat",
repeat_y = "NoRepeat",
vertical_align = "Bottom",
horizontal_align = "Center",
height = "Cover",
width = "Cover",
bgpath = "/Users/alexford/.dotfiles/images/catbg.png"
end

config.background = {
{
source = {
File = bgpath,
},
{
source = {
Color = "#000000",
},
opacity = 0.85,
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%",
},
}

return config
2 changes: 1 addition & 1 deletion nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"firenvim": { "branch": "master", "commit": "64f9389b88c8b0c7667d45c171a5f25c42d852fb" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"fzf-lua": { "branch": "main", "commit": "9958d6a25d50f42b920664589a90704652169e5e" },
"fzf-lua": { "branch": "main", "commit": "1726049e3724d6499ab12baba5ff082f122a3e88" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"grug-far.nvim": { "branch": "main", "commit": "4b19888719e45ed696d140af2e4e4e3840a5387a" },
"gruvbox.nvim": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" },
Expand Down
11 changes: 4 additions & 7 deletions nvim/lua/plugins/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ return {
{
"catppuccin/nvim",
lazy = false,
priority = 10000,
name = "catppuccin",
opts = {
-- flavour = "frappe",
flavour = "macchiato",
-- flavour = "mocha",
-- flavour = "macchiato",
flavour = "mocha",
transparent_background = true,
-- color_overrides = {
-- mocha = {
Expand All @@ -31,17 +30,15 @@ return {
{
"ellisonleao/gruvbox.nvim",
lazy = false,
priority = 10000,
opts = { contrast = "hard", transparent_mode = true },
},
{
"folke/tokyonight.nvim",
lazy = false,
priority = 10000,
opts = {
-- style = "storm",
-- style = "moon",
style = "night",
style = "moon",
-- style = "night",
transparent = true,
},
},
Expand Down

0 comments on commit c03278c

Please sign in to comment.