diff options
Diffstat (limited to 'fish')
-rw-r--r-- | fish/completions/task.fish | 449 | ||||
-rw-r--r-- | fish/config.fish | 12 | ||||
-rw-r--r-- | fish/fish_variables | 5 | ||||
-rw-r--r-- | fish/functions/jtoday.fish | 3 | ||||
-rw-r--r-- | fish/functions/modlog.fish | 3 | ||||
-rw-r--r-- | fish/functions/mutt.fish | 3 | ||||
-rw-r--r-- | fish/functions/myupdateports.fish | 3 | ||||
-rw-r--r-- | fish/functions/myupdatesrc.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal1m.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal1w.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal1w_small.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal2m.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal2w.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal2w_small.fish | 3 | ||||
-rw-r--r-- | fish/functions/rcal3w.fish | 3 | ||||
-rw-r--r-- | fish/functions/snapdate.fish | 3 | ||||
-rw-r--r-- | fish/functions/tallproj.fish | 3 | ||||
-rw-r--r-- | fish/functions/taskstobunkerage.fish | 3 | ||||
-rw-r--r-- | fish/functions/tj.fish | 7 | ||||
-rw-r--r-- | fish/functions/tjclip.fish | 7 | ||||
-rw-r--r-- | fish/functions/todj.fish | 14 | ||||
-rw-r--r-- | fish/functions/ttoday.fish | 3 | ||||
-rw-r--r-- | fish/functions/venvact.fish | 3 | ||||
-rw-r--r-- | fish/functions/ytmp3.fish | 7 |
24 files changed, 548 insertions, 4 deletions
diff --git a/fish/completions/task.fish b/fish/completions/task.fish new file mode 100644 index 0000000..f7057b8 --- /dev/null +++ b/fish/completions/task.fish @@ -0,0 +1,449 @@ +# Taskwarrior completions for the Fish shell <https://fishshell.com> +# +# taskwarrior - a command line task list manager. +# +# Completions should work out of box. If it isn't, fill the bug report on your +# operation system bug tracker. +# +# As a workaround you can copy this script to +# ~/.config/fish/completions/task.fish, and open a new shell. +# +# Objects completed: +# * Commands +# * Projects +# * Priorities +# * Tags +# * Attribute names and modifiers +# +# +# You can override some default options in your config.fish: +# +# # Tab-completion of task descriptions. +# # Warning: This often creates a list of suggestions which spans several pages, +# # and it usually pushes some of the commands and attributes to the end of the +# # list. +# set -g task_complete_task yes +# +# # Tab-completion of task IDs outside of the "depends" attribute. +# # Warning: This often creates a list of suggestions which spans several pages, +# # and it pushes all commands and attributes to the end of the list. +# set -g task_complete_id yes +# +# # Attribute modifiers (DEPRECATED since 2.4.0) +# set -g task_complete_attribute_modifiers yes +# +# +# Copyright 2014 - 2021, Roman Inflianskas <infroma@gmail.com> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# https://www.opensource.org/licenses/mit-license.php + +# NOTE: remember that sed on OS X is different in some aspects. E.g. it does +# not understand \t for tabs. + +# convinience functions + +function __fish.task.log + for line in $argv + echo $line >&2 + end +end + +function __fish.task.partial + set wrapped $argv[1] + set what $argv[2] + set -q argv[3]; and set f_argv $argv[3..-1] + set f __fish.task.$wrapped.$what + functions -q $f; and eval $f $f_argv +end + +function __fish.task.zsh + set -q argv[2]; and set task_argv $argv[2..-1] + task _zsh$argv[1] $task_argv | sed 's/:/ /' +end + + +# command line state detection + +function __fish.task.bare + test (count (commandline -c -o)) -eq 1 +end + +function __fish.task.current.command + # find command in commandline by list intersection + begin; commandline -pco; and echo $__fish_task_static_commands; end | sort | uniq -d | xargs +end + +function __fish.task.before_command + test -z (__fish.task.current.command) +end + + +# checking need to complete + +function __fish.task.need_to_complete.attr_name + __fish.task.need_to_complete.filter; or contains (__fish.task.current.command) (__fish.task.list.command_mods) +end + +function __fish.task.need_to_complete.attr_value + __fish.task.need_to_complete.attr_name + or return 1 + # only start completion when there's a colon in attr_name + set -l cmd (commandline -ct) + string match -q -- "*:*" "$cmd[-1]" +end + +function __fish.task.need_to_complete.command + switch $argv + case all + __fish.task.bare + case filter + __fish.task.before_command + end +end + +function __fish.task.need_to_complete.config + contains (__fish.task.current.command) 'config' 'show' +end + +function __fish.task.need_to_complete.filter + __fish.task.before_command +end + +function __fish.task.need_to_complete.tag + __fish.task.need_to_complete.attr_name + or return 1 + set -l cmd (commandline -ct) + # only start complete when supplied + or - + string match -qr -- "^[+-][^+-]*" "$cmd[-1]" +end + +function __fish.task.need_to_complete.id + __fish.task.need_to_complete.filter +end + +function __fish.task.need_to_complete.task + __fish.task.need_to_complete.filter +end + +function __fish.task.need_to_complete + __fish.task.partial need_to_complete $argv +end + + +# list printers + +function __fish.task.token_clean + sed 's/[^a-z_.]//g; s/^\.$//g' +end + +function __fish.task.list.attr_name + # # BUG: doesn't support file completion + for attr in (task _columns) + if set -l idx (contains -i -- $attr $__fish_task_static_attr_desc_keys) + # use builtin friendly description + echo -e "$attr:\tattribute:$__fish_task_static_attr_desc_vals[$idx]" + else + echo -e "$attr:\tattribute" + end + end + echo -e "rc\tConfiguration for taskwarrior" +end + +function __fish.task.list.attr_value + set token (commandline -ct | cut -d ':' -f 1 | cut -d '.' -f 1 | __fish.task.token_clean) + if test -n $token + set attr_names (__fish.task.list.attr_name | sed 's/: / /g' | grep '^'$token | cut -d ' ' -f 1) + for attr_name in $attr_names + if test -n $attr_name + __fish.task.list.attr_value_by_name $attr_name + end + end + end +end + +function __fish.task.list.attr_value_by_name + set attr $argv[1] + switch $attr + case 'rc' + __fish.task.list.rc + case 'depends' 'limit' 'priority' 'status' + __fish.task.combos_simple $attr (__fish.task.list $attr) + case 'recur' + __fish.task.combos_simple $attr (__fish.task.list.date_freq) + case 'due' 'until' 'wait' 'entry' 'end' 'start' 'scheduled' + __fish.task.combos_simple $attr (__fish.task.list.dates) + # case 'description' 'project' + case '*' + if [ "$task_complete_attribute_modifiers" = 'yes' ]; and echo (commandline -ct) | grep -q '\.' + __fish.task.combos_with_mods $attr (__fish.task.list $attr) + else + __fish.task.combos_simple $attr (__fish.task.list $attr) + end + end +end + +function __fish.task.list._command + echo -e $__fish_task_static_commands_with_desc +end + +function __fish.task.list.command + # ignore special commands + __fish.task.list._command $argv | command grep -Ev '^_' +end + +function __fish.task.list.command_mods + echo -e $__fish_task_static_command_mods +end + +function __fish.task.list.config + task _config +end + +function __fish.task.list.depends + __fish.task.list.id with_description +end + +function __fish.task.list.description + __fish.task.zsh ids $argv | awk -F"\t" '{print $2 "\tid=" $1}' +end + +function __fish.task.list.id + set show_type $argv[1] + if test -z $show_type + task _ids + else if [ $show_type = 'with_description' ] + __fish.task.zsh ids + end +end + +function __fish.task.list.date_freq + set -l cmd (commandline -ct) + if set -l user_input_numeric (echo $cmd[-1] | grep -o '[0-9]\+') + # show numeric freq like 2d, 4m, etc. + echo -e (string replace --all -r "^|\n" "\n$user_input_numeric" $__fish_task_static_freq_numeric | string collect) + else + echo -e $__fish_task_static_freq + end +end + +function __fish.task.list.dates + set -l cmd (commandline -ct) + if set -l user_input_numeric (echo $cmd[-1] | grep -o '[0-9]\+') + # show numeric date like 2hrs, 4th, etc. + echo -e (string replace --all -r "^|\n" "\n$user_input_numeric" $__fish_task_static_reldates | string collect) + # special cases for 1st, 2nd and 3rd, and 4-0th + set -l suffix 'th' '4th, 5th, etc.' + if string match -q -- "*1" $user_input_numeric + set suffix 'st' 'first' + else if string match -q -- "*2" $user_input_numeric + set suffix 'nd' 'second' + else if string match -q -- "*3" $user_input_numeric + set suffix 'rd' 'third' + end + echo -e $user_input_numeric"$suffix[1]\t$suffix[2]" + else + echo -e $__fish_task_static_dates + end +end + +# Attribure modifiers (DEPRECATED since 2.4.0) +function __fish.task.list.mod + echo -e $__fish_task_static_mod +end + +function __fish.task.list.priority + echo -e $__fish_task_static_priority +end + +function __fish.task.list.project + task _projects +end + +function __fish.task.list.rc + task _config +end + +function __fish.task.list.status + echo -e $__fish_task_static_status +end + +function __fish.task.list.tag + set -l tags (task _tags) + printf -- '+%s\n' $tags + printf -- '-%s\n' $tags +end + +function __fish.task.list.task + __fish.task.zsh ids | sed -E 's/^(.*) (.*)$/\2 task [id = \1]/g' +end + +function __fish.task.list + __fish.task.partial list $argv +end + +function __fish.task.results_var_name + echo $argv | sed 's/^/__fish.task.list /g; s/$/ results/g; s/[ .]/_/g;' +end + +function __fish.task.list_results + set var_name (__fish.task.results_var_name $name) + for line in $$var_name + echo $line + end +end + + +# working with attributes + +function __fish.task.combos_simple + set attr_name $argv[1] + set -q argv[2]; and set attr_values $argv[2..-1] + if [ (count $attr_values) -gt 0 ] + for attr_value in $attr_values + echo "$attr_name:$attr_value" + end + else + echo "$attr_name:" + end +end + +# Attribure modifiers (DEPRECATED since 2.4.0) +function __fish.task.combos_with_mods + __fish.task.combos_simple $argv + for mod in (__fish.task.list.mod) + __fish.task.combos_simple $argv[1].$mod $argv[2..-1] + end +end + + +# actual completion + +function __fish.task.complete + set what $argv + set list_command "__fish.task.list $what" + set check_function "__fish.task.need_to_complete $what" + complete -c task -u -k -f -n $check_function -a "(eval $list_command)" +end + +# static variables that won't changes even when taskw's data is modified +set __fish_task_static_commands_with_desc (__fish.task.zsh commands | sort | string collect) +set __fish_task_static_commands (echo -e $__fish_task_static_commands_with_desc | cut -d ' ' -f 1 | string collect) +set __fish_task_static_command_mods (printf -- '%s\n' 'add' 'annotate' 'append' 'delete' 'done' 'duplicate' 'log' 'modify' 'prepend' 'start' 'stop' | string collect) +set __fish_task_static_mod (printf -- '%s\n' 'before' 'after' 'over' 'under' 'none' 'is' 'isnt' 'has' 'hasnt' 'startswith' 'endswith' 'word' 'noword' | string collect) +set __fish_task_static_status (printf -- '%s\tstatus\n' 'pending' 'completed' 'deleted' 'waiting' | string collect) +set __fish_task_static_priority (printf -- '%s\n' 'H\tHigh' 'M\tMiddle' 'L\tLow' | string collect) + +set __fish_task_static_freq 'daily:Every day' \ + 'day:Every day' \ + 'weekdays:Every day skipping weekend days' \ + 'weekly:Every week' \ + 'biweekly:Every two weeks' \ + 'fortnight:Every two weeks' \ + 'monthly:Every month' \ + 'quarterly:Every three months' \ + 'semiannual:Every six months' \ + 'annual:Every year' \ + 'yearly:Every year' \ + 'biannual:Every two years' \ + 'biyearly:Every two years' +set __fish_task_static_freq (printf -- '%s\n' $__fish_task_static_freq | sed 's/:/\t/' | string collect) +set __fish_task_static_freq_numeric 'd:days' \ + 'w:weeks' \ + 'q:quarters' \ + 'y:years' +set __fish_task_static_freq_numeric (printf -- '%s\n' $__fish_task_static_freq_numeric | sed 's/:/\t/' | string collect) +set __fish_task_static_freq_numeric 'd:days' \ + 'w:weeks' \ + 'q:quarters' \ + 'y:years' +set __fish_task_static_freq_numeric (printf -- '%s\n' $__fish_task_static_freq_numeric | sed 's/:/\t/' | string collect) +set __fish_task_static_dates 'today:Today' \ + 'yesterday:Yesterday' \ + 'tomorrow:Tomorrow' \ + 'sow:Start of week' \ + 'soww:Start of work week' \ + 'socw:Start of calendar week' \ + 'som:Start of month' \ + 'soq:Start of quarter' \ + 'soy:Start of year' \ + 'eow:End of week' \ + 'eoww:End of work week' \ + 'eocw:End of calendar week' \ + 'eom:End of month' \ + 'eoq:End of quarter' \ + 'eoy:End of year' \ + 'mon:Monday' \ + 'tue:Tuesday'\ + 'wed:Wednesday' \ + 'thu:Thursday' \ + 'fri:Friday' \ + 'sat:Saturday' \ + 'sun:Sunday' \ + 'goodfriday:Good Friday' \ + 'easter:Easter' \ + 'eastermonday:Easter Monday' \ + 'ascension:Ascension' \ + 'pentecost:Pentecost' \ + 'midsommar:Midsommar' \ + 'midsommarafton:Midsommarafton' \ + 'later:Later' \ + 'someday:Some Day' +set __fish_task_static_dates (printf -- '%s\n' $__fish_task_static_dates | sed 's/:/\t/' | string collect) +set __fish_task_static_reldates 'hrs:n hours' \ + 'day:n days' \ + # '1st:first' \ + # '2nd:second' \ + # '3rd:third' \ + # 'th:4th, 5th, etc.' \ + 'wks:weeks' +set __fish_task_static_reldates (printf -- '%s\n' $__fish_task_static_reldates | sed 's/:/\t/' | string collect) +# the followings are actually not used for autocomplete, but to retrieve friendly description that aren't present in internal command +set __fish_task_static_attr_desc_keys 'description' 'status' 'project' \ + 'priority' 'due' 'recur' \ + 'until' 'limit' 'wait' \ + 'entry' 'end' 'start' \ + 'scheduled' 'dependson' +set __fish_task_static_attr_desc_vals 'Task description text' 'Status of task - pending, completed, deleted, waiting' \ + 'Project name' 'Task priority' 'Due date' 'Recurrence frequency' 'Expiration date' \ + 'Desired number of rows in report' 'Date until task becomes pending' \ + 'Date task was created' 'Date task was completed/deleted' 'Date task was started' \ + 'Date task is scheduled to start' 'Other tasks that this task depends upon' + +# fish's auto-completion when multiple `complete` have supplied with '-k' flag, the last will be displayed first +__fish.task.complete config +__fish.task.complete attr_value +__fish.task.complete attr_name +__fish.task.complete tag +# __fish.task.complete command all +# __fish.task.complete command filter +# The following are static so we will expand it when initialised. Display underscore (internal) commands last +set -l __fish_task_static_commands_underscore (echo -e $__fish_task_static_commands_with_desc | grep '^[_]' | string collect | string escape) +set -l __fish_task_static_commands_normal (echo -e $__fish_task_static_commands_with_desc | grep '^[^_]' | string collect | string escape) +complete -c task -u -k -f -n "__fish.task.before_command" -a "$__fish_task_static_commands_underscore" +complete -c task -u -k -f -n "__fish.task.before_command" -a "$__fish_task_static_commands_normal" + +if [ "$task_complete_task" = 'yes' ] + __fish.task.complete task +end + +if [ "$task_complete_id" = 'yes' ] + __fish.task.complete id with_description +end diff --git a/fish/config.fish b/fish/config.fish index c64e395..003ab48 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -19,10 +19,18 @@ alias xclip='xclip -selection c' set fish_greeting "" set -gx TERM screen-256color #set -gx TERM xterm-256color -set -gx SHELL /usr/bin/fish +set -gx SHELL /usr/local//bin/fish +set -gx LESS '-iMRS -x2' set -gx PATH ~/.local/bin $PATH set -gx PATH ~/scripts $PATH set -gx PATH ~/bin $PATH + +set -gx BOOKMARK_PY_SMTP_HOST smtp.fastmail.com +set -gx BOOKMARK_PY_FROM mrlemon@mailforce.net +set -gx BOOKMARK_PY_EMAIL bookmark@matthewlemon.com +# set this when needed in shells: +# BOOKMARK_PY_SMTP_PWD="$(pass AppPasswords/mbsync_fastmail_may2022)" +set -gx PATH ~/.fzf/bin $PATH set -gx FZF_DEFAULT_COMMAND 'ag --nocolor -g ""' set -gx FZF_CTRL_T_COMMAND $FZF_DEFAULT_COMMAND set -gx FZF_ALT_C_COMMAND $FZF_DEFAULT_COMMAND @@ -30,7 +38,7 @@ set -gx FZF_DEFAULT_OPTS '--color info:108,prompt:109,spinner:108,pointer:168,ma #set -gx FZF_DEFAULT_OPTS '--color=bw' # OPAM configuration -source /home/lemon/.opam/opam-init/init.fish > /dev/null 2> /dev/null or true +#source /home/lemon/.opam/opam-init/init.fish > /dev/null 2> /dev/null or true # # THIS REMOVES COLOURS FROM ls COMMAND, ETC # from https://opensource.com/article/19/9/linux-terminal-colors diff --git a/fish/fish_variables b/fish/fish_variables index ae6b661..04804be 100644 --- a/fish/fish_variables +++ b/fish/fish_variables @@ -9,7 +9,7 @@ SETUVAR __fish_classic_git_prompt_initialized:\x1d SETUVAR __fish_init_2_39_8:\x1d SETUVAR __fish_init_2_3_0:\x1d SETUVAR __fish_init_3_x:\x1d -SETUVAR __fish_initialized:3100 +SETUVAR __fish_initialized:3400 SETUVAR fish_color_autosuggestion:555\x1ebrblack SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_command:005fd7 @@ -39,5 +39,6 @@ SETUVAR fish_pager_color_completion:normal SETUVAR fish_pager_color_description:B3A06D\x1eyellow SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan -SETUVAR fish_user_paths:/home/lemon/bin\x2dscripts/\x1e/home/lemon/perl5/perlbrew/bin/\x1e/usr/lib/cargo/bin/\x1e/home/lemon/go/bin\x1e/usr/local/go/bin\x1e/snap/bin\x1e/home/lemon/\x2epoetry/bin\x1e/home/lemon/\x2ecargo/bin\x1e/snap/bin\x1e/home/lemon/bin\x1e/home/lemon/bin/adb\x2dfastboot/platform\x2dtools/\x1e/home/lemon/\x2efzf/bin\x1e/home/lemon/bin +SETUVAR fish_pager_color_selected_background:\x2dr +SETUVAR fish_user_paths:/home/lemon/bin\x2dscripts/\x1e/home/lemon/perl5/perlbrew/bin/\x1e/usr/lib/cargo/bin/\x1e/home/lemon/go/bin\x1e/usr/local/go/bin\x1e/snap/bin\x1e/home/lemon/\x2epoetry/bin\x1e/home/lemon/\x2ecargo/bin\x1e/home/lemon/bin\x1e/home/lemon/bin/adb\x2dfastboot/platform\x2dtools/\x1e/home/lemon/\x2efzf/bin SETUVAR fisher_dependency_count:Colored\x2dMan\x2dPages\x1ebass diff --git a/fish/functions/jtoday.fish b/fish/functions/jtoday.fish new file mode 100644 index 0000000..f5a2f7a --- /dev/null +++ b/fish/functions/jtoday.fish @@ -0,0 +1,3 @@ +function jtoday --wraps='vim ~/Notes/journal/$(date +%Y-%m-%d).md' --description 'alias jtoday=vim ~/Notes/journal/$(date +%Y-%m-%d).md' + vim ~/Notes/journal/$(date +%Y-%m-%d).md $argv; +end diff --git a/fish/functions/modlog.fish b/fish/functions/modlog.fish new file mode 100644 index 0000000..25460a2 --- /dev/null +++ b/fish/functions/modlog.fish @@ -0,0 +1,3 @@ +function modlog --wraps='grep -R :MOD /home/lemon/Notes/journal| sort -r|cut -d/ -f6-' --description 'alias modlog=grep -R :MOD /home/lemon/Notes/journal| sort -r|cut -d/ -f6-' + grep -R :MOD /home/lemon/Notes/journal| sort -r|cut -d/ -f6- $argv; +end diff --git a/fish/functions/mutt.fish b/fish/functions/mutt.fish new file mode 100644 index 0000000..2e23366 --- /dev/null +++ b/fish/functions/mutt.fish @@ -0,0 +1,3 @@ +function mutt --wraps='neomutt -f Mail/fastmail/INBOX/' --description 'alias mutt=neomutt -f Mail/fastmail/INBOX/' + neomutt -f Mail/fastmail/INBOX/ $argv; +end diff --git a/fish/functions/myupdateports.fish b/fish/functions/myupdateports.fish new file mode 100644 index 0000000..9ad5921 --- /dev/null +++ b/fish/functions/myupdateports.fish @@ -0,0 +1,3 @@ +function myupdateports --wraps='cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A ports && cd - || return' --description 'alias myupdateports=cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A ports && cd - || return' + cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A ports && cd - || return $argv; +end diff --git a/fish/functions/myupdatesrc.fish b/fish/functions/myupdatesrc.fish new file mode 100644 index 0000000..5361550 --- /dev/null +++ b/fish/functions/myupdatesrc.fish @@ -0,0 +1,3 @@ +function myupdatesrc --wraps='cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A src && cd - || return' --description 'alias myupdatesrc=cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A src && cd - || return' + cd /usr && cvs -d anoncvs@anoncvs.spacehopper.org:/cvs -q up -Pd -A src && cd - || return $argv; +end diff --git a/fish/functions/rcal1m.fish b/fish/functions/rcal1m.fish new file mode 100644 index 0000000..005aac8 --- /dev/null +++ b/fish/functions/rcal1m.fish @@ -0,0 +1,3 @@ +function rcal1m --wraps='ssh bobbins rem -cca -w160 -m' --description 'alias rcal1m=ssh bobbins rem -cca -w160 -m' + ssh bobbins rem -cca -w160 -m $argv; +end diff --git a/fish/functions/rcal1w.fish b/fish/functions/rcal1w.fish new file mode 100644 index 0000000..bbda153 --- /dev/null +++ b/fish/functions/rcal1w.fish @@ -0,0 +1,3 @@ +function rcal1w --wraps='ssh bobbins rem -cc+a1 -w160 -m' --description 'alias rcal1w=ssh bobbins rem -cc+a1 -w160 -m' + ssh bobbins rem -cc+a1 -w160 -m $argv; +end diff --git a/fish/functions/rcal1w_small.fish b/fish/functions/rcal1w_small.fish new file mode 100644 index 0000000..1232b64 --- /dev/null +++ b/fish/functions/rcal1w_small.fish @@ -0,0 +1,3 @@ +function rcal1w_small --wraps='ssh bobbins rem -cca+1 -w140 -m' --description 'alias rcal1w_small=ssh bobbins rem -cca+1 -w140 -m' + ssh bobbins rem -cca+1 -w140 -m $argv; +end diff --git a/fish/functions/rcal2m.fish b/fish/functions/rcal2m.fish new file mode 100644 index 0000000..1dcf194 --- /dev/null +++ b/fish/functions/rcal2m.fish @@ -0,0 +1,3 @@ +function rcal2m --wraps='ssh bobbins rem -cca2 -w160 -m' --description 'alias rcal2m=ssh bobbins rem -cca2 -w160 -m' + ssh bobbins rem -cca2 -w160 -m $argv; +end diff --git a/fish/functions/rcal2w.fish b/fish/functions/rcal2w.fish new file mode 100644 index 0000000..9367062 --- /dev/null +++ b/fish/functions/rcal2w.fish @@ -0,0 +1,3 @@ +function rcal2w --wraps='ssh bobbins rem -cc+a2 -w160 -m' --description 'alias rcal2w=ssh bobbins rem -cc+a2 -w160 -m' + ssh bobbins rem -cc+a2 -w160 -m $argv; +end diff --git a/fish/functions/rcal2w_small.fish b/fish/functions/rcal2w_small.fish new file mode 100644 index 0000000..9f4490c --- /dev/null +++ b/fish/functions/rcal2w_small.fish @@ -0,0 +1,3 @@ +function rcal2w_small --wraps='ssh bobbins rem -cca+2 -w140 -m' --description 'alias rcal2w_small=ssh bobbins rem -cca+2 -w140 -m' + ssh bobbins rem -cca+2 -w140 -m $argv; +end diff --git a/fish/functions/rcal3w.fish b/fish/functions/rcal3w.fish new file mode 100644 index 0000000..7bc5fd9 --- /dev/null +++ b/fish/functions/rcal3w.fish @@ -0,0 +1,3 @@ +function rcal3w --wraps='ssh bobbins rem -cc+a3 -w160 -m' --description 'alias rcal3w=ssh bobbins rem -cc+a3 -w160 -m' + ssh bobbins rem -cc+a3 -w160 -m $argv; +end diff --git a/fish/functions/snapdate.fish b/fish/functions/snapdate.fish new file mode 100644 index 0000000..daaeb73 --- /dev/null +++ b/fish/functions/snapdate.fish @@ -0,0 +1,3 @@ +function snapdate --wraps=curl\ -s\ https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/\|grep\ INSTALL\|tr\ -d\ \'\ \'\|cut\ -d\'\>\'\ -f3\|cut\ -d\':\'\ -f1 --description alias\ snapdate=curl\ -s\ https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/\|grep\ INSTALL\|tr\ -d\ \'\ \'\|cut\ -d\'\>\'\ -f3\|cut\ -d\':\'\ -f1 + curl -s https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/|grep INSTALL|tr -d ' '|cut -d'>' -f3|cut -d':' -f1 $argv; +end diff --git a/fish/functions/tallproj.fish b/fish/functions/tallproj.fish new file mode 100644 index 0000000..13980d0 --- /dev/null +++ b/fish/functions/tallproj.fish @@ -0,0 +1,3 @@ +function tallproj --wraps='task rc.list.all.projects=1 projects' --description 'alias tallproj=task rc.list.all.projects=1 projects' + task rc.list.all.projects=1 projects $argv; +end diff --git a/fish/functions/taskstobunkerage.fish b/fish/functions/taskstobunkerage.fish new file mode 100644 index 0000000..d4ac2ca --- /dev/null +++ b/fish/functions/taskstobunkerage.fish @@ -0,0 +1,3 @@ +function taskstobunkerage --wraps=echo\ \"\#\#\#\ Tasks\\n\\n\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ task\ ml_basic\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/con\ \ \ \ tent/bunkerage/day.md\ \&\&\ echo\ \"\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ cd\ \~/code/html/yulqen.org.hugo/\ \&\&\ make\ push\ \&\&\ cd\ - --description alias\ taskstobunkerage=echo\ \"\#\#\#\ Tasks\\n\\n\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ task\ ml_basic\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/con\ \ \ \ tent/bunkerage/day.md\ \&\&\ echo\ \"\\`\\`\\`\"\ \>\>\ /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md\ \&\&\ cd\ \~/code/html/yulqen.org.hugo/\ \&\&\ make\ push\ \&\&\ cd\ - + echo "### Tasks\n\n\`\`\`" >> /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md && task ml_basic >> /home/lemon/code/html/yulqen.org.hugo/con tent/bunkerage/day.md && echo "\`\`\`" >> /home/lemon/code/html/yulqen.org.hugo/content/bunkerage/day.md && cd ~/code/html/yulqen.org.hugo/ && make push && cd - $argv; +end diff --git a/fish/functions/tj.fish b/fish/functions/tj.fish new file mode 100644 index 0000000..8c1caad --- /dev/null +++ b/fish/functions/tj.fish @@ -0,0 +1,7 @@ +function tj -d "Log to the daily journal - wrapper round _tj script" --argument-names 'message' + if test -n "$message" + echo "$message" | _tj + else + echo "Please give me your message, wrapped in quotes." + end +end diff --git a/fish/functions/tjclip.fish b/fish/functions/tjclip.fish new file mode 100644 index 0000000..959c87a --- /dev/null +++ b/fish/functions/tjclip.fish @@ -0,0 +1,7 @@ +function tjclip --description 'Log contents of the clipboard to the daily journal, via the _tj script' --argument message + if test -n "$message" + echo "$message: $(xclip -o -clipboard clipboard)." | _tj + else + echo "Please give me your message, wrapped in quotes." + end +end diff --git a/fish/functions/todj.fish b/fish/functions/todj.fish new file mode 100644 index 0000000..7e54dfa --- /dev/null +++ b/fish/functions/todj.fish @@ -0,0 +1,14 @@ +function todj -d "Shows the current daily journal" --argument-names 'vimopt' + if test -n "$vimopt" + if test $vimopt = "-v" + set CMD vim + else + echo "Do not recognise $vimopt. Did you mean -v?" + return + end + else + set CMD cat + end + + $CMD $(find /home/lemon/Notes/journal -name "*$(date '+%Y-%m-%d')*") +end diff --git a/fish/functions/ttoday.fish b/fish/functions/ttoday.fish new file mode 100644 index 0000000..115f304 --- /dev/null +++ b/fish/functions/ttoday.fish @@ -0,0 +1,3 @@ +function ttoday --wraps='task ml_due_or_scheduled_today' --description 'alias ttoday=task ml_due_or_scheduled_today' + task ml_due_or_scheduled_today $argv; +end diff --git a/fish/functions/venvact.fish b/fish/functions/venvact.fish new file mode 100644 index 0000000..01bf050 --- /dev/null +++ b/fish/functions/venvact.fish @@ -0,0 +1,3 @@ +function venvact --wraps='. ./.venv/bin/activate' --description 'alias venvact=. ./.venv/bin/activate' + . ./.venv/bin/activate $argv; +end diff --git a/fish/functions/ytmp3.fish b/fish/functions/ytmp3.fish new file mode 100644 index 0000000..f66467e --- /dev/null +++ b/fish/functions/ytmp3.fish @@ -0,0 +1,7 @@ +function ytmp3 --description 'Download YouTube video or playlist as audio' --argument url + if test -n "$url" + cd ~/Downloads && yt-dlp -f 'ba' -x --audio-format mp3 "$url" -o '%(title)s.%(ext)s' && cd - || return + else + echo "Please give me a URL." + end +end |