Modified shell-loading-snippets
DockerNetwork support
better l and ll
dot the pipe
This commit is contained in:
lksz 2021-09-06 14:21:51 -04:00
parent 50d9aef264
commit 86fdee1acc
9 changed files with 100 additions and 24 deletions

View File

@ -1 +1 @@
ls
_ll

View File

@ -1 +1 @@
ls
_ll

View File

@ -0,0 +1,4 @@
filter dot([string]$Parameter){ $_ | Select-Object -ExpandProperty $Parameter }
Set-Alias : dot
Set-Alias _ dot

View File

@ -1,13 +1,13 @@
{
"omp": "~/.oh-my-posh.omp.json",
"profile": [
"~/.profile",
"/profile": [
"/etc/profile",
"/etc/profile.d/"
],
"profile": "~/.profile",
"bashrc": "~/.bashrc",
"zshrc": "~/.zshrc",
"zsys": "/etc/zsys.conf",
"/zsys": "/etc/zsys.conf",
"shrc": "~/.shrc",
"sz-aliases-sh": "~/.sz.aliases.sh",
"sz-shrc": [
@ -27,6 +27,7 @@
"@shell-loading-snippets/zsh"
],
"sz-rc-all": [
"#profile",
"#sz-aliases-sh",
"#sz-local-rc",
"#sz-shrc",
@ -34,7 +35,7 @@
"#zshrc"
],
"sz-local-rc": "~/.sz.local.sh",
"ansible": [
"/ansible": [
"/etc/ansible/ansible.cfg",
"/opt/ansible/ansible.cfg",
"/opt/ansible/hosts"
@ -67,6 +68,6 @@
"ssh-auth": "~/.ssh/authorized_keys",
"ssh-known": "~/.ssh/known_hosts",
"ssh-conf": "~/.ssh/config",
"sshd-conf": "/etc/ssh/sshd_config",
"/sshd-conf": "/etc/ssh/sshd_config",
"ssh" : [ "#ssh-auth", "#ssh-known", "#ssh-conf", "#sshd-conf", "#ssh-pub", "#ssh-id" ]
}

View File

@ -0,0 +1,12 @@
[CmdletBinding()]param()
$(docker network ls -q) |
ForEach-Object {
$local:tmpObj = docker inspect $_ | ConvertFrom-Json |
Select-Object *,@{L='Subnet';E={$_.IPAM.Config[0].Subnet}}
$tmpObj.PSObject.TypeNames.Insert(0,"DockerNetworksOutput")
$tmpObj
} # | Format-Table @{E='Id';W=12},Name,Driver,Scope,Subnet

View File

@ -69,5 +69,32 @@ PortBindings</Label> </TableColumnHeader>
</TableControl>
</View>
<View>
<Name>lsdn</Name>
<ViewSelectedBy>
<TypeName>DockerNetworksOutput</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader> <Width>13</Width> <Label>Id</Label> </TableColumnHeader>
<TableColumnHeader> <Width>27</Width> <Label>Name</Label> </TableColumnHeader>
<TableColumnHeader> <Width>8</Width> <Label>Driver</Label> </TableColumnHeader>
<TableColumnHeader> <Width>8</Width> <Label>Scope</Label> </TableColumnHeader>
<TableColumnHeader> <Width>40</Width> <Label>Subnet</Label> </TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<Wrap/>
<TableColumnItems>
<TableColumnItem> <ScriptBlock>$_.Id -replace '^(.{12}).*$','$1…'</ScriptBlock> </TableColumnItem>
<TableColumnItem> <PropertyName>Name</PropertyName> </TableColumnItem>
<TableColumnItem> <PropertyName>Driver</PropertyName> </TableColumnItem>
<TableColumnItem> <PropertyName>Scope</PropertyName> </TableColumnItem>
<TableColumnItem> <PropertyName>Subnet</PropertyName> </TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>

View File

@ -1,6 +1,14 @@
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; snippet/bash" >> /tmp/default_shell
## Place the following line at the top of your .zshrc to make powershell your default shell.
## __P=".local/share/powershell/Scripts/shell-loading-snippets/$(basename $SHELL)"; find ~/$__P -exec true \; && . ~/$__P
function PowerShellLauncher() {
export SZ_POWERSHELL_LAUNCER_CALLED=1
[[ $- != *i* ]] && return
if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then
PWSH='~/.dotnet/tools/pwsh'
alias pwsh="$PWSH "
@ -22,3 +30,6 @@ if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then
fi
echo "continue" >> /tmp/default_shell
export SZ_SKIP_DEFAULT_SHELL=1
}
[[ "$SZ_POWERSHELL_LAUNCER_CALLED" != "1" ]] && PowerShellLauncher

View File

@ -1,6 +1,14 @@
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; snippet/sh" >> /tmp/default_shell
## Place the following line at the top of your .zshrc to make powershell your default shell.
## __P=".local/share/powershell/Scripts/shell-loading-snippets/$(basename $SHELL)"; find ~/$__P -exec true \; && . ~/$__P
function PowerShellLauncher() {
export SZ_POWERSHELL_LAUNCER_CALLED=1
[[ $- != *i* ]] && return
if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then
PWSH='~/.dotnet/tools/pwsh'
alias pwsh="$PWSH "
@ -22,3 +30,6 @@ if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then
fi
echo "continue" >> /tmp/default_shell
export SZ_SKIP_DEFAULT_SHELL=1
}
[[ "$SZ_POWERSHELL_LAUNCER_CALLED" != "1" ]] && PowerShellLauncher

View File

@ -1,25 +1,35 @@
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; snippet/zsh" >> /tmp/default_shell
## Place the following line at the top of your .zshrc to make powershell your default shell.
## __P=".local/share/powershell/Scripts/shell-loading-snippets/$(basename $SHELL)"; find ~/$__P -exec true \; && . ~/$__P
function PowerShellLauncher() {
if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then
PWSH='~/.dotnet/tools/pwsh'
alias pwsh="$PWSH "
export SZ_POWERSHELL_LAUNCER_CALLED=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
fi
[[ $- != *i* ]] && return
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-ScriptEnv: $(ls ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1) " >> /tmp/default_shell
if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then
export SZ_SKIP_DEFAULT_SHELL=1
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1 ]]; then
echo 'Starting PowerShell SZcripts...'
echo "pwsh" >> /tmp/default_shell
pwsh
if [[ ! -f /tmp/keep_shell_after_pwsh ]]; then
exit
if [[ -x ~/.dotnet/tools/pwsh && "1" != "$(which pwsh > /dev/null && echo 1)" ]]; then
PWSH='~/.dotnet/tools/pwsh'
alias pwsh="$PWSH "
export DOTNET_CLI_TELEMETRY_OPTOUT=1
fi
echo "$(date) SZ_SKIP_DEFAULT_SHELL='$SZ_SKIP_DEFAULT_SHELL'; pwsh: $(which pwsh); Setup-ScriptEnv: $(ls ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1) " >> /tmp/default_shell
if [[ "$SZ_SKIP_DEFAULT_SHELL" != "1" ]]; then
export SZ_SKIP_DEFAULT_SHELL=1
if [[ "1" == "$(which pwsh > /dev/null && echo 1)" && -f ~/.local/share/powershell/Scripts/Setup-ScriptEnv.ps1 ]]; then
echo 'Starting PowerShell SZcripts...'
echo "pwsh" >> /tmp/default_shell
pwsh
if [[ ! -f /tmp/keep_shell_after_pwsh ]]; then
exit
fi
fi
fi
fi
echo "continue" >> /tmp/default_shell
export SZ_SKIP_DEFAULT_SHELL=1
echo "continue" >> /tmp/default_shell
export SZ_SKIP_DEFAULT_SHELL=1
}
[[ "$SZ_POWERSHELL_LAUNCER_CALLED" != "1" ]] && PowerShellLauncher