This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MailCap | |
audio/*; /usr/bin/play %s; needsterminal | |
video/*; /usr/bin/mpv %s; needsterminal | |
image/*; /usr/bin/fbi%s; needsterminal | |
text/html; /usr/bin/w3m %s; needsterminal | |
application/pdf; /usr/bin/fbgs -xxl %s; needsterminal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
BG_DIR="/usr/share/backgrounds" | |
OSID=$(awk -F= "/LIKE/"'{print $2}' /etc/os-release) | |
BG="$BG_DIR/**/*${(C)OSID}*.png"; BG=$(eval echo "$BG") | |
FONT_NAME=$( awk -F= "/FONT/"'{print $2}' /etc/vconsole.conf) | |
FONT_ALIAS=$(fc-list | awk "/$FONT_NAME/"'{print $2}') | |
FONT_SIZE="${${FONT_NAME#*-}:1:2}" | |
export FBTERM_BACKGROUND_IMAGE="1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
mkdir -p $1; cd $1; pwd | |
PKG_LIST=$(paru -F -x ".*$1(-.[a-z]+)?(.sh|$)" | \ | |
awk -F '/| ' "/^[a-z]/"'{print $2}') | |
for PKG in $PKG_LIST; do | |
paru -S -d -d -w $PKG | |
mv -v $PKG_DIR/$PKG-* . | |
tar --one-top-level --wildcards --zstd -x \*$1\* -v -f $PKG-* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASE="FrontRow.png"; LOGO="Kodi.png"; PNG="${LOGO%.*}-$BASE" | |
ICNS=${PNG/.png/.icns}; SIZE=$(file "$BASE" | cut -d' ' -f5) | |
for n in {0..3}; do eval S$n="$[$SIZE/(2**$n)]"; done | |
DIM="${S2}x${S2}"; POS="+$[($S2+$S3)]+$[($S0/3)-$S3]" | |
convert $BASE \( $LOGO -geometry $DIM$POS \) \ | |
-compose soft-light -composite $PNG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Play the last video watched on YouTube in MPV with subtitles. | |
L="${2-${${LANG%.*}%_*}}"; SIZE="${3-48}"; EXT="${4-vtt}"; FMT="${5-135+140}" # Set variables. | |
ID=$(yt-dlp -v --get-id --playlist-items ${1-1} \ | |
--cookies-from-browser chrome+gnomekeyring :ythistory) # Set the video's ID. | |
SUB=$(yt-dlp youtu.be/$ID --write-subs --sub-format vtt --sub-langs $L \ | |
--print '%(requested_subtitles)j' | jq -M -r '.[]|.url') # Set the subtitles' URL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Extract logos from folder icons | |
DL="Downloads"; G="Generic" | |
U="Utilities"; c="compare" | |
SB="Sidebar"; f="format" | |
I="Icon"; F="Folder" | |
mkdir -v Core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Rogue Bunnies Trading Cards DownLoader | |
URL="https://tradingcards.roguebunnies.com" | |
API="https://api.gigantik.io\ | |
/marketplace/tokens/[1738371-1775895]" | |
PT='function glpf4() {getline; print $4}; \ | |
/"type/{glpf4(); glpf4()}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
WEEK=($(LC_ALL="POSIX" locale -k day | gawk -v FS=';' -v RS='"' '/[a-z]$/')) | |
open "https://goo.gl/maps/VrA8z886JGGvYvBh7"; sleep 10; N="${#WEEK}"; SEQ=$(seq 0 $[$N-1]) | |
CHT="cht=p"; CHS="chs=999x999"; CHP="chp=$(bc -l <<< '6*a(1)')"; CHL="chl=$(seq -s '|' 7 19)"; N="6" | |
CHLPS="chlps=font.size,25|textStrokeWidth,5|textStrokeColor,FFFFFF|color,000000|align,end|offset,200" | |
CHCO="chco=7F7F7F|7F0000|FF0000|FF7F00|FFFF00|7FFF00|00FF00|00FF7F|00FFFF|007FFF|0000FF|7F00FF|FF00FF" | |
TAB=($(chrome-cli source | gawk -v FS='%? ' -v RS='"' '/ [0-9]+% .*:00/ {if ($3 != 0) print $3}' | rs -C',' $N)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN{ printf( "%s\n\n", ";FFMETADATA1"); t=0} | |
/duration/{ printf( "%s\n%s%d\n%s%.0f\n%s%.0f\n\n", "[CHAPTER]", "TIMEBASE=1/", 10^6, "START=", t*10^6, "END=", $5*10^6); t=$5} | |
END{ printf( "%s\n%s%d\n%s%.0f\n%s%.0f\n\n", "[CHAPTER]", "TIMEBASE=1/", 10^6, "START=", t*10^6, "END=", d*10^6)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -L -O github.com/alphacep/vosk-api/archive/refs/heads/master.zip | |
unzip master.zip; rm master.zip; cd vosk-api-master/python/example; pwd | |
curl -L -O alphacephei.com/kaldi/models/vosk-model-small-en-us-0.15.zip | |
curl -L -O alphacephei.com/kaldi/models/vosk-model-small-it-0.4.zip | |
unzip *-model-*-en-*.zip; unzip *-model-*-it-*.zip; rm *.zip; cd ${0%/*} | |
pwd; chmod +x vosk-srt.sh; cp -v vosk-srt.sh /usr/local/bin/vosk-srt | |
sudo mv -v $OLDPWD $(pip show vosk | awk '/Loc/{print $2}')/vosk-api |