Skip to content

Commit

Permalink
bashrc
Browse files Browse the repository at this point in the history
  • Loading branch information
EnigmaCurry committed Dec 10, 2023
1 parent d86628a commit dfc2d6c
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

PS1='[\u@\h \W]\$ '
PATH=${PATH}:${HOME}/bin:${HOME}/.cargo/bin
EDITOR=emacsclient
export EDITOR=emacsclient
export ENIGMACURRY_EMACS_DEV=true

eval $(keychain --eval --quiet)

Expand All @@ -16,6 +17,11 @@ alias grep='grep --color=auto'
alias bb='rlwrap bb'
alias ec="${HOME}/git/vendor/enigmacurry/emacs/ec"

## Rustup cargo environment
## On a new machine, you should run rustup-init first.
test -f "$HOME/.cargo/env" && source "$HOME/.cargo/env"

## Emacs vterm hooks:
vterm_printf() {
if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then
# Tell tmux to pass the escape sequences through
Expand All @@ -38,7 +44,6 @@ vterm_prompt_end(){
}
PS1=$PS1'\[$(vterm_prompt_end)\]'


#### To enable Bash shell completion support for d.rymcg.tech,
#### add the following lines into your ~/.bashrc ::
if [[ -d ${HOME}/git/vendor/enigmacurry/d.rymcg.tech ]]; then
Expand All @@ -47,3 +52,30 @@ if [[ -d ${HOME}/git/vendor/enigmacurry/d.rymcg.tech ]]; then
## Example project alias: creates a shorter command used just for the Traefik project:
__d.rymcg.tech_project_alias traefik
fi

## yt-dlp
## Watch any youtube/invidious video URL (or any URL yt-dlp supports) at the highest quality:
## Can read URL input directly if the argument is left blank (incognito mode)
## (Sometimes yt doesn't work, so use yt-720 as a backup)
yt() {
STREAM=$1; [[ "$STREAM" == "" ]] && read -e -p "Enter stream: " STREAM
yt-dlp -f bestvideo+bestaudio "$STREAM" -o - | mpv - --fs -force-seekable=yes
}
## Watch youtube/invidious video URL (or any URL yt-dlp supports)
## Uses a medium quality pre-muxed stream (its usually about 720p).
## Can read URL input directly if the argument is left blank (incognito mode)
## (yt-720 has higher reliability than yt, but its lower quality)
yt-720() {
STREAM=$1; [[ "$STREAM" == "" ]] && read -e -p "Enter stream: " STREAM
yt-dlp "$STREAM" -o - | mpv - --fs -force-seekable=yes
}
## Download best quality video and audio and mux together:
yt-download() {
STREAM=$1; [[ "$STREAM" == "" ]] && read -e -p "Enter stream: " STREAM
yt-dlp -f bestvideo+bestaudio "$STREAM" --merge-output-format mp4
}
## Download youtube audio only
yt-audio() {
STREAM=$1; [[ "$STREAM" == "" ]] && read -e -p "Enter stream: " STREAM
yt-dlp -x --audio-format mp3 $STREAM
}

0 comments on commit dfc2d6c

Please sign in to comment.