Change music aliases for FZF script

This commit is contained in:
Alexander Navarro 2023-11-01 11:58:07 -03:00
parent 5898f6b5a6
commit 720a4e6ca7
5 changed files with 63 additions and 54 deletions

View file

@ -108,7 +108,7 @@ window:
# Font configuration # Font configuration
font: font:
normal: normal:
family: JetBrainsMono NF family: JetBrainsMono Nerd Font
style: Regular style: Regular
bold: bold:
# family: JetBrainsMono NF # family: JetBrainsMono NF

View file

@ -28,7 +28,7 @@ return {
-- left aligned fixed size box with left aligned text -- left aligned fixed size box with left aligned text
MAP({ "n", "v" }, "gcb", cb.lcbox, "Create a comment box") MAP({ "n", "v" }, "gcb", cb.lcbox, "Create a comment box")
-- centered adapted box with centered text -- centered adapted box with centered text
MAP({ "n", "v" }, "gcl", cb.cline, "Create a comment line") MAP({ "n", "v" }, "gll", cb.cline, "Create a comment line")
end, end,
}, },
} }

View file

@ -42,18 +42,6 @@ alias \
du3='dust --reverse --min-size 1M --depth 3' \ du3='dust --reverse --min-size 1M --depth 3' \
cat='bat'; cat='bat';
## Music Streams
lofi_url="https://youtu.be/jfKfPfyJRdk"
nintendo_url="https://www.youtube.com/c/Henriko/live"
synthwave_url="https://www.youtube.com/live/4xDzrJKXOOY?si=3WUrIe4TWLO-fw9m"
alias \
music-lofi='mpv "$lofi_url" &>/dev/null &!' \
music-lofi-bg='ts lofi -d "mpv --no-video $lofi_url"' \
music-ninten='mpv "$nintendo_url" &>/dev/null &!' \
music-ninten-bg='ts lofi -d "mpv --no-video $nintendo_url"' \
music-synthwave='mpv "$synthwave_url" &>/dev/null &!' \
music-synthwave-bg='ts lofi -d "mpv --no-video $synthwave_url"'
# Misc # Misc
alias \ alias \
reload='exec $SHELL -l' \ reload='exec $SHELL -l' \

View file

@ -1,33 +1,21 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "${DOOTS}/config/zsh/functions/colors.zsh" source "${DOTS}/config/zsh/config/colors.zsh"
define_colors define_colors
# r̶u̶s̶t̶ linux cli/tui tools and apps that i use # linux cli/tui tools and apps that i use
# ( -v" "-v" "-V" "-V" "-V" "-v" "--version" "--version" "-V" "-V" "-v" "-V" "-V" "--version")
declare -A tools declare -A tools
tools=( tools=(
[alacritty]=" --version" [alacritty]=" --version"
[atuin]="󰳗 --version"
[bat]="󰭟 --version" [bat]="󰭟 --version"
[broot]="פּ --version" [btop]=" --version"
[btop]=" --version" [dust]=" --version"
[chafa]="󰈟 --version"
[cowsay]=" --version"
[cava]="󰺢 -v"
[delta]=" --version"
[dust]=" --version"
[exa]=" --version" [exa]=" --version"
[fd]=" --version" [fd]="--version"
[foot]=" --version" [fzf]="c --version"
[fuck]="󰚌 --version"
[fzf]=" --version"
[git]=" --version" [git]=" --version"
[kitty]=" --version"
[librewolf]=" --version" [librewolf]=" --version"
[lsd]=" --version"
[mpv]=" --version" [mpv]=" --version"
[pipes.sh]="ﳣ --version"
[neofetch]=" --version" [neofetch]=" --version"
[nvim]=" --version" [nvim]=" --version"
[rg]=" --version" [rg]=" --version"
@ -42,9 +30,9 @@ printf "${BLD}%-18s %-10s %-10s\n" "Tools" "Status" "Version"
printf "%s\n${RST}" "-----------------------------------------------" printf "%s\n${RST}" "-----------------------------------------------"
for tool in "${sorted_tools[@]}"; do for tool in "${sorted_tools[@]}"; do
IFS=' ' read -r -a tool_data <<< "${tools[$tool]}" IFS=' ' read -r -a tool_data <<<"${tools[$tool]}"
if command -v "$tool" &> /dev/null; then if command -v "$tool" &>/dev/null; then
version=$("$tool" "${tool_data[1]}" 2> /dev/null | awk '{ version=$("$tool" "${tool_data[1]}" 2>/dev/null | awk '{
for (i = 1; i <= NF; i++) { for (i = 1; i <= NF; i++) {
if ($i ~ /[0-9]+.[0-9]+([.][0-9]+)?/) { if ($i ~ /[0-9]+.[0-9]+([.][0-9]+)?/) {
print $i; print $i;

33
scripts/fzf-player Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
# ╭──────────────────────────────────────────────────────────╮
# │ Music Streams │
# ╰──────────────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────
# Saved streams
declare -A streams
streams[lofi]="https://youtu.be/jfKfPfyJRdk"
streams[nintendo]="https://www.youtube.com/c/Henriko/live"
streams[synthwave]="https://www.youtube.com/live/4xDzrJKXOOY?si=3WUrIe4TWLO-fw9m"
# ────────────────────────────────────────────────────────────
# play passed url if provided
url="$1"
shift
# defaults to celluloid, fallback to mpv
if command -v celluloid &>/dev/null; then
player="celluloid"
else
player="mpv --no-video"
fi
if [[ -z "$url" ]]; then
url="$(printf "%s\n" "${!streams[@]}" | fzf)"
url="${streams[$url]}"
fi
$player "$url"