Skip to content

Commit

Permalink
docs: add shortcuts to manual
Browse files Browse the repository at this point in the history
  • Loading branch information
Euro20179 committed Jan 3, 2023
1 parent af57461 commit 0736d73
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
47 changes: 47 additions & 0 deletions docs/man/ytfzf.1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,53 @@ Prints a possibly brief description of how to use the scraper.
.PP
Addon scrapers may have more or less search operators

.SH SHORTCUTS

.PP
These shortcuts will apply in any menu that supports it.
.br
The only menu that currently supports it is fzf.
.br
Shortcuts starting with alt, will exit the menu, shortcuts starting with ctrl will not.
.br
To change any of the defaults set the corresponding variable in your configuration file.

.TP
.BR download
alt-d (download_shortcut)

.TP
.BR "watch video"
alt-v (video_shortcut)

.TP
.BR "audio only"
alt-m (audio_shortcut)

.TP
.BR "detatch"
alt-e (detach_shortcut)

.TP
.BR "print link"
alt-l (print_link_shortcut)

.TP
.BR "show formats"
alt-f (show_formats_shortcut)

.TP
.BR "show all info"
alt-i (info_shortcut)

.TP
.BR "new search"
alt-s (search_again_shortcut)

.TP
.BR "scrape next page"
ctrl-p (cannot be changed)

.SH OPTIONS

.PP
Expand Down
7 changes: 0 additions & 7 deletions docs/man/ytfzf.5
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,6 @@ The shortcut to make another search.
.br
.IR default: " alt-s"

.TP
.RB $ next_page_shortcut
The shortcut to scrape the next page.
.br
Currently only applies to the comments scrape.
.IR default: " alt-p"

.TP
.RB $ shortcut_binds
The keys to listen for in fzf.
Expand Down
16 changes: 3 additions & 13 deletions ytfzf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# versioning system:
# major.minor.bugs
YTFZF_VERSION="git-1833.fe6c523"
YTFZF_VERSION="git-1833.af57461"

#ENVIRONMENT VARIABLES {{{
: "${YTFZF_CONFIG_DIR:=${XDG_CONFIG_HOME:-$HOME/.config}/ytfzf}"
Expand Down Expand Up @@ -201,7 +201,7 @@ on_post_set_vars___ytfzf__ () {

: "${ytdl_pref:=$video_pref+$audio_pref/best/$video_pref/$audio_pref}"

: "${shortcut_binds="Enter,double-click,${next_page_shortcut},${download_shortcut},${video_shortcut},${audio_shortcut},${detach_shortcut},${print_link_shortcut},${show_formats_shortcut},${info_shortcut},${search_again_shortcut},${custom_shortcut_binds},${custom_shortcut_binds}"}"
: "${shortcut_binds="Enter,double-click,${download_shortcut},${video_shortcut},${audio_shortcut},${detach_shortcut},${print_link_shortcut},${show_formats_shortcut},${info_shortcut},${search_again_shortcut},${custom_shortcut_binds},${custom_shortcut_binds}"}"

[ ! -d "$cache_dir" ] && mkdir -p "$cache_dir"

Expand Down Expand Up @@ -999,7 +999,7 @@ set_vars () {
fzf_preview_side="left" thumbnail_viewer="ueberzug"

# shortcuts
download_shortcut="alt-d" video_shortcut="alt-v" audio_shortcut="alt-m" detach_shortcut="alt-e" print_link_shortcut="alt-l" show_formats_shortcut="alt-f" info_shortcut="alt-i" search_again_shortcut="alt-s" next_page_shortcut="alt-p"
download_shortcut="alt-d" video_shortcut="alt-v" audio_shortcut="alt-m" detach_shortcut="alt-e" print_link_shortcut="alt-l" show_formats_shortcut="alt-f" info_shortcut="alt-i" search_again_shortcut="alt-s"
custom_shortcut_binds=""

# interface design
Expand Down Expand Up @@ -1983,7 +1983,6 @@ handle_post_keypress () {
"$detach_shortcut") is_detach=0 ;;
"$print_link_shortcut"|"$info_shortcut") info_to_print="$_last_info_to_print" ;;
"$show_formats_shortcut") show_formats=0 ;;
"$next_page_shortcut") : ;;
"$search_again_shortcut") : ;;
*)
_fn_name=handle_post_keypress_$(sed 's/-/_/g' <<-EOF
Expand All @@ -2010,15 +2009,6 @@ handle_keypress () {
"$print_link_shortcut") _last_info_to_print="$info_to_print"; info_to_print="L" ;;
"$show_formats_shortcut") show_formats=1 ;;
"$info_shortcut") _last_info_to_print="$info_to_print"; info_to_print="VJ" ;;
"$next_page_shortcut")
read -r url < "$selected_id_file"
hovered_scraper="$(jq -r '.[]|select(.url=="'"$url"'").scraper' < "$ytfzf_video_json_file")"
pages_to_scrape="$(sed -n 's/^pages_to_scrape=\(.*\)/\1/p' "$session_cache_dir/environment")"
pages_start="$(cat "${session_temp_dir}/${hovered_scraper}-current-page")"
"scrape_next_page_$hovered_scraper"
unset hovered_scraper
return 3
;;
"$search_again_shortcut")
clean_up
initial_search="" init_and_make_search "" "$search_source"
Expand Down

0 comments on commit 0736d73

Please sign in to comment.