Created
February 19, 2020 19:04
-
-
Save emaphp/724279dee8431b50458c1341a02e226a to your computer and use it in GitHub Desktop.
Personal Bash aliases
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
| # Refreshes the mpd song list | |
| function mpdupdate() { | |
| sudo killall mpd | |
| rm ~/.mpd/mpd.log && rm ~/.mpd/mpdstate && rm ~/.mpd/mpd.db | |
| mpd && sleep 30 | |
| # mpc ls | grep "^[A-Z]" | mpc add | |
| } | |
| alias mpcupdate="mpdupdate" | |
| alias music="mpd; ncmpcpp" | |
| # Converts a MP4 to WEBM | |
| function mp4towebm() { | |
| filename=$(basename -- "$1") | |
| filename="${filename%.*}" | |
| ffmpeg -i "$1" -c:v libvpx-vp9 -crf 8 -b:v 0 -c:a libvorbis "${filename}.webm" | |
| } | |
| # Converts a file to MP3 using pacpl | |
| function tomp3() { | |
| pacpl --to mp3 "$1" | |
| } | |
| # Converts all WEBM files in the folder to MP3s | |
| function convertall() { | |
| OIFS="$IFS" | |
| IFS=$'\n' | |
| for file in `find . -type f -name "*.webm"` | |
| do | |
| pacpl --to mp3 $file | |
| done | |
| IFS="$OIFS" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment