feat(completion): move function to functions/*

This commit is contained in:
EmilyGraceSeville7cf 2024-09-15 23:54:30 +10:00
parent d7869fa42d
commit 39b5759bb0
4 changed files with 26 additions and 28 deletions

View file

@ -1,15 +1,3 @@
function __fish_termux_api__complete_camera_ids
set -l command termux-camera-info
set ids ($command | jq --raw-output '.[].id')
set types ($command | jq --raw-output '.[].facing')
printf "0\tdefault\n"
for index in (seq (count $ids))
printf "%s\t%s\n" $ids[$index] $types[$index]
end
end
set command termux-camera-photo
complete -c $command -f

View file

@ -1,19 +1,3 @@
function __fish_termux_api__complete_group_ids
set -l command termux-notification-list
set ids ($command | jq --raw-output '.[].group')
set titles ($command | jq --raw-output '.[].title')
for index in (seq (count $ids))
set -l id $ids[$index]
set -l title $titles[$index]
test -z "$id" && continue
test -z "$title" && set title "Unknown title"
printf "%s\t%s\n" $id $title
end
end
set command termux-notification
complete -c $command -f

View file

@ -0,0 +1,11 @@
function __fish_termux_api__complete_camera_ids
set -l command termux-camera-info
set ids ($command | jq --raw-output '.[].id')
set types ($command | jq --raw-output '.[].facing')
printf "0\tdefault\n"
for index in (seq (count $ids))
printf "%s\t%s\n" $ids[$index] $types[$index]
end
end

View file

@ -0,0 +1,15 @@
function __fish_termux_api__complete_group_ids
set -l command termux-notification-list
set ids ($command | jq --raw-output '.[].group')
set titles ($command | jq --raw-output '.[].title')
for index in (seq (count $ids))
set -l id $ids[$index]
set -l title $titles[$index]
test -z "$id" && continue
test -z "$title" && set title "Unknown title"
printf "%s\t%s\n" $id $title
end
end