[Update] bulk update
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
function __ssh_agent_is_started -d "check if ssh agent is already started"
|
||||
if test -n "$SSH_CONNECTION"
|
||||
# This is an SSH session
|
||||
ssh-add -l > /dev/null 2>&1
|
||||
if test $status -eq 0 -o $status -eq 1
|
||||
# An SSH agent was forwarded
|
||||
return 0
|
||||
end
|
||||
end
|
||||
if test -n "$SSH_CONNECTION"
|
||||
# This is an SSH session
|
||||
ssh-add -l >/dev/null 2>&1
|
||||
if test $status -eq 0 -o $status -eq 1
|
||||
# An SSH agent was forwarded
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
if begin; test -f "$SSH_ENV"; and test -z "$SSH_AGENT_PID"; end
|
||||
source $SSH_ENV > /dev/null
|
||||
end
|
||||
if begin
|
||||
test -f "$SSH_ENV"; and test -z "$SSH_AGENT_PID"
|
||||
end
|
||||
source $SSH_ENV >/dev/null
|
||||
end
|
||||
|
||||
if test -z "$SSH_AGENT_PID"
|
||||
return 1
|
||||
end
|
||||
if test -z "$SSH_AGENT_PID"
|
||||
return 1
|
||||
end
|
||||
|
||||
ssh-add -l > /dev/null 2>&1
|
||||
if test $status -eq 2
|
||||
return 1
|
||||
end
|
||||
ssh-add -l >/dev/null 2>&1
|
||||
if test $status -eq 2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function __ssh_agent_start -d "start a new ssh agent"
|
||||
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
|
||||
chmod 600 $SSH_ENV
|
||||
source $SSH_ENV > /dev/null
|
||||
ssh-agent -c | sed 's/^echo/#echo/' >$SSH_ENV
|
||||
chmod 600 $SSH_ENV
|
||||
source $SSH_ENV >/dev/null
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
function ask --description 'answer from cht.sh'
|
||||
curl -s https://cht.sh/$(string join '+' $argv[1..])
|
||||
function ask --description 'answer from cht.sh'
|
||||
curl -s https://cht.sh/$(string join '+' $argv[1..])
|
||||
end
|
||||
|
||||
@@ -15,4 +15,3 @@ function bind_M_n_history
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
function clis --description 'fzf select cli'
|
||||
eval (cat $HOME/.config/misc/clis.txt | command fzf --multi)
|
||||
# one eval per selection — a single eval of the joined lines would run the
|
||||
# first command with the other selections as its arguments
|
||||
for cmd in (cat $HOME/.config/misc/clis.txt | command fzf --multi)
|
||||
eval $cmd
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ function copy-commandline
|
||||
else if type -q wl-copy
|
||||
echo -n "$cmd" | wl-copy
|
||||
end
|
||||
|
||||
|
||||
# Provide brief visual feedback in the prompt
|
||||
set -l original_cmd (commandline)
|
||||
commandline -r "Copied!"
|
||||
|
||||
@@ -7,8 +7,10 @@ function kp
|
||||
read -s -P "Enter db password: " pass
|
||||
echo ""
|
||||
|
||||
set -l entry (echo $pass | keepassxc-cli ls -q -R $KP_DB | fzf)
|
||||
# -f flattens to full paths; without it nested entries are printed indented and
|
||||
# without their group prefix, so `clip` can't find them. Group lines end in "/".
|
||||
set -l entry (printf '%s\n' $pass | keepassxc-cli ls -q -R -f $KP_DB | string match -v '*/' | fzf | string trim)
|
||||
if test -n "$entry"
|
||||
echo $pass | keepassxc-cli clip -q $KP_DB $entry 0
|
||||
printf '%s\n' $pass | keepassxc-cli clip -q $KP_DB $entry 0
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
function lk --description 'linux knowledge'
|
||||
set -l DB "$HOME/projects/dmz/soft/lk/db.rec"
|
||||
set -l passes 0
|
||||
set -l count 0
|
||||
set -l query ""
|
||||
function lk --description 'linux knowledge'
|
||||
set -l DB "$HOME/projects/dmz/soft/lk/db.rec"
|
||||
set -l passes 0
|
||||
set -l count 0
|
||||
set -l query ""
|
||||
|
||||
while test $passes -lt 2; and test $count -eq 0
|
||||
set query (recsel "$DB" -p aim,tag | recsel -iq "$query" -CP aim,tag | sort -u | fzf --preview="recsel \"$DB\" -e \"aim~{}\" | bat")
|
||||
if test -n "$query"
|
||||
set count (recsel "$DB" -q "$query" -c)
|
||||
end
|
||||
set passes (math $passes + 1)
|
||||
end
|
||||
while test $passes -lt 2; and test $count -eq 0
|
||||
set query (recsel "$DB" -p aim,tag | recsel -iq "$query" -CP aim,tag | sort -u | fzf --preview="recsel \"$DB\" -e \"aim~{}\" | bat")
|
||||
if test -n "$query"
|
||||
set count (recsel "$DB" -q "$query" -c)
|
||||
end
|
||||
set passes (math $passes + 1)
|
||||
end
|
||||
|
||||
if test $count -eq 1
|
||||
recsel "$DB" -q "$query" | recfmt -f "$HOME/projects/dmz/soft/lk/lists.fmt" | less
|
||||
end
|
||||
if test $count -eq 1
|
||||
recsel "$DB" -q "$query" | recfmt -f "$HOME/projects/dmz/soft/lk/lists.fmt" | less
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
function opencodes --description 'contained opencode'
|
||||
bwrap \
|
||||
--unshare-all \
|
||||
--new-session \
|
||||
--clearenv \
|
||||
--die-with-parent \
|
||||
--share-net \
|
||||
--dev /dev \
|
||||
--proc /proc \
|
||||
--ro-bind /usr /usr \
|
||||
--ro-bind /lib /lib \
|
||||
--ro-bind /lib64 /lib64 \
|
||||
--ro-bind /bin /bin \
|
||||
--ro-bind /etc /etc \
|
||||
--ro-bind ~/.config/opencode ~/.config/opencode \
|
||||
--tmpfs /tmp/node-compile-cache \
|
||||
--bind ~/.local/state/opencode ~/.local/state/opencode \
|
||||
--bind ~/.local/share/opencode ~/.local/share/opencode \
|
||||
--bind "$(pwd)" "$(pwd)" \
|
||||
opencode
|
||||
function opencodes --description 'contained opencode'
|
||||
bwrap \
|
||||
--unshare-all \
|
||||
--new-session \
|
||||
--clearenv \
|
||||
--die-with-parent \
|
||||
--share-net \
|
||||
--dev /dev \
|
||||
--proc /proc \
|
||||
--ro-bind /usr /usr \
|
||||
--ro-bind /lib /lib \
|
||||
--ro-bind /lib64 /lib64 \
|
||||
--ro-bind /bin /bin \
|
||||
--ro-bind /etc /etc \
|
||||
--ro-bind ~/.config/opencode ~/.config/opencode \
|
||||
--tmpfs /tmp/node-compile-cache \
|
||||
--bind ~/.local/state/opencode ~/.local/state/opencode \
|
||||
--bind ~/.local/share/opencode ~/.local/share/opencode \
|
||||
--bind "$(pwd)" "$(pwd)" \
|
||||
opencode
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
function tuis --description 'fzf select tui'
|
||||
eval (cat $HOME/.config/misc/tuis.txt | command fzf --multi)
|
||||
# one eval per selection — a single eval of the joined lines would run the
|
||||
# first command with the other selections as its arguments
|
||||
for cmd in (cat $HOME/.config/misc/tuis.txt | command fzf --multi)
|
||||
eval $cmd
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user