Browse Source

Fix mkcd alias, add some shellfunctions

cd is a built-in shell command that changes the internal shell state
via the chdir() syscall. This cannot be called from a script.
master
Riyyi 4 years ago
parent
commit
3668abad9b
  1. 9
      .config/zsh/.zshrc
  2. 14
      .local/bin/aliases

9
.config/zsh/.zshrc

@ -100,7 +100,6 @@ alias la="\ls -lAGh --color --group-directories-first"
alias less="less -x 4" alias less="less -x 4"
alias ls="ls --color --group-directories-first" alias ls="ls --color --group-directories-first"
alias md="mkdir -p" alias md="mkdir -p"
alias mkcd="aliases mkcd"
alias mv='mv -i' alias mv='mv -i'
alias pkill="pkill -9" alias pkill="pkill -9"
alias q="exit" alias q="exit"
@ -171,13 +170,15 @@ alias screencast="aliases screencast"
alias stream="aliases stream" alias stream="aliases stream"
alias weather="curl -s 'https://wttr.in/dordrecht?q&n&p' | head -n -3" alias weather="curl -s 'https://wttr.in/dordrecht?q&n&p' | head -n -3"
alias webmconvert="aliases webmconvert" alias webmconvert="aliases webmconvert"
alias workbench="GDK_SCALE=1 GDK_DPI_SCALE=1 mysql-workbench > /dev/null 2>&1 & disown" alias workbench="GDK_SCALE=1 GDK_DPI_SCALE=1 setsid -f -- mysql-workbench > /dev/null 2>&1"
alias ytv="youtube-dl -f bestvideo\[height\<=\?1080\]+bestaudio/best" alias ytv="youtube-dl -f bestvideo\[height\<=\?1080\]+bestaudio/best"
alias ytvb="youtube-dl -f bestvideo+bestaudio/best" alias ytvb="youtube-dl -f bestvideo+bestaudio/best"
alias yta="youtube-dl -f bestaudio/best -x --audio-format mp3 --audio-quality 0" # --embed-thumbnail" alias yta="youtube-dl -f bestaudio/best -x --audio-format mp3 --audio-quality 0" # --embed-thumbnail"
alias ytat="aliases ytaudio_thumbnail" alias ytat="aliases ytaudio_thumbnail"
zsh="/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" mkcd() { mkdir -p -- "$1" && cd -P -- "$1" || exit; }
[ -f "$zsh" ] && source "$zsh"; unset zsh
highlighting="/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
[ -f "$highlighting" ] && source "$highlighting"; unset highlighting
[ -f "$ZDOTDIR/.zshrc_extended" ] && source "$ZDOTDIR/.zshrc_extended" [ -f "$ZDOTDIR/.zshrc_extended" ] && source "$ZDOTDIR/.zshrc_extended"

14
.local/bin/aliases

@ -34,10 +34,6 @@ java_run () {
java -cp './out' "$1" java -cp './out' "$1"
} }
mkcd() {
mkdir -p "$1" && cd "$1" || exit
}
# Search for packages, by name only # Search for packages, by name only
pacman_search() { pacman_search() {
pacman -Ss "$1" --color=always | \ pacman -Ss "$1" --color=always | \
@ -90,6 +86,16 @@ screencast() {
fi fi
} }
sha384sum() {
tmpfile=$(mktemp)
curl -o "$tmpfile" "$1" && openssl dgst -sha384 -binary "$tmpfile" | openssl base64 -A
rm -f "$tmpfile"
}
shuffle() {
echo "$1" | fold -w 1 | shuf | tr -d '\n'
}
stream() { stream() {
QUALITY=${2:-"720p"} QUALITY=${2:-"720p"}

Loading…
Cancel
Save