Skip to content

Instantly share code, notes, and snippets.

@cwithers2
cwithers2 / md_con.sh
Last active August 27, 2021 06:13
convert a Markdown file to an HTML file with the same name
#!/usr/bin/env bash
#convert a Markdown file to an html file with the same name
MFILE=$1
HFILE="${MFILE%.*}.html"
STYLE="$HOME/Templates/style.css"
if [ "$2" ]; then
>&2 echo "Error: Too many arguments"
exit 1
fi
@cwithers2
cwithers2 / screenshot.py
Last active August 25, 2021 07:03
A screen capture wrapper
#!/usr/bin/env python3
#A screen capture wrapper.
#externally depends on maim, xdotool and xrandr
#This script expects one argument from the values ["win", "sel", "all"],
#$./screenshot win #captures the current window
#$./screenshot sel #captures a user defined rectangle
@cwithers2
cwithers2 / copyc.sh
Created August 25, 2021 06:51
copy pixel color to clipboard
#!/usr/bin/env sh
#copy pixel color to clipboard
grabc | head -n 1 -c -1 | xclip -selection clipboard
@cwithers2
cwithers2 / tts.sh
Created August 25, 2021 06:50
turn stdin into speech
#!/usr/bin/env sh
#turn stdin into speech
gtts-cli -f - | ffplay -i - -nodisp -autoexit
@cwithers2
cwithers2 / lofi.sh
Last active March 2, 2022 05:19
stream audio and video from lofi hip hop radio
#!/usr/bin/env sh
#stream audio and video from lofi hip hop radio
url='https://youtu.be/5qap5aO4i9A'
quality=92
buffer=4096
title='lofi hip hop radio'
youtube-dl -f $quality --buffer-size $buffer -o - "$url" |\
ffplay -window_title "$title" -i -