Merge scripts into one repo
This commit is contained in:
commit
7656235b00
|
@ -0,0 +1,9 @@
|
|||
#!/bin/zsh
|
||||
|
||||
CACHE=~/.cache/ansbile-mods
|
||||
ENDPOINT="https://docs.ansible.com/ansible/latest/modules"
|
||||
IFS=$'\n'
|
||||
([ ! -r $CACHE ] || [ ! -s $CACHE ]) && curl -sL "${ENDPOINT}/list_of_all_modules.html" | grep -oP '(?<=\<span class="std std-ref"\>).*(?=\<\/span\>)' > $CACHE
|
||||
NAMES=($(< $CACHE))
|
||||
SEL=$((for i in ${NAMES}; do print "$i"; done) | dmenu -i -l 20 -p "Module")
|
||||
[ ! -z $SEL ] && xdg-open "${ENDPOINT}/${SEL%% *}_module.html"
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/zsh
|
||||
|
||||
IFS=$'\n'
|
||||
declare -A bookmarks
|
||||
NAMES=()
|
||||
for i in ${1}/**/*.*; do
|
||||
for x in $(< $i); do
|
||||
local NAME="${x#* } | ${i##$1/}"
|
||||
NAMES+=$NAME
|
||||
bookmarks[$NAME]=${x%% *}
|
||||
done
|
||||
done
|
||||
exec xdg-open "${bookmarks[$((for i in ${NAMES}; do print ${i}; done) | dmenu -i -l 20 -p "Bookmarks")]}"
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/zsh
|
||||
|
||||
FILES=(~/.password-store/**/*.gpg)
|
||||
PASS="$(for i in $FILES; do print ${${i#*/.password-store/}%.gpg}; done | dmenu -i -l 30 -p 'Password/OTP')"
|
||||
[ ! -z $PASS ] && pass $([ -z ${PASS#*-otp} ] && <<< otp) $PASS -c
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/zsh
|
||||
() {
|
||||
zmodload zsh/stat
|
||||
local feedpath=~/.sfeed/feeds
|
||||
setopt local_options shwordsplit
|
||||
local vids=()
|
||||
local IFS=$'\n'
|
||||
for f in $feedpath/YouTube\ -\ *; do
|
||||
local IFS=$'\n'
|
||||
local content=($(< $f))
|
||||
local IDS=()
|
||||
for i in {1..5}; do
|
||||
local IFS=$'\t'
|
||||
local options=(${content[$i]})
|
||||
if [[ ${options[6]:0:9} == "yt:video:" ]] && [[ ${IDS[(r)${options[6]:9:11}]} != ${options[6]:9:11} ]]; then
|
||||
IDS+=(${options[6]:9:11})
|
||||
vids+=("$(printf '%s | ID: %s - %.40s - %s' $options[1] ${options[6]:9:11} $options[7] $options[2])")
|
||||
fi
|
||||
done
|
||||
done
|
||||
local IFS=$'\n'
|
||||
[ -z "${vids}" ] && return
|
||||
local title=$(print -l ${${(nO)vids}#* | } | dmenu -i -l 35)
|
||||
[ ! -z $title ] && exec mpv --profile=v ytdl://${title:4:11}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/zsh
|
||||
|
||||
source ~/.config/twitch-subs
|
||||
LIST=()
|
||||
|
||||
for cur in $SUBSCRIPTIONS; do
|
||||
<<< "Fetching twitch.tv/$cur" >&2
|
||||
desc="$(youtube-dl --get-description "https://twitch.tv/$cur" 2>/dev/null)"
|
||||
if [ -z "$desc" ]; then
|
||||
<<< "$cur is offline." >&2
|
||||
else
|
||||
LIST+=("$cur | $desc")
|
||||
fi
|
||||
done
|
||||
print -l $LIST > ~/.cache/twitch
|
Loading…
Reference in New Issue