zsh:alias: Small bug fixes
Use XDG_CONFIG_HOME instead of hardcoding the tmux config path.
Simplify the battery alias a lot.
Fix quotation issues in url{dec,enc}.
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
wget --config="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" \
|
wget --config="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" \
|
||||||
--hsts-file="${XDG_DATA_HOME:-$HOME/.local/share}/wget/wget-hsts"
|
--hsts-file="${XDG_DATA_HOME:-$HOME/.local/share}/wget/wget-hsts"
|
||||||
'
|
'
|
||||||
alias tmux='tmux -f "$HOME/.config/tmux/tmux.conf"'
|
alias tmux='tmux -f "${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf"'
|
||||||
alias tmsu='tmsu -D "${XDG_DATA_HOME:-$HOME/.local/share}/tmsu/db"'
|
alias tmsu='tmsu -D "${XDG_DATA_HOME:-$HOME/.local/share}/tmsu/db"'
|
||||||
|
|
||||||
# Global
|
# Global
|
||||||
@@ -63,12 +63,7 @@
|
|||||||
'
|
'
|
||||||
alias pdf2t{e,}xt='pdftotext'
|
alias pdf2t{e,}xt='pdftotext'
|
||||||
alias rm='printf "\033[1;031mUse trash!\n\033[0m"; false'
|
alias rm='printf "\033[1;031mUse trash!\n\033[0m"; false'
|
||||||
alias battery='
|
alias battery='cat /sys/class/power_supply/BAT0/capacity'
|
||||||
upower -i /org/freedesktop/UPower/devices/battery_BAT0
|
|
||||||
| grep -E "to full|percentage"
|
|
||||||
| tr -d " "
|
|
||||||
| sed "s/:/: /"
|
|
||||||
'
|
|
||||||
alias qrdecode='zbarimg'
|
alias qrdecode='zbarimg'
|
||||||
alias loadhist='fc -RI'
|
alias loadhist='fc -RI'
|
||||||
alias hex='xxd'
|
alias hex='xxd'
|
||||||
@@ -98,11 +93,13 @@
|
|||||||
alias histgrep='() { grep "$@" "${HISTFILE:-$HOME/.zsh_history}" }'
|
alias histgrep='() { grep "$@" "${HISTFILE:-$HOME/.zsh_history}" }'
|
||||||
# URL-encode
|
# URL-encode
|
||||||
alias urlenc='() {
|
alias urlenc='() {
|
||||||
python3 -c "from urllib import parse; print(parse.quote('$@'), end='')
|
python3 -c \
|
||||||
|
"from urllib import parse; print(parse.quote(\"$*\"), end=\"\")"
|
||||||
}'
|
}'
|
||||||
# URL-decode
|
# URL-decode
|
||||||
alias urldec='() {
|
alias urldec='() {
|
||||||
python3 -c "from urllib import parse; print(parse.unquote('$@'), end='')
|
python3 -c \
|
||||||
|
"from urllib import parse; print(parse.unquote(\"$*\"), end=\"\")"
|
||||||
}'
|
}'
|
||||||
|
|
||||||
# Named directories
|
# Named directories
|
||||||
|
|||||||
Reference in New Issue
Block a user