From 06b7e28be3aa8d642e2d786873671a785a93187e Mon Sep 17 00:00:00 2001 From: h3xo <82811246+h3xOo@users.noreply.github.com> Date: Tue, 29 Mar 2022 03:13:28 +0200 Subject: [PATCH 1/3] remove typo in bgloc (#1096) path should be "$HOME/.local/share" (there's an extra slash) --- .local/bin/setbg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/setbg b/.local/bin/setbg index b0938fd..2829896 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -7,7 +7,7 @@ # If wal is installed, also generates a colorscheme. # Location of link to wallpaper link. -bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" +bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg" # Configuration files of applications that have their themes changed by pywal. dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" From 4ba50116d9228496ebbb32bfa2bc0ef7c5fefc8e Mon Sep 17 00:00:00 2001 From: Arjun Karangiya Date: Tue, 29 Mar 2022 06:54:57 +0530 Subject: [PATCH 2/3] Shortcuts in vim command line from bm-dirs/files (#1073) This will allow using the mappings in the vim command line. Here the leader is ";" So here `:e ;cfz` typed fast will expand into `:e /home/user/.config/zsh/.zshrc`. This is more helpful with :sp, :vs, :cd or anywhere where a file or a directory is expected in the vim command line. --- .config/nvim/init.vim | 5 +++++ .local/bin/shortcuts | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 09610fd..5707eae 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -149,3 +149,8 @@ function! ToggleHiddenAll() endif endfunction nnoremap h :call ToggleHiddenAll() +" Load command shortcuts generated from bm-dirs and bm-files via shortcuts script. +" Here leader is ";". +" So ":vs ;cfz" will expand into ":vs /home//.config/zsh/.zshrc" +" if typed fast without the timeout. +source ~/.config/nvim/shortcuts.vim diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 253aff0..8fecea2 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -7,13 +7,14 @@ bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files" shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc" +vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim" ranger_shortcuts="/dev/null" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" vifm_shortcuts="/dev/null" # Remove, prepare files -rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" 2>/dev/null +rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null printf "# vim: filetype=sh\\n" > "$fish_shortcuts" printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" @@ -27,7 +28,8 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; printf(\"config.bind(';%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ; printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" ; - printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }" + printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; + printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }" # Format the `files` file in the correct syntax and sent it to both configs. eval "echo \"$(cat "$bmfiles")\"" | \ @@ -37,4 +39,5 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" ; - printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }" + printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; + printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }" From 953d85619a8637e64da5344e727f443046187c74 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Tue, 29 Mar 2022 03:28:41 +0200 Subject: [PATCH 3/3] Replace youtube-dl with yt-dlp system-wide (#1019) * Replace youtube-dl with yt-dlp in qndl * Replace youtube-dl with yt-dlp in dmenuhandler * Replace youtube-dl with yt-dlp in newsboat config * Replace youtube-dl with yt-dlp in aliasrc Co-authored-by: Luke Smith --- .config/newsboat/config | 2 +- .config/shell/aliasrc | 2 +- .local/bin/dmenuhandler | 6 +++--- .local/bin/qndl | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/newsboat/config b/.config/newsboat/config index 69d8960..b7a78da 100644 --- a/.config/newsboat/config +++ b/.config/newsboat/config @@ -32,7 +32,7 @@ color article white default bold browser linkhandler macro , open-in-browser macro t set browser "qndl" ; open-in-browser ; set browser linkhandler -macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best" ; open-in-browser ; set browser linkhandler +macro a set browser "tsp yt-dlp --embed-metadata -xic -f bestaudio/best" ; open-in-browser ; set browser linkhandler macro v set browser "setsid -f mpv" ; open-in-browser ; set browser linkhandler macro w set browser "lynx" ; open-in-browser ; set browser linkhandler macro d set browser "dmenuhandler" ; open-in-browser ; set browser linkhandler diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index a5cd9e1..27d4527 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -18,7 +18,7 @@ alias \ rm="rm -vI" \ bc="bc -ql" \ mkd="mkdir -pv" \ - yt="youtube-dl --add-metadata -i" \ + yt="yt-dlp --embed-metadata -i" \ yta="yt -x -f bestaudio/best" \ ffmpeg="ffmpeg -hide_banner" diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index ce9159d..3e5055f 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -4,13 +4,13 @@ # some choice programs to use to open it. feed="${1:-$(printf "%s" | dmenu -p 'Paste URL or file path')}" -case "$(printf "Copy URL\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dl\\nqueue yt-dl audio" | dmenu -i -p "Open it with?")" in +case "$(printf "Copy URL\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in "Copy URL") echo "$feed" | xclip -selection clipboard ;; mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;; "mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;; "mpv float") setsid -f "$TERMINAL" -e mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$feed" >/dev/null 2>&1 ;; - "queue yt-dl") qndl "$feed" >/dev/null 2>&1 ;; - "queue yt-dl audio") qndl "$feed" 'youtube-dl --add-metadata -icx -f bestaudio/best' >/dev/null 2>&1 ;; + "queue yt-dlp") qndl "$feed" >/dev/null 2>&1 ;; + "queue yt-dlp audio") qndl "$feed" 'yt-dlp --embed-metadata -icx -f bestaudio/best' >/dev/null 2>&1 ;; "queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;; PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;; sxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;; diff --git a/.local/bin/qndl b/.local/bin/qndl index f6fbe87..48bc61e 100755 --- a/.local/bin/qndl +++ b/.local/bin/qndl @@ -5,7 +5,7 @@ base="$(basename "$1")" notify-send "⏳ Queuing $base..." cmd="$2" -[ -z "$cmd" ] && cmd="youtube-dl --add-metadata -ic" +[ -z "$cmd" ] && cmd="yt-dlp --embed-metadata -ic" idnum="$(tsp $cmd "$1")" realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")" tsp -D "$idnum" mv "$base" "$realname"