Merge branch 'master' of github.com:ohmyzsh/ohmyzsh

This commit is contained in:
AdminatComposeDAO 2025-06-29 11:31:38 -07:00
commit f601b5e934
5 changed files with 37 additions and 18 deletions

View file

@ -30,7 +30,7 @@ dependencies:
plugins/wd:
repo: mfaerevaag/wd
branch: master
version: tag:v0.10.0
version: tag:v0.10.1
precopy: |
set -e
rm -r test

View file

@ -29,9 +29,24 @@ function rbwpw {
echo "$service not found"
return 1
fi
# Generate a random identifier for this call to rbwpw
# so we can check if the clipboard content has changed
local _random="$RANDOM" _cache="$ZSH_CACHE_DIR/.rbwpw"
echo -n "$_random" > "$_cache"
# Use clipcopy to copy the password to the clipboard
echo -n $pw | clipcopy
echo "password for $service copied!"
{sleep 20 && clipcopy </dev/null 2>/dev/null} &|
# Clear the clipboard after 20 seconds, but only if the clipboard hasn't
# changed (if rbwpw hasn't been called again)
{
sleep 20 \
&& [[ "$(<"$_cache")" == "$_random" ]] \
&& clipcopy </dev/null 2>/dev/null \
&& command rm -f "$_cache" &>/dev/null
} &|
}
function _rbwpw {

View file

@ -65,12 +65,9 @@ Add the following to your `home.nix` then run `home-manager switch`:
programs.zsh.plugins = [
{
name = "wd";
src = pkgs.fetchFromGitHub {
owner = "mfaerevaag";
repo = "wd";
rev = "v0.5.2";
sha256 = "sha256-4yJ1qhqhNULbQmt6Z9G22gURfDLe30uV1ascbzqgdhg=";
};
src = pkgs.zsh-wd;
file = "share/wd/wd.plugin.zsh";
completions = [ "share/zsh/site-functions" ];
}
];
```

View file

@ -8,7 +8,7 @@
# @github.com/mfaerevaag/wd
# version
readonly WD_VERSION=0.10.0
readonly WD_VERSION=0.10.1
# colors
readonly WD_BLUE="\033[96m"
@ -174,6 +174,11 @@ wd_add()
point=$(basename "$PWD")
fi
if [ ! -w "$wd_config_file" ]; then
wd_exit_fail "\'$wd_config_file\' is not writeable."
return
fi
if [[ $point =~ "^[\.]+$" ]]
then
wd_exit_fail "Warp point cannot be just dots"
@ -239,6 +244,11 @@ wd_remove()
point_list=$(basename "$PWD")
fi
if [ ! -w "$wd_config_file" ]; then
wd_exit_fail "\'$wd_config_file\' is not writeable."
return
fi
for point_name in $point_list ; do
if [[ ${points[$point_name]} != "" ]]
then
@ -440,6 +450,11 @@ wd_clean() {
local count=0
local wd_tmp=""
if [ ! -w "$wd_config_file" ]; then
wd_exit_fail "\'$wd_config_file\' is not writeable."
return
fi
while read -r line
do
if [[ $line != "" ]]
@ -543,14 +558,6 @@ args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,open:,path:,help,show -- $
if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]]
then
wd_print_usage
# check if config file is writeable
elif [ ! -w "$wd_config_file" ]
then
# do nothing
# can't run `exit`, as this would exit the executing shell
wd_exit_fail "\'$wd_config_file\' is not writeable."
else
# parse rest of options
local wd_o

View file

@ -14,7 +14,7 @@ function afmagic_dashes {
if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then
echo $(( COLUMNS - ${#python_env} - 3 ))
elif [[ -n "$VIRTUAL_ENV_PROMPT" && "$PS1" = *${VIRTUAL_ENV_PROMPT}* ]]; then
echo $(( COLUMNS - ${#VIRTUAL_ENV_PROMPT} ))
echo $(( COLUMNS - ${#VIRTUAL_ENV_PROMPT} - 3 ))
else
echo $COLUMNS
fi