From 452b6aa9e8d7040cdb80f4724f42a98139e701d9 Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Wed, 24 Feb 2021 05:05:20 +0300 Subject: [PATCH] Cleanup README --- README.md | 9 ++-- home/.config/gallery-dl/config.json | 2 +- home/.local/bin/ytmenu | 70 ----------------------------- setup/scripts.sh | 7 ++- 4 files changed, 10 insertions(+), 78 deletions(-) delete mode 100755 home/.local/bin/ytmenu diff --git a/README.md b/README.md index 948580a..6c6503b 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,10 @@ - **Shell:** [fish](https://github.com/fish-shell/fish-shell) - **Shell prompt:** [starship](https://starship.rs/) - **Anime/Manga/Wallpaper:** [gallery-dl](https://github.com/mikf/gallery-dl) / [mangadl-bash](https://github.com/Akianonymus/mangadl-bash), [anime-downloader](https://github.com/anime-dl/anime-downloader) + [trackma](https://github.com/z411/trackma) + [adl](https://github.com/RaitaroH/adl) / [anigrab](https://github.com/ngomile/anigrab) - - **CLI/TUI tools for the Internet:** [translate-shell](https://github.com/soimort/translate-shell), [ddgr](https://github.com/jarun/ddgr), [howdoi](https://github.com/gleitz/howdoi), [tuxi](https://github.com/Bugswriter/tuxi), [amfora](https://github.com/makeworld-the-better-one/amfora), [cointop](https://github.com/miguelmota/cointop), [newsboat](https://github.com/newsboat/newsboat), [youtube-dl](https://github.com/ytdl-org/youtube-dl) + [ytmdl](https://github.com/deepjyoti30/ytmdl), [github-cli](https://github.com/cli/cli), [pup](https://github.com/ericchiang/pup), [tmpsms](https://github.com/sdushantha/tmpsms), [tmpmail](https://github.com/sdushantha/tmpmail), [weechat](https://github.com/weechat/weechat), [curl](https://curl.haxx.se) / [wget](https://www.gnu.org/software/wget/wget.html) / [aria2](https://github.com/aria2/aria2), [tremc](https://github.com/tremc/tremc) + [transmission](https://github.com/transmission/transmission) / [rtorrent](https://github.com/rakshasa/rtorrent), [goaccess](https://github.com/allinurl/goaccess) - - **CLI/TUI tools for other things:** [farge](https://github.com/sdushantha/farge), [tt](https://github.com/runrin/tt), [forgit](https://github.com/wfxr/forgit), [borg](https://github.com/borgbackup/borg), [wendy](https://git.z3bra.org/wendy/log.html), [tokei](https://github.com/XAMPPRocky/tokei), [onefetch](https://github.com/o2sh/onefetch), [calcurse](https://github.com/lfos/calcurse), [qalculate](https://github.com/Qalculate/libqalculate), [fzf](https://github.com/junegunn/fzf), [fd](https://github.com/sharkdp/fd), [ripgrep](https://github.com/BurntSushi/ripgrep), [atool](http://www.nongnu.org/atool/), [rsync](https://rsync.samba.org/), [bottom](https://github.com/clementtsang/bottom), [hyperfine](https://github.com/sharkdp/hyperfine), [delta](https://github.com/dandavison/delta), [bat](https://github.com/sharkdp/bat), [glow](https://github.com/charmbracelet/glow) / [mdcat](https://github.com/lunaryorn/mdcat) / [mdr](https://github.com/MichaelMure/mdr), [exa](https://github.com/ogham/exa), [pandoc](https://github.com/jgm/pandoc), [csview](https://github.com/wfxr/csview), [libsixel](https://github.com/saitoha/libsixel), [buku](https://github.com/jarun/buku), [jq](https://github.com/stedolan/jq), sysstat, psmisc, wireless_tools, tree + - **CLI/TUI tools for the Internet:** [translate-shell](https://github.com/soimort/translate-shell), [ddgr](https://github.com/jarun/ddgr), [howdoi](https://github.com/gleitz/howdoi), [amfora](https://github.com/makeworld-the-better-one/amfora), [cointop](https://github.com/miguelmota/cointop), [newsboat](https://github.com/newsboat/newsboat), [youtube-dl](https://github.com/ytdl-org/youtube-dl) + [ytmdl](https://github.com/deepjyoti30/ytmdl), [github-cli](https://github.com/cli/cli), [pup](https://github.com/ericchiang/pup), [weechat](https://github.com/weechat/weechat), [curl](https://curl.haxx.se) / [wget](https://www.gnu.org/software/wget/wget.html) / [aria2](https://github.com/aria2/aria2), [tremc](https://github.com/tremc/tremc) + [transmission](https://github.com/transmission/transmission) / [rtorrent](https://github.com/rakshasa/rtorrent), [goaccess](https://github.com/allinurl/goaccess) + - **CLI/TUI tools for other things:** [tt](https://github.com/runrin/tt), [forgit](https://github.com/wfxr/forgit), [borg](https://github.com/borgbackup/borg), [wendy](https://git.z3bra.org/wendy/log.html), [tokei](https://github.com/XAMPPRocky/tokei), [onefetch](https://github.com/o2sh/onefetch), [calcurse](https://github.com/lfos/calcurse), [qalculate](https://github.com/Qalculate/libqalculate), [fzf](https://github.com/junegunn/fzf), [fd](https://github.com/sharkdp/fd), [ripgrep](https://github.com/BurntSushi/ripgrep), [atool](http://www.nongnu.org/atool/), [rsync](https://rsync.samba.org/), [bottom](https://github.com/clementtsang/bottom), [hyperfine](https://github.com/sharkdp/hyperfine), [delta](https://github.com/dandavison/delta), [bat](https://github.com/sharkdp/bat), [glow](https://github.com/charmbracelet/glow) / [mdcat](https://github.com/lunaryorn/mdcat) / [mdr](https://github.com/MichaelMure/mdr), [exa](https://github.com/ogham/exa), [pandoc](https://github.com/jgm/pandoc), [csview](https://github.com/wfxr/csview), [libsixel](https://github.com/saitoha/libsixel), [buku](https://github.com/jarun/buku), [jq](https://github.com/stedolan/jq), sysstat, psmisc, wireless_tools, tree -> `Emacs` deserves its own set of dependencies listed, but I'm lazy. Check Doom config for details +> `Emacs` deserves its own set of dependencies listed, but I'm lazy -> Check my Doom config for details > zsh requires adding `export ZDOTDIR=$HOME/.config/zsh` to **/etc/zsh/zshenv** @@ -57,7 +57,7 @@ - [ ] ion / oksh / nushell / osh / xonsh / elvish / oh - [ ] NixOS / Guix / Gentoo / FreeBSD - [ ] New Neovim's config in Lua -- [ ] My own ~/.emacs.d +- [ ] Independent ~/.emacs.d - [ ] Org Babel to manage dotfiles ### :star2: Credits & License @@ -73,7 +73,6 @@ - I use some scripts from other people: - [some fzf scripts](https://github.com/DanielFGray/fzf-scripts) - [colorscripts](https://gitlab.com/dwt1/shell-color-scripts) - - `ytmenu` from [here](https://github.com/sayan01/scripts) - Artists for **kawaii** wallpapers: [@rimuu](https://rimuu.com/), [@hiten](https://www.pixiv.net/users/490219/artworks), [@Tiv](https://www.pixiv.net/en/users/35081), [@mery](https://www.pixiv.net/en/users/2750098), [@Mashima_saki](https://www.pixiv.net/en/users/18403608), [@Yuuki_Tatsuya](https://www.pixiv.net/en/users/27691), [@Bison倉鼠](https://www.pixiv.net/en/users/333556/artworks), [@Dana](https://twitter.com/hapong07), [@gomzi](https://twitter.com/gcmzi), [@Rella](https://twitter.com/Rellakinoko), [@dnwls3010](https://twitter.com/dnwls3010), [@Shigure_Ui](https://www.pixiv.net/en/users/431873), [@QuAn_](https://www.pixiv.net/en/users/6657532/artworks), [@杉87](https://twitter.com/k_su_keke1121), [@fuzichoco](https://twitter.com/fuzichoco), [@Astero](https://twitter.com/asteroid_ill), [@shin556](https://www.pixiv.net/en/users/642762) - Others are under MIT license diff --git a/home/.config/gallery-dl/config.json b/home/.config/gallery-dl/config.json index 9b2ccfe..be27d38 100644 --- a/home/.config/gallery-dl/config.json +++ b/home/.config/gallery-dl/config.json @@ -17,7 +17,7 @@ "filename": "{id}.{extension}", "directory": [ "Pixiv", - "{user[name]-user[id]}" + "{user[name]}-{user[id]}" ], "avatar": false, "ugoira": true, diff --git a/home/.local/bin/ytmenu b/home/.local/bin/ytmenu deleted file mode 100755 index 3af00f3..0000000 --- a/home/.local/bin/ytmenu +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# dependencies: mpv youtube-dl fzf rofi/dmenu -# search videos and playlists on youtube and play them in mpv, without an API -# usage: -# yt asks for input in stdin, prompts using fzf -# yt search query takes input from the passed arg, prompts using fzf -# yt -r takes input and prompts using rofi ($guicmd) - -agent="Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0" -defcmd="fzf" -guicmd="wofi -d -i" -promptcmd="$defcmd" -if [ -z "$*" ]; then - echo -n "Search: " - read -r query -else - case "$1" in - -r) query=$(echo | $guicmd -p "Search: ") - promptcmd="$guicmd -p Video:";; - *) query="$*";; - esac -fi -if [ -z "$query" ]; then exit; fi -# sanitise the query -query=$(sed \ - -e 's|+|%2B|g'\ - -e 's|#|%23|g'\ - -e 's|&|%26|g'\ - -e 's| |+|g'\ - <<< "$query") -# fetch the results with the $query and -# delete all escaped characters -response="$(curl -s "https://www.youtube.com/results?search_query=$query" -A "$agent" |\ - sed 's|\\.||g')" -# if unable to fetch the youtube results page, inform and exit -if ! grep -q "script" <<< "$response"; then echo "unable to fetch yt"; exit 1; fi -# regex expression to match video and playlist entries from yt result page -vgrep='"videoRenderer":{"videoId":"\K.{11}".+?"text":".+?[^\\](?=")' -pgrep='"playlistRenderer":{"playlistId":"\K.{34}?","title":{"simpleText":".+?[^\"](?=")' -# grep the id and title -# return them in format id (type) title -getresults() { - grep -oP "$1" <<< "$response" |\ - awk -F\" -v p="$2" '{ print $1 "\t" p " " $NF}' -} -# get the list of videos/playlists and their ids in videoids and playlistids -videoids=$(getresults "$vgrep") -playlistids=$(getresults "$pgrep" "(playlist)") -# if there are playlists or videos, append them to list -[ -n "$playlistids" ] && ids="$playlistids\n" -[ -n "$videoids" ] && ids="$ids$videoids" -# url prefix for videos and playlists -videolink="https://youtu.be/" -playlink="https://youtube.com/playlist?list=" -# prompt the results to user infinitely until they exit (escape) -while true; do - clear - echo "Choose Video/Playlist to play: " - choice=$(echo -e "$ids" | cut -d' ' -f2 | $promptcmd) # dont show id - if [ -z "$choice" ]; then exit; fi # if esc-ed then exit - id=$(echo -e "$ids" | grep -Fwm1 "$choice" | cut -d' ' -f1) # get id of choice - echo -e "$choice\t($id)" - case $id in - # 11 digit id = video - ???????????) mpv "$videolink$id";; - # 34 digit id = playlist - ??????????????????????????????????) mpv "$playlink$id";; - *) exit ;; - esac -done diff --git a/setup/scripts.sh b/setup/scripts.sh index 8eb7559..558ec5a 100755 --- a/setup/scripts.sh +++ b/setup/scripts.sh @@ -12,5 +12,8 @@ chmod 755 $HOME/.local/bin/farge curl -fL "https://raw.githubusercontent.com/Bugswriter/tuxi/main/tuxi" -o $HOME/.local/bin/tuxi chmod 755 $HOME/.local/bin/tuxi -curl -fL "https://github.com/RaitaroH/adl/raw/master/adl" -o $HOME/.local/bin/adl -chmod 755 $HOME/.local/bin/adl +curl -fL "https://github.com/RaitaroH/adl/raw/master/adl" -o $HOME/.local/bin/fzf/adl +chmod 755 $HOME/.local/bin/fzf/adl + +curl -fL "https://github.com/pystardust/ytfzf/raw/master/ytfzf" -o $HOME/.local/bin/fzf/ytfzf +chmod 755 $HOME/.local/bin/fzf/ytfzf