mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
🪟: Add pathlib, PowerShell Password Script
This commit is contained in:
parent
684f694d23
commit
1a0f4a01a4
3 changed files with 81 additions and 29 deletions
19
pathlib.json
Normal file
19
pathlib.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
".bashrc": "~/.bashrc",
|
||||||
|
".zshrc": "~/.zshrc",
|
||||||
|
"nvim/": "~/.config/nvim/",
|
||||||
|
".condarc": "~/.condarc",
|
||||||
|
".gitconfig": "~/.gitconfig",
|
||||||
|
".ideavimrc": "~/.ideavimrc",
|
||||||
|
"pip.conf": "~/.config/pip/pip.conf",
|
||||||
|
".npmrc": "~/.npmrc",
|
||||||
|
"Microsoft.PowerShell_profile.ps1": {
|
||||||
|
"Mac": "~/.config/powershell/Microsoft.PowerShell_profile.ps1",
|
||||||
|
"Windows": "~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1"
|
||||||
|
},
|
||||||
|
".wslconfig": "~/.wslconfig",
|
||||||
|
"neovide.toml": {
|
||||||
|
"Mac": "~/.config/neovide/neovide.toml",
|
||||||
|
"Windows": "~/AppData/Local/neovide/neovide.toml"
|
||||||
|
}
|
||||||
|
}
|
||||||
33
powershell/bw.ps1
Normal file
33
powershell/bw.ps1
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
function Get-Password {
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Name,
|
||||||
|
[Boolean]$Hidden = $true
|
||||||
|
)
|
||||||
|
$result = (bw list items --search $Name | ConvertFrom-Json).login | Select-Object -Property username, password
|
||||||
|
if ($result.Length -eq 0) {
|
||||||
|
Write-Host -ForegroundColor Red "No password found"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
elseif ($result.Length -gt 1) {
|
||||||
|
Write-Host -ForegroundColor Red "More than one password found, please specify"
|
||||||
|
$counter = 0
|
||||||
|
foreach ($username in $result.username) {
|
||||||
|
Write-Host "["$counter "]" $username
|
||||||
|
$counter++
|
||||||
|
}
|
||||||
|
$selector = Read-Host -MaskInput "Select the username"
|
||||||
|
if ($result[$selector] -eq "") {
|
||||||
|
Write-Host -ForegroundColor Red "Invalid selection"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$result = $result[$selector]
|
||||||
|
}
|
||||||
|
if ($Hidden) {
|
||||||
|
Write-Host -ForegroundColor Green "Password copied to clipboard"
|
||||||
|
Set-Clipboard -Value $result.password
|
||||||
|
} else {
|
||||||
|
Write-Host $result
|
||||||
|
}
|
||||||
|
return $result
|
||||||
|
}
|
||||||
|
|
@ -3,14 +3,6 @@
|
||||||
"$schema": "https://aka.ms/terminal-profiles-schema",
|
"$schema": "https://aka.ms/terminal-profiles-schema",
|
||||||
"actions":
|
"actions":
|
||||||
[
|
[
|
||||||
{
|
|
||||||
"command":
|
|
||||||
{
|
|
||||||
"action": "copy",
|
|
||||||
"singleLine": false
|
|
||||||
},
|
|
||||||
"keys": "ctrl+c"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"command": "unbound",
|
"command": "unbound",
|
||||||
"keys": "alt+shift+plus"
|
"keys": "alt+shift+plus"
|
||||||
|
|
@ -47,6 +39,22 @@
|
||||||
"command": "unbound",
|
"command": "unbound",
|
||||||
"keys": "alt+shift+left"
|
"keys": "alt+shift+left"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command":
|
||||||
|
{
|
||||||
|
"action": "copy",
|
||||||
|
"singleLine": false
|
||||||
|
},
|
||||||
|
"keys": "ctrl+c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command":
|
||||||
|
{
|
||||||
|
"action": "moveFocus",
|
||||||
|
"direction": "up"
|
||||||
|
},
|
||||||
|
"keys": "ctrl+k"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "paste",
|
"command": "paste",
|
||||||
"keys": "ctrl+v"
|
"keys": "ctrl+v"
|
||||||
|
|
@ -60,12 +68,8 @@
|
||||||
"keys": "ctrl+shift+k"
|
"keys": "ctrl+shift+k"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command":
|
"command": "find",
|
||||||
{
|
"keys": "ctrl+shift+f"
|
||||||
"action": "moveFocus",
|
|
||||||
"direction": "up"
|
|
||||||
},
|
|
||||||
"keys": "ctrl+k"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command":
|
"command":
|
||||||
|
|
@ -75,10 +79,6 @@
|
||||||
},
|
},
|
||||||
"keys": "ctrl+shift+h"
|
"keys": "ctrl+shift+h"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"command": "find",
|
|
||||||
"keys": "ctrl+shift+f"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"command":
|
"command":
|
||||||
{
|
{
|
||||||
|
|
@ -88,14 +88,6 @@
|
||||||
},
|
},
|
||||||
"keys": "alt+shift+d"
|
"keys": "alt+shift+d"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"command":
|
|
||||||
{
|
|
||||||
"action": "moveFocus",
|
|
||||||
"direction": "down"
|
|
||||||
},
|
|
||||||
"keys": "ctrl+j"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"command":
|
"command":
|
||||||
{
|
{
|
||||||
|
|
@ -104,6 +96,14 @@
|
||||||
},
|
},
|
||||||
"keys": "alt+shift+/"
|
"keys": "alt+shift+/"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command":
|
||||||
|
{
|
||||||
|
"action": "moveFocus",
|
||||||
|
"direction": "down"
|
||||||
|
},
|
||||||
|
"keys": "ctrl+j"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command":
|
"command":
|
||||||
{
|
{
|
||||||
|
|
@ -159,8 +159,8 @@
|
||||||
{
|
{
|
||||||
"face": "CaskaydiaCove Nerd Font"
|
"face": "CaskaydiaCove Nerd Font"
|
||||||
},
|
},
|
||||||
"opacity": 95,
|
"opacity": 100,
|
||||||
"useAcrylic": true
|
"useAcrylic": false
|
||||||
},
|
},
|
||||||
"list":
|
"list":
|
||||||
[
|
[
|
||||||
|
|
@ -171,7 +171,7 @@
|
||||||
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
|
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
|
||||||
"hidden": false,
|
"hidden": false,
|
||||||
"name": "PowerShell",
|
"name": "PowerShell",
|
||||||
"opacity": 30,
|
"opacity": 100,
|
||||||
"scrollbarState": "hidden",
|
"scrollbarState": "hidden",
|
||||||
"source": "Windows.Terminal.PowershellCore",
|
"source": "Windows.Terminal.PowershellCore",
|
||||||
"useAcrylic": true
|
"useAcrylic": true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue