PowerShell_Scripts/base.linux/profile.d/env.ps1

23 lines
724 B
PowerShell

# Setting some defaults based on
# FreeDesktop.org's XDG Base Directory Specification document:
# https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html
if( -not (Test-Path env:XDG_DATA_HOME) ) {
$env:XDG_DATA_HOME="$HOME/.local/share"
}
if( -not (Test-Path env:XDG_CONFIG_HOME) ) {
$env:XDG_CONFIG_HOME="$HOME/.config"
}
if( -not (
Test-Path env:SHELL_PARENT
) -and -not (
$env:SHELL -match 'p(wsh|owershell)$'
) -and (
Test-Path env:SHELL
)
) {
$env:COMPLETION_SHELL_PREFERENCE = $env:SHELL
$env:SHELL_PARENT = $env:SHELL
}
$env:SHELL = Get-Process -Id $PID | Select-Object -ExpandProperty Path
Set-UnixCompleter -Shell $env:COMPLETION_SHELL_PREFERENCE