Reformat all fish files

This commit is contained in:
mitchell 2020-08-15 19:20:08 -04:00
parent 2f5438dc21
commit 0a0a2decef
11 changed files with 112 additions and 102 deletions

View file

@ -1,12 +1,12 @@
function configure_fish
# Determine OS
set uname (uname)
# Determine OS
set uname (uname)
# Begin profile init
# (These functions are defined in the functions/ directory.)
define_global_variables
import_sources $uname
define_aliases $uname
# Begin profile init
# (These functions are defined in the functions/ directory.)
define_global_variables
import_sources $uname
define_aliases $uname
end
configure_fish

View file

@ -1,6 +1,6 @@
function back -d 'A shortcut for backgrounding a command using nohup and named log file'
set log_name (string join _ $argv)
set log_name (string join _ $argv)
echo "log file: $log_name.out"
nohup $argv > "$log_name.out" &
echo "log file: $log_name.out"
nohup $argv > "$log_name.out" &
end

View file

@ -1,3 +1,3 @@
function dm-env -d 'Shortcut for setting your shell env for a docker-machine'
eval (docker-machine env $argv)
eval (docker-machine env $argv)
end

View file

@ -1,24 +1,24 @@
function editcb -a ft -d 'Opens your editor to the cliboard\'s current contents.'
set uname (uname)
set file "._temp.$ft"
set uname (uname)
set file "._temp.$ft"
touch $file
touch $file
switch "$uname"
case 'Linux'
xclip -out -selection clipboard > $file
case 'Darwin'
pbpaste > $file
end
switch "$uname"
case 'Linux'
xclip -out -selection clipboard > $file
case 'Darwin'
pbpaste > $file
end
$EDITOR $file
$EDITOR $file
switch "$uname"
case 'Linux'
xclip -in -selection clipboard < $file
case 'Darwin'
pbcopy < $file
end
switch "$uname"
case 'Linux'
xclip -in -selection clipboard < $file
case 'Darwin'
pbcopy < $file
end
rm $file
rm $file
end

View file

@ -1,4 +1,8 @@
function push_tasks -d 'Push tasks as a notification to your phone'
set tasks (task +READY export | jq 'sort_by(.urgency) | reverse | map(@text "\(.description)\nLink: \(.link)") | join("\n\n")')
send_push $tasks
set tasks (task +READY export |
jq 'sort_by(.urgency) |
reverse |
map(@text "\(.description)\nLink: \(.link)") |
join("\n\n")')
send_push $tasks
end

View file

@ -1,7 +1,13 @@
function send_push -a message -d 'Send a push notification to your phone via pushover (optional delay as second arg)'
if test -n "$argv[2]"; sleep $argv[2]; end
set payload "{\"token\":\"$pushover_token\",\"user\":\"$pushover_user\",\"title\":\"Tasks\",\"message\":$message}"
set payload \
"{
\"token\": \"$pushover_token\",
\"user\": \"$pushover_user\",
\"title\": \"Tasks\",
\"message\": $message
}"
curl \
-X POST \

View file

@ -1,4 +1,4 @@
function tasko -a id -d 'Open the link of a taskwarrior task by id'
set link (task _get $id.link)
if test -n $link; open $link; end
set link (task _get $id.link)
if test -n $link; open $link; end
end

View file

@ -1,9 +1,9 @@
function tasktime -a id time -d 'Set a time to check-in on task progress using pushover'
set half_time (math $time/2)
set desc (task _get $id.description)
set half_time (math $time/2)
set desc (task _get $id.description)
task $id start
task $id start
fish -c "send_push '\"Half-time: $desc\"' $half_time" > /dev/null & disown
fish -c "send_push '\"Timer over: $desc\"' $time" > /dev/null & disown
fish -c "send_push '\"Half-time: $desc\"' $half_time" > /dev/null & disown
fish -c "send_push '\"Timer over: $desc\"' $time" > /dev/null & disown
end

View file

@ -1,9 +1,9 @@
function taskwiki -a id
set page (task _get $id.wiki)
set page (task _get $id.wiki)
if test -n $page
$EDITOR +VimwikiIndex "+VimwikiGoto $page"
else
echo 'no wiki file specified'
end
if test -n $page
$EDITOR +VimwikiIndex "+VimwikiGoto $page"
else
echo 'no wiki file specified'
end
end

View file

@ -1,8 +1,8 @@
# temp creates a temporary file in your editor, with the given filetype.
function temp -a ft
set file "._temp.$ft"
set file "._temp.$ft"
touch $file
$EDITOR $file
rm $file
touch $file
$EDITOR $file
rm $file
end