feat(glazewm): Change Windows TWM to GlazeWM

This commit is contained in:
js0ny 2025-01-05 21:14:28 +00:00
parent 4657765e21
commit 22ca99086c
16 changed files with 999 additions and 253 deletions

View file

@ -2,9 +2,19 @@ function Invoke-Completion {
param ([string]$command)
switch ($command) {
'docker' { docker completion powershell | Out-String | Invoke-Expression }
'dotnet' {
# https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#powershell
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
dotnet complete --position $cursorPosition "$commandAst" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
}
'git' { Import-Module Posh-Git }
'hugo' { hugo completion powershell | Out-String | Invoke-Expression }
'pip' { pip completion --powershell | Out-String | Invoke-Expression }
'rg' { rg --generate complete-powershell | Out-String | Invoke-Expression }
'uv' { uv generate-shell-completion powershell | Out-String | Invoke-Expression }
'wezterm' { wezterm shell-completion --shell power-shell | Out-String | Invoke-Expression }
'winget' {
@ -26,7 +36,7 @@ Set-Alias "icmp" "Invoke-Completion"
Register-ArgumentCompleter -CommandName Invoke-Completion -ParameterName 'command' -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
$cmds = @('docker', 'git', 'hugo', 'pip', 'uv', 'wezterm', 'winget')
$cmds = @('docker', 'dotnet', 'git', 'hugo', 'pip', 'rg', 'uv', 'wezterm', 'winget')
$cmds | Where-Object { $_ -like "$wordToComplete*" }
}

View file

@ -1,18 +1,8 @@
# Use XDG Base Directory Specification and its similar structure for Windows
# wget
if (Get-Command wget -ErrorAction SilentlyContinue) {
${function:wget} = {wget --hsts-file $XDG_CACHE_HOME/wget-hsts $args}
}
# yarn v1
if (Get-Command yarn -ErrorAction SilentlyContinue) {
${function:yarn} = {yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config.yaml $args}
}
if ($Env:WEZTERM) { # Environment variable injected by wezterm/wezterm.lua
${function:icat} = {wezterm imgcat $args}
if ($Env:WEZTERM) {
# Environment variable injected by wezterm/wezterm.lua
${function:icat} = { wezterm imgcat $args }
}
elseif ($Env:KITTY) {
${function:icat} = {kitty +kitten icat $args}
${function:icat} = { kitty +kitten icat $args }
}