Skip to content

Instantly share code, notes, and snippets.

@cwillsey06
Last active April 1, 2023 21:57
Show Gist options
  • Select an option

  • Save cwillsey06/72d1b333f9569b7acc720b7c9f53b831 to your computer and use it in GitHub Desktop.

Select an option

Save cwillsey06/72d1b333f9569b7acc720b7c9f53b831 to your computer and use it in GitHub Desktop.
backup
### zshrc
### cwillsey
### 2022-11-1 [14:00]
### oh-my-zsh configuration
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="barebones" # set by `omz`
plugins=(git)
source $ZSH/oh-my-zsh.sh
### exports:path
function appendpath() {
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}
appendpath "$HOME/.foreman/bin"
appendpath "$HOME/.local/bin"
appendpath "$HOME/.cargo/bin"
unset appendpath
### exports
export $(dbus-launch)
export VOIDNSRUN_DIR="/vglibc"
export VOIDNSRUNDO_BIN="/vglibc/usr/local/bin/voidnsrundo"
export TERM="xterm-256color"
export HISTCONTROL=ignoredups:erasedups
export EDITOR="nvim"
export VISUAL="nvim"
export PATH
### If not running interactively, exit
[[ $- != *i* ]] && return
### aliases
## archive extractor
# usage: ex <file>
function ex() {
if [ -f "$1" ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) unzstd $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# download and extract
# tarballs via the web
function xurl() {
curl "$1" -o - | tar xz
}
# download and patch
# files via the web
function ipatch() {
curl "$1" | patch -p1
}
# comvvert video w/
# ffmpeg i/o system
function conv() {
[ -z "$1" ] && return;
[ -z "$2" ] && return;
local input="$1"
shift
ffmpeg -i "$input" "$@"
}
# compile and run c
# code and programs
function cx() {
local exec
[ -n "$1" ] && exec="$1" || exec='./main'
make && "$exec"
}
# quick cd
alias suckless='cd ~/src/suckless/'
## yt-dlp
alias yta-aac='yt-dlp --extract-audio --audio-format aac '
alias yta-best='yt-dlp --extract-audio --audio-format best '
alias yta-flac='yt-dlp --extract-audio --audio-format flac '
alias yta-m4a='yt-dlp --extract-audio --audio-format m4a '
alias yta-mp3='yt-dlp --extract-audio --audio-format mp3 '
alias yta-opus='yt-dlp --extract-audio --audio-format opus '
alias yta-vorbis='yt-dlp --extract-audio --audio-format vorbis '
alias yta-wav='yt-dlp --extract-audio --audio-format wav '
alias ytv-best='yt-dlp -f bestvideo+bestaudio '
# vimish
alias q='exit'
alias e='nvim'
alias vim='nvim'
# spotifyd no daemon
alias spotifynd='spotifyd --backend pulseaudio --volume-normalisation --no-daemon'
# ranger
alias ra='ranger'
# confirm before overwriting something
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
Section "Monitor"
Identifier "DisplayPort-1"
Option "Primary" "true"
Option "PreferredMode" "1920x1080_60.00"
EndSection
Section "Monitor"
Identifier "DisplayPort-0"
Option "RightOf" "DisplayPort-1"
Option "PreferredMode" "1920x1080_60.00"
EndSection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment