Compare commits
2 Commits
89b70ac02e
...
97ca66bd07
| Author | SHA1 | Date | |
|---|---|---|---|
|
97ca66bd07
|
|||
|
0d730db906
|
@@ -5,7 +5,7 @@ Import-Module Catppuccin
|
|||||||
$Flavor = $Catppuccin['Mocha']
|
$Flavor = $Catppuccin['Mocha']
|
||||||
Import-Module -Name Microsoft.WinGet.CommandNotFound
|
Import-Module -Name Microsoft.WinGet.CommandNotFound
|
||||||
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
|
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
|
||||||
Invoke-Expression (& { (zoxide init powershell | Out-String ) })
|
Invoke-Expression (& { (zoxide init --cmd cd powershell | Out-String ) })
|
||||||
|
|
||||||
# The following colors are used by PowerShell's formatting
|
# The following colors are used by PowerShell's formatting
|
||||||
# Again PS 7.2+ only
|
# Again PS 7.2+ only
|
||||||
@@ -31,29 +31,65 @@ $ENV:EDITOR="nvim"
|
|||||||
set-alias -Name emacs -Value 'runemacs.exe -nw'
|
set-alias -Name emacs -Value 'runemacs.exe -nw'
|
||||||
Set-PSReadlineOption -Colors $Colors
|
Set-PSReadlineOption -Colors $Colors
|
||||||
$ENV:YAZI_FILE_ONE = 'C:\Program Files\Git\usr\bin\file.exe'
|
$ENV:YAZI_FILE_ONE = 'C:\Program Files\Git\usr\bin\file.exe'
|
||||||
function y (){
|
function y ()
|
||||||
|
{
|
||||||
$tmp = [System.IO.Path]::GetTempFileName()
|
$tmp = [System.IO.Path]::GetTempFileName()
|
||||||
yazi $args --cwd-file="$tmp"
|
yazi $args --cwd-file="$tmp"
|
||||||
$cwd = Get-Content -Path $tmp -Encoding UTF8
|
$cwd = Get-Content -Path $tmp -Encoding UTF8
|
||||||
if ( -not [String]::IsNullOrEmpty($cwd) -and $cwd -ne $PWD.Path) {
|
if ( -not [String]::IsNullOrEmpty($cwd) -and $cwd -ne $PWD.Path)
|
||||||
|
{
|
||||||
Set-Location -LiteralPath ([System.IO.Path]::GetFullPath($cwd))
|
Set-Location -LiteralPath ([System.IO.Path]::GetFullPath($cwd))
|
||||||
}
|
}
|
||||||
|
|
||||||
Remove-Item -Path $tmp
|
Remove-Item -Path $tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
function Watch {
|
function Watch
|
||||||
|
{
|
||||||
param (
|
param (
|
||||||
[ScriptBlock]$Function,
|
[ScriptBlock]$Function,
|
||||||
[int]$Time = 2
|
[int]$Time = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
while ($true) {
|
while ($true)
|
||||||
|
{
|
||||||
Clear-Host
|
Clear-Host
|
||||||
& $Function
|
& $Function
|
||||||
Start-Sleep -Seconds $Time
|
Start-Sleep -Seconds $Time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function prompt
|
||||||
|
{
|
||||||
|
# Get IP info
|
||||||
|
$ipv4=Get-CimInstance -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=$true | Select-Object -ExpandProperty IPAddress | Select-String 192.*
|
||||||
|
$ipv4 = ($ipv4 | ForEach-Object { $_.ToString().Trim() }) -join ','
|
||||||
|
$ipv4Label = ''
|
||||||
|
if (-not $ipv4)
|
||||||
|
{
|
||||||
|
$ipv4Label= "IP N/A"
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
$ipv4Label= "IP $ipv4"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get Git branch if available
|
||||||
|
$gitBranch = ''
|
||||||
|
if (git rev-parse --is-inside-work-tree 2>$null)
|
||||||
|
{
|
||||||
|
$currentBranch = git rev-parse --abbrev-ref HEAD
|
||||||
|
$gitBranch = "GIT: $currentBranch"
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentLocation=$executionContext.SessionState.Path.CurrentLocation
|
||||||
|
|
||||||
|
# default prompt
|
||||||
|
"[$ipv4Label $gitBranch ]`n$currentLocation@$Env:COMPUTERNAME $('(PS [>_])$' * ($nestedPromptLevel + 1)) ";
|
||||||
|
}
|
||||||
|
|
||||||
|
set-alias -Name lg -Value lazygit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
podman completion powershell | Out-string | Invoke-Expression
|
podman completion powershell | Out-string | Invoke-Expression
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
-- pull in the wezterm API
|
-- pull in the wezterm API
|
||||||
local wezterm = require('wezterm')
|
local wezterm = require('wezterm')
|
||||||
|
config = wezterm.config_builder()
|
||||||
|
|
||||||
require "theme"
|
require "theme"
|
||||||
require "keys"
|
require "keys"
|
||||||
|
|
||||||
-- This will hold the configuration
|
|
||||||
local config = wezterm.config_builder()
|
|
||||||
|
|
||||||
config.enable_tab_bar = false
|
config.enable_tab_bar = false
|
||||||
-- The most common triples are:
|
-- The most common triples are:
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
local wezterm = require 'wezterm'
|
local wezterm = require 'wezterm'
|
||||||
config.window_decorations = "INTEGRATED_BUTTONS | TITLE | RESIZE"
|
|
||||||
|
|
||||||
config.colors = { background = "#1e1e2e" }
|
config.colors = { background = "#1e1e2e" }
|
||||||
config.color_scheme = 'Catppuccin Mocha'
|
config.color_scheme = 'Catppuccin Mocha'
|
||||||
config.window_background_opacity = 0.9
|
config.window_background_opacity = 0.9
|
||||||
|
|
||||||
|
|
||||||
|
if wezterm.target_triple == 'x86_64-pc-windows-msvc' then
|
||||||
|
config.window_decorations = "TITLE | RESIZE"
|
||||||
|
else
|
||||||
config.window_decorations = "INTEGRATED_BUTTONS | TITLE | RESIZE"
|
config.window_decorations = "INTEGRATED_BUTTONS | TITLE | RESIZE"
|
||||||
|
end
|
||||||
|
|
||||||
config.window_frame = {
|
config.window_frame = {
|
||||||
font = wezterm.font { family = 'Roboto', weight = 'Bold' },
|
font = wezterm.font { family = 'Roboto', weight = 'Bold' },
|
||||||
font_size = 12,
|
font_size = 12,
|
||||||
|
|||||||
Reference in New Issue
Block a user