diff options
Diffstat (limited to 'home/xyz/.local/bin')
| -rwxr-xr-x | home/xyz/.local/bin/curlkg | 3 | ||||
| -rwxr-xr-x | home/xyz/.local/bin/curlncm | 3 | ||||
| -rwxr-xr-x | home/xyz/.local/bin/curlqb | 27 | ||||
| -rwxr-xr-x | home/xyz/.local/bin/gitmetap | 6 | ||||
| -rwxr-xr-x | home/xyz/.local/bin/mmi | 3 | ||||
| -rwxr-xr-x | home/xyz/.local/bin/orgext | 6 | ||||
| -rwxr-xr-x | home/xyz/.local/bin/upd | 36 | 
7 files changed, 31 insertions, 53 deletions
| diff --git a/home/xyz/.local/bin/curlkg b/home/xyz/.local/bin/curlkg index 9389e680..624eb689 100755 --- a/home/xyz/.local/bin/curlkg +++ b/home/xyz/.local/bin/curlkg @@ -25,8 +25,7 @@ shift $((OPTIND-1))  download_dir="${1:-"$PWD"}"  [ -d "$download_dir" ] || mkdir -p "$download_dir" -get_json ()  -{ +get_json () {  	curl -s -G --data-urlencode type=get_uinfo -d outCharset=utf-8 -d start="$1" -d num=$num -d share_uid="$uid" "$homepage_url" | sed 's/.*({\(.*\)}).*/{\1}/' >> "$tmp_json_file"  } diff --git a/home/xyz/.local/bin/curlncm b/home/xyz/.local/bin/curlncm index 582214ac..4a4fbba6 100755 --- a/home/xyz/.local/bin/curlncm +++ b/home/xyz/.local/bin/curlncm @@ -21,8 +21,7 @@ request_id=$(date +'%s%3N')_$(seq -w 1 1000 | shuf -n1)  user_agent='Mozilla/5.0 (Linux; U; Android 9; zh-cn; Redmi Note 8 Build/PKQ1.190616.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.5.22'  cookie="$(printf '"appver":"8.0.0","versioncode":"140","buildver":"1623455100","resolution":"1920x1080","__csrf":"","os":"pc","requestId":"%s"' "$request_id")" -die ()  -{ +die () {  	echo "error: $*" >&2  	exit 1  } diff --git a/home/xyz/.local/bin/curlqb b/home/xyz/.local/bin/curlqb index f98a41c8..a8a6baa5 100755 --- a/home/xyz/.local/bin/curlqb +++ b/home/xyz/.local/bin/curlqb @@ -1,18 +1,15 @@  #!/bin/sh -curl -s 'https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins' | awk -F'"' '/Plugins for Private sites/{exit} /\.py/{url=$2;getline;getline;getline;if($0 !~ /❗|✖/)print url}' | xargs curl -s -Z -L --remote-name-all --create-dirs --output-dir "$1" -- - -#curl -s 'https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins' | awk -F'"' '{ -#	if($0 ~ /Plugins for Private sites/) -#		exit -#	if($0 ~ /\.py/) -#	{ -#		url=$2 -#		getline -#		getline -#		getline -#		if($0 !~ /❗|✖/) -#			print url -#	} -#}' | xargs curl -s -Z -L --remote-name-all --create-dirs --output-dir "$1" -- +curl -s 'https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins' | awk -F'"' ' +/Plugins for Private sites/ {exit} +/\.py/ { +	url=$2 +	getline +	getline +	getline +	if($0 !~ /❗|✖/) +		print url +} +' | xargs curl -s -Z -L --remote-name-all --create-dirs --output-dir "$1" -- +#curl -s 'https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins' | awk -F'"' '/Plugins for Private sites/{exit} /\.py/{url=$2;getline;getline;getline;if($0 !~ /❗|✖/)print url}' | xargs curl -s -Z -L --remote-name-all --create-dirs --output-dir "$1" -- diff --git a/home/xyz/.local/bin/gitmetap b/home/xyz/.local/bin/gitmetap index 2a1e603e..5ebc8597 100755 --- a/home/xyz/.local/bin/gitmetap +++ b/home/xyz/.local/bin/gitmetap @@ -2,13 +2,11 @@  # -rw-r--r-- == binary 110100100 == octal 644  # https://stackoverflow.com/a/1796009 -$1 ls-tree -r --name-only --full-tree HEAD | awk -v a="$2/" '{printf("%s%s\n",a,$0)}' | tr '\n' '\0' | xargs -0 ls -ldA -- | awk ' -{ +$1 ls-tree -r --name-only --full-tree HEAD | awk -v a="$2/" '{printf("%s%s\n",a,$0)}' | tr '\n' '\0' | xargs -0 ls -ldA -- | awk '{  	k=0  	for(i=0;i<=8;i++)  		k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i)) -	if(k) -	{ +	if(k) {  		for(i=10;$i && $i!="->";i++)  			$9=$9" "$i  		printf("%0o %s %s %s\n",k,$3,$4,$9) diff --git a/home/xyz/.local/bin/mmi b/home/xyz/.local/bin/mmi index b3b5868f..959dd323 100755 --- a/home/xyz/.local/bin/mmi +++ b/home/xyz/.local/bin/mmi @@ -1,7 +1,6 @@  #!/bin/sh -mi () -{ +mi () {  	sudo make -B install  } diff --git a/home/xyz/.local/bin/orgext b/home/xyz/.local/bin/orgext index f1654d2c..de5dc695 100755 --- a/home/xyz/.local/bin/orgext +++ b/home/xyz/.local/bin/orgext @@ -5,14 +5,12 @@  # not sure if find here need -depth, not sure if mv here need -n and -T -outdir () -{  +outdir () {   	find . -type f -execdir mv -nt "$PWD" -- '{}' \+  	find . -mindepth 1 -maxdepth 1 -type d -delete  } -indir () -{ +indir () {  	find . -maxdepth 1 -type f | awk -F. '!a[$NF]++{print $NF}' | xargs mkdir --  	find . -mindepth 1 -maxdepth 1 -type d -execdir basename -az -- '{}' \+ | xargs -0 -I _ find . -maxdepth 1 -type f -name '*._' -execdir mv -t '_' -- '{}' \+  } diff --git a/home/xyz/.local/bin/upd b/home/xyz/.local/bin/upd index 65452b37..46592b68 100755 --- a/home/xyz/.local/bin/upd +++ b/home/xyz/.local/bin/upd @@ -1,7 +1,6 @@  #!/bin/sh -all () -{ +all () {  	fast  	usb  	qb @@ -12,8 +11,7 @@ all ()  }  # not in all -clean () -{ +clean () {  	nsxiv -c  	# my ways  	# -exec can't replace -execdir here @@ -25,32 +23,27 @@ clean ()  	rm "$HOME/.mozilla/firefox/xxxxxxxx.fly/prefs.js.backup."*  } -fast () -{ +fast () {  	pac  	misc  } -gall () -{ +gall () {  	gallery-dl --download-archive "$XDG_DOCUMENTS_DIR/database/gallery-dl.sqlite3" -d "$XDG_PICTURES_DIR/anime/gallery-dl/" -i "$XDG_CONFIG_HOME/myconf/gallery_urls"  } -userjs () -{ +userjs () {  	kill $(pidof "$BROWSER")  	"$HOME/.mozilla/firefox/xxxxxxxx.fly/prefsCleaner.sh" -s  	"$HOME/.mozilla/firefox/xxxxxxxx.fly/updater.sh" -us  } -g () -{ +g () {  	curlkg -u649b9e82272a348b -- "$XDG_MUSIC_DIR/not_pure/lan_lan/kg/"  	curlkg -u64949d822c25328c -- "$XDG_MUSIC_DIR/not_pure/cheng_ruan/kg/"  } -misc () -{ +misc () {  	cfg -c submodule foreach git pull  	nvim +PlugUpgrade +PlugClean! +PlugUpdate +qa  	tldr --update @@ -58,16 +51,14 @@ misc ()  	userjs  } -ncm () -{ +ncm () {  	curlncm -a48860966 -- "$XDG_MUSIC_DIR/not_pure/lan_lan/ncm/artist/"  	curlncm -a46703185 -- "$XDG_MUSIC_DIR/not_pure/cheng_ruan/ncm/artist/"  	curlncm -r793052426 -- "$XDG_MUSIC_DIR/not_pure/lan_lan/ncm/djradio/"  	curlncm -r792968433 -- "$XDG_MUSIC_DIR/not_pure/cheng_ruan/ncm/djradio/"  } -pac () -{ +pac () {  	sudo pacman --noconfirm -Syu  	paru --noconfirm -aSyu  	# part steal from aur comment @@ -76,19 +67,16 @@ pac ()  	sudo pacman -Fy  } -qb () -{ +qb () {  	rm -r -- "$HOME/programs/qbittorrent_search_plugins/"  	curlqb "$HOME/programs/qbittorrent_search_plugins/"  } -refl () -{ +refl () {  	sudo reflector --save /etc/pacman.d/mirrorlist --latest 200 --sort rate  } -usb () -{ +usb () {  	cfg -c push usb  	cfg -l push usb  	cfg -s push | 
