mirror of
https://github.com/Crocmagnon/dotfiles.git
synced 2025-04-11 04:06:28 +02:00
Compare commits
2 commits
b3da68c630
...
dec607c6e7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
dec607c6e7 | ||
![]() |
5271832a2c |
17 changed files with 84 additions and 0 deletions
3
dot_config/fish/private_functions/code.fish
Normal file
3
dot_config/fish/private_functions/code.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function code
|
||||||
|
open -a "Visual Studio Code" $argv
|
||||||
|
end
|
5
dot_config/fish/private_functions/corp.fish
Normal file
5
dot_config/fish/private_functions/corp.fish
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function corp
|
||||||
|
set creds (keepassxc-cli show -a username -a password ~/Nextcloud/OVH/keepass.kdbx corp)
|
||||||
|
set -g CORP_USER $creds[1]
|
||||||
|
set -g CORP_PWD $creds[2]
|
||||||
|
end
|
26
dot_config/fish/private_functions/fish_clipboard_copy.fish
Normal file
26
dot_config/fish/private_functions/fish_clipboard_copy.fish
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
function fish_clipboard_copy
|
||||||
|
set -l cmdline
|
||||||
|
if isatty stdin
|
||||||
|
# Copy the current selection, or the entire commandline if that is empty.
|
||||||
|
# Don't use `string collect -N` here - `commandline` adds a newline.
|
||||||
|
set cmdline (commandline --current-selection | string collect)
|
||||||
|
test -n "$cmdline"; or set cmdline (commandline | string collect)
|
||||||
|
else
|
||||||
|
# Read from stdin
|
||||||
|
while read -lz line
|
||||||
|
set -a cmdline $line
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if type -q pbcopy
|
||||||
|
printf '%s' $cmdline | pbcopy
|
||||||
|
else if set -q WAYLAND_DISPLAY; and type -q wl-copy
|
||||||
|
printf '%s' $cmdline | wl-copy
|
||||||
|
else if set -q DISPLAY; and type -q xsel
|
||||||
|
printf '%s' $cmdline | xsel --clipboard
|
||||||
|
else if set -q DISPLAY; and type -q xclip
|
||||||
|
printf '%s' $cmdline | xclip -selection clipboard
|
||||||
|
else if type -q clip.exe
|
||||||
|
printf '%s' $cmdline | clip.exe
|
||||||
|
end
|
||||||
|
end
|
5
dot_config/fish/private_functions/interne.fish
Normal file
5
dot_config/fish/private_functions/interne.fish
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function interne
|
||||||
|
set creds (keepassxc-cli show -a username -a password ~/Nextcloud/OVH/keepass.kdbx Interne)
|
||||||
|
set -U INTERNE_USER $creds[1]
|
||||||
|
set -U INTERNE_PWD $creds[2]
|
||||||
|
end
|
3
dot_config/fish/private_functions/k.fish
Normal file
3
dot_config/fish/private_functions/k.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function k --wraps=kubectl --description 'alias k=kubectl'
|
||||||
|
kubectl $argv;
|
||||||
|
end
|
3
dot_config/fish/private_functions/kbash.fish
Normal file
3
dot_config/fish/private_functions/kbash.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function kbash
|
||||||
|
kubectl bash $argv
|
||||||
|
end
|
3
dot_config/fish/private_functions/kctx.fish
Normal file
3
dot_config/fish/private_functions/kctx.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function kctx --wraps='kubectl ctx'
|
||||||
|
kubectl ctx $argv;
|
||||||
|
end
|
3
dot_config/fish/private_functions/kdjango.fish
Normal file
3
dot_config/fish/private_functions/kdjango.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function kdjango
|
||||||
|
kubectl django $argv
|
||||||
|
end
|
6
dot_config/fish/private_functions/kgetall.fish
Normal file
6
dot_config/fish/private_functions/kgetall.fish
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
function kgetall
|
||||||
|
for i in (kubectl api-resources --verbs=list --namespaced -o name | grep -v "events.events.k8s.io" | grep -v "events" | sort | uniq)
|
||||||
|
echo -e "\nResource:" $i
|
||||||
|
kubectl get $i
|
||||||
|
end
|
||||||
|
end
|
3
dot_config/fish/private_functions/kgpg.fish
Normal file
3
dot_config/fish/private_functions/kgpg.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function kgpg
|
||||||
|
killall gpg-agent;
|
||||||
|
end
|
3
dot_config/fish/private_functions/kjsonlogs.fish
Normal file
3
dot_config/fish/private_functions/kjsonlogs.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function kjsonlogs
|
||||||
|
klogs $argv -o raw | jq -r -R 'fromjson? | select(type == "object") | "\(.timestamp) \(.level) \(.short_message)"'
|
||||||
|
end
|
4
dot_config/fish/private_functions/klogs.fish
Normal file
4
dot_config/fish/private_functions/klogs.fish
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Defined interactively
|
||||||
|
function klogs --wraps="kubectl stern"
|
||||||
|
kubectl stern --tail=50 $argv
|
||||||
|
end
|
3
dot_config/fish/private_functions/kns.fish
Normal file
3
dot_config/fish/private_functions/kns.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function kns --wraps='kubectl ns'
|
||||||
|
kubectl ns $argv;
|
||||||
|
end
|
3
dot_config/fish/private_functions/kpass.fish
Normal file
3
dot_config/fish/private_functions/kpass.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function kpass
|
||||||
|
keepassxc-cli show -sa password ~/Nextcloud2/OVH/keepass.kdbx $argv
|
||||||
|
end
|
3
dot_config/fish/private_functions/sdev.fish
Normal file
3
dot_config/fish/private_functions/sdev.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function sdev
|
||||||
|
ssh sdev -t 'tmux -CC new -A -s tmssh'
|
||||||
|
end
|
5
dot_config/fish/private_functions/stash.fish
Normal file
5
dot_config/fish/private_functions/stash.fish
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function stash
|
||||||
|
set creds (keepassxc-cli show -a username -a password ~/Nextcloud/OVH/keepass.kdbx "Stash token")
|
||||||
|
set -U STASH_USER $creds[1]
|
||||||
|
set -U STASH_PWD $creds[2]
|
||||||
|
end
|
3
dot_config/fish/private_functions/static-server.fish
Normal file
3
dot_config/fish/private_functions/static-server.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function static-server --wraps='go run github.com/eliben/static-server@latest' --description 'alias static-server go run github.com/eliben/static-server@latest'
|
||||||
|
go run github.com/eliben/static-server@latest $argv
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue