Add jj/kitty/nvim/opencode/paru/fish/yazi/jjui
This commit is contained in:
30
fish/files/functions/bw-create-note.fish
Normal file
30
fish/files/functions/bw-create-note.fish
Normal file
@@ -0,0 +1,30 @@
|
||||
function bw-create-note
|
||||
function bw-create-note --argument-names content_or_name name
|
||||
if isatty stdin
|
||||
# Direct input mode
|
||||
set notes_content $content_or_name
|
||||
set note_name $name
|
||||
else
|
||||
# Pipe mode
|
||||
read -z notes_content
|
||||
set note_name $content_or_name
|
||||
end
|
||||
|
||||
# If no name provided, use default
|
||||
if test -z "$note_name"
|
||||
set note_name secure-note
|
||||
end
|
||||
|
||||
# If no content, show usage
|
||||
if test -z "$notes_content"
|
||||
echo "Usage: bw-create-note 'content' 'note name'"
|
||||
echo "Or: command | bw-create-note 'note name'"
|
||||
return 1
|
||||
end
|
||||
|
||||
bw get template item | jq --arg folderId (bw list folders | jq -r '.[] | select(.name == "chezmoi") | .id') \
|
||||
--arg notes "$notes_content" \
|
||||
--arg name "$note_name" \
|
||||
'.type = 2 | .secureNote.type = 0 | .notes=$notes | .name = $name | .folderId=$folderId' | bw encode | bw create item
|
||||
end
|
||||
end
|
||||
3
fish/files/functions/bw-unlock.fish
Normal file
3
fish/files/functions/bw-unlock.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function bw-unlock
|
||||
set -Ux BW_SESSION (bw unlock --raw || echo "Error unlocking BW")
|
||||
end
|
||||
11
fish/files/functions/pomodoro.fish
Normal file
11
fish/files/functions/pomodoro.fish
Normal file
@@ -0,0 +1,11 @@
|
||||
function pomodoro --argument type
|
||||
set -l durations work 45 break 10
|
||||
set -l idx (contains -i -- $type $durations)
|
||||
|
||||
if test -n "$idx"
|
||||
set -l minutes $durations[(math $idx + 1)]
|
||||
echo $type | lolcat
|
||||
timer {$minutes}m
|
||||
espeak "$type session done"
|
||||
end
|
||||
end
|
||||
6
fish/files/functions/reload-env.fish
Normal file
6
fish/files/functions/reload-env.fish
Normal file
@@ -0,0 +1,6 @@
|
||||
function reload-env
|
||||
for line in (grep -v '^#' /etc/environment | grep '=')
|
||||
set -l pair (string split -m 1 '=' $line)
|
||||
set -gx $pair[1] $pair[2]
|
||||
end
|
||||
end
|
||||
8
fish/files/functions/y.fish
Normal file
8
fish/files/functions/y.fish
Normal file
@@ -0,0 +1,8 @@
|
||||
function y
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
end
|
||||
Reference in New Issue
Block a user