Add layout command and two wide window layouts

This commit is contained in:
Kenneth Benzie 2024-10-16 22:40:55 +01:00
parent e5a9f09709
commit 5abb4c4268
5 changed files with 35 additions and 0 deletions

19
install.ps1 Normal file
View File

@ -0,0 +1,19 @@
if (!(Test-Path -PathType Container $env:LOCALAPPDATA\layouts)) {
New-Item -ItemType Directory -Path $env:LOCALAPPDATA\layouts
Write-Output "changed: created directory $env:LOCALAPPDATA\layouts"
}
$layouts = (
'window-wide-right.ps1',
'window-wide-left.ps1'
)
foreach ($layout in $layouts) {
$source = "$env:USERPROFILE\Documents\WindowsPowerShell\layouts\$layout"
$dest = "$env:LOCALAPPDATA\layouts\$layout"
if (!(Test-Path -PathType Leaf $dest) {
New-Item -ItemType SymbolicLink -Path "$dest" -Target "$source"
Write-Output "changed: created symlink $dest"
}
}
}

11
layout.ps1 Normal file
View File

@ -0,0 +1,11 @@
function layout {
param (
[parameter(mandatory=$true)]
[string]$layoutName,
[string]$tabName
)
& $env:LOCALAPPDATA\layouts\$layoutName.ps1
if ($tabName -ne "") {
wezterm.exe cli set-tab-title $tabName
}
}

View File

@ -0,0 +1 @@
wezterm.exe cli split-pane --horizontal --percent 43 --cwd (get-location).path

View File

@ -0,0 +1 @@
wezterm.exe cli split-pane --horizontal --percent 57 --cwd (get-location).path

View File

@ -99,3 +99,6 @@ if ((Get-Command cmake.exe -ErrorAction SilentlyContinue).Source) {
$env:CMAKE_C_COMPILER_LAUNCHER = 'cmake.exe'
$env:CMAKE_CXX_COMPILER_LAUNCHER = 'cmake.exe'
}
# Load plugins
. $PSScriptRoot\layout.ps1