diff options
Diffstat (limited to 'ar/.local/bin/getkeys')
| -rwxr-xr-x | ar/.local/bin/getkeys | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ar/.local/bin/getkeys b/ar/.local/bin/getkeys index 79a7872..492b056 100755 --- a/ar/.local/bin/getkeys +++ b/ar/.local/bin/getkeys @@ -1,6 +1,7 @@ #!/bin/sh # Print available keys from thesiah -cat "${XDG_DATA_HOME:-${HOME}/.local/share}"/thesiah/keys/"$1" 2>/dev/null && exit -echo "Run command with one of the following arguments for info about that program:" -ls "${XDG_DATA_HOME:-${HOME}/.local/share}"/thesiah/keys +[ -n "$1" ] && cat "${XDG_DATA_HOME:-${HOME}/.local/share}"/thesiah/keys/"$1" 2>/dev/null && exit +keys_dir="${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/keys" +selected_file=$(du -a "$keys_dir" | cut -f2- | sed "s|$keys_dir/||" | fzf) +[ -n "$selected_file" ] && cat "$keys_dir/$selected_file" |
