Skip to content

Commit

Permalink
add wezterm ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry committed Feb 6, 2024
1 parent b54bbdb commit 8c837b9
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function Start-AdminSession {
.SYNOPSIS
Starts a new PowerShell session with elevated rights. Alias: su
#>
Start-Process wt -Verb runAs -ArgumentList "pwsh.exe -NoExit -Command &{Set-Location $PWD}"
Start-Process wezterm -Verb runAs -WindowStyle Hidden -ArgumentList "start --cwd $PWD"
}

function Update-Profile {
Expand All @@ -121,7 +121,7 @@ function Update-Profile {
git pull | Out-Null

Write-Verbose "Rerunning setup script to capture any new dependencies."
Start-Process pwsh -Verb runAs -WorkingDirectory $PWD -ArgumentList "-Command .\Setup.ps1"
Start-Process wezterm -Verb runAs -WindowStyle Hidden -ArgumentList "start --cwd $PWD pwsh -Command .\Setup.ps1"

Write-Verbose "Reverting to previous working directory"
Set-Location $currentWorkingDirectory
Expand All @@ -136,7 +136,7 @@ function Update-Software {
Updates all software installed via Winget & Chocolatey. Alias: us
#>
Write-Verbose "Updating software installed via Winget & Chocolatey"
Start-Process wt -Verb runAs -ArgumentList "pwsh.exe -Command &{winget upgrade --all && choco upgrade all -y}"
Start-Process wezterm -Verb runAs -WindowStyle Hidden -ArgumentList "start -- pwsh -Command &{winget upgrade --all && choco upgrade all -y}"
$ENV:UpdatesPending = ''
}

Expand Down
4 changes: 4 additions & 0 deletions Setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $symlinks = @{
"$HOME\.gitconfig" = ".\.gitconfig"
"$HOME\AppData\Roaming\lazygit" = ".\lazygit"
"$HOME\AppData\Roaming\AltSnap\AltSnap.ini" = ".\altsnap\AltSnap.ini"
"$ENV:PROGRAMFILES\WezTerm\wezterm_modules" = ".\wezterm\"
}

# Winget & choco dependencies
Expand Down Expand Up @@ -74,6 +75,9 @@ if (Test-Path "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Pro
Remove-Item "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Neovim\" -Recurse -Force
}

# Persist Environment Variables
[System.Environment]::SetEnvironmentVariable('WEZTERM_CONFIG_FILE', "$PSScriptRoot\wezterm\wezterm.lua", [System.EnvironmentVariableTarget]::User)

$currentGitEmail = (git config --global user.email)
$currentGitName = (git config --global user.name)

Expand Down
18 changes: 18 additions & 0 deletions wezterm/cyberdream.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
return {
foreground = "#ffffff",
background = "#16181a",

cursor_bg = "#ffffff",
cursor_fg = "#ffffff",
cursor_border = "#ffffff",

selection_fg = "#ffffff",
selection_bg = "#3c4048",

scrollbar_thumb = "#16181a",
split = "#16181a",

ansi = { "#16181a", "#ff6e5e", "#5eff6c", "#f1ff5e", "#5ea1ff", "#bd5eff", "#5ef1ff", "#ffffff" },
brights = { "#3c4048", "#ff6e5e", "#5eff6c", "#f1ff5e", "#5ea1ff", "#bd5eff", "#5ef1ff", "#ffffff" },
indexed = { [16] = "#ffbd5e", [17] = "#ff6e5e" },
}
32 changes: 32 additions & 0 deletions wezterm/wezterm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- Initialize Configuration
local wezterm = require("wezterm")
local config = wezterm.config_builder()

-- Font
config.font = wezterm.font("JetBrainsMono Nerd Font")
config.font_size = 10

-- Window
config.initial_rows = 38
config.initial_cols = 150
config.enable_tab_bar = false
config.window_decorations = "RESIZE"
config.window_background_opacity = 0.75
config.win32_system_backdrop = "Acrylic"
config.max_fps = 144
config.animation_fps = 60
config.cursor_blink_rate = 250

-- Colors
config.colors = require("cyberdream")

-- Shell
config.default_prog = { "pwsh", "-NoLogo" }

-- Keybindings
config.keys = {
-- Remap paste for clipboard history compatibility
{ key = "v", mods = "CTRL", action = wezterm.action({ PasteFrom = "Clipboard" }) },
}

return config

0 comments on commit 8c837b9

Please sign in to comment.