diff options
| author | yuzu-eva <stevenhu@web.de> | 2023-04-01 19:12:44 +0200 |
|---|---|---|
| committer | yuzu-eva <stevenhu@web.de> | 2023-04-01 19:12:44 +0200 |
| commit | ccba79d7f97140a325af7b98b8ce2917e7cf4fc8 (patch) | |
| tree | 2b3ff294f2ab915a08916125a9e4fd2c3fa126ac /.config/shell | |
| parent | 39e9d4e4f740647e49cf7f2f090bc0ddb27a7d76 (diff) | |
| parent | be35ccddeb63db26949183ade5a801593918a597 (diff) | |
merge desktop into master
Diffstat (limited to '.config/shell')
| -rw-r--r-- | .config/shell/aliasrc | 130 | ||||
| -rw-r--r-- | .config/shell/profile | 30 |
2 files changed, 160 insertions, 0 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc new file mode 100644 index 0000000..5d21bf7 --- /dev/null +++ b/.config/shell/aliasrc @@ -0,0 +1,130 @@ +## MISCELLANEOUS + +# various shortcuts +alias reboot='sudo reboot' +alias poweroff='sudo poweroff' +alias pms='sudo pm-suspend' +alias refresh='source $ZDOTDIR/.zshrc' +alias fuck='sudo $(fc -Lln -1)' +alias open='xdg-open' +alias mutt='pushd ~/.mutt/attachments; mutt; popd' +alias jpwine='LANG=ja_JP.UTF-8 WINEDEBUG=-all wine' +alias vi="$EDITOR" +alias em='emacsclient -c -a "emacs" &' +alias emacsd='/usr/local/bin/emacs --daemon &' +alias z='zathura' +alias cn='clear;neofetch' +alias nnn='nnn -Hde' +alias ea='vi ~/.config/shell/aliasrc' +alias setkeys='xset r rate 250 30 && setxkbmap -option "ctrl:nocaps"' +alias cam='mpv --profile=low-latency --untimed /dev/video0' +alias freyr='sudo docker run -it --rm -v /media/hdd/music:/data freyrcli/freyrjs' +alias ofn='/usr/bin/ls | cat -n | while read n f; do rename "s/${f%.*}/$(printf "%04d" "$n")/" "$f"; done' + +# setting custom ascii +# alias neofetch='neofetch --source ~/docs/ascii/lain' + +# cp mv and rm always verbose +alias cp='cp -iv' +alias mv='mv -iv' +alias rm='rm -Iv' +alias mkd='mkdir -pv' + +# Colorize grep output +alias grep='grep --color=auto -i' + +# ls shortcuts +alias ls='ls -hl --color=always --group-directories-first' +alias la='ls -a' + +ld() { + if [ "$1" = "" ]; then + ls -d */; + else + ls -d $1/*/ | sed "s|$1/||"; + fi +} + +# Control Audio +alias headset="wpctl set-default $(wpctl status | grep 'Headphones' | cut -b11-12)" +alias speakers="wpctl set-default $(wpctl status | grep 'Speakers' | cut -b11-12)" +alias setvol='pactl set-sink-volume @DEFAULT_SINK@' + +# Monitor / Resolution settings, mainly for playing old-ass games +alias setrmon-lowres='xrandr --auto --output HDMI-A-0 --mode 640x480 --primary' +alias setrmon-midres='xrandr --auto --output HDMI-A-0 --mode 800x600 --primary' +alias setrmon-default='xrandr --auto --output HDMI-A-0 --mode 1920x1080 --primary' +alias setlmon-lowres='xrandr --auto --output DisplayPort-2 --mode 640x480 --left-of HDMI-A-0' +alias setlmon-midres='xrandr --auto --output DisplayPort-2 --mode 800x600 --left-of HDMI-A-0' +alias setlmon-default='xrandr --auto --output DisplayPort-2 --mode 1600x900 --left-of HDMI-A-0' + +# function for timer and stopwatch +timer() { + date1=$((`date +%s` + $1)); + while [ "$date1" -ge `date +%s` ]; do + echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r"; + sleep 0.1 + done + notify-send "Time Up"; pw-play "/usr/share/sounds/freedesktop/stereo/complete.oga" +} + +stopwatch() { + date1=`date +%s`; + while true; do + echo -ne "$(date -u --date @$((`date +%s` - $date1)) +%H:%M:%S)\r"; + sleep 0.1 + done +} + + +## FUNCTIONS FOR CONVERTING DATE TO ISO 8601 + +# convert date from YYYYMMDD to YYYY-MM-DD +date-convert() { + for i in *; do + mv "${i}" "$(echo "${i}" | + sed 's/\([0-9][0-9][0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)/\1-\2-\3/')" + done; +} + +# reverse date from DD-MM-YYYY to YYYY-MM-DD +date-reverse() { + for i in *; do + mv "${i}" "$(echo "${i}" | + sed 's/\([0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9][0-9][0-9]\)/\3-\1-\2/')" + done; +} + +## CONVERTING VIDEO + +# convert video files to webm +mkwebm() { + ffmpeg -i "${1}" -c:v libvpx-vp9 -crf 1 -b:v 1M -c:a libvorbis "${1%.*}".webm +} + +## GIT + +# general shortcuts +alias commit='git commit -m' +alias fetch='git fetch' +alias upstream='git push --set-upstream origin' +alias remote='git remote add origin' +alias pull='git pull origin' +alias push='git push origin' + +# shortcut for dotfiles repo +alias dfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' +alias dcomm='dfiles commit -m' +alias dpush='dfiles push origin' + +## PACKAGE MANAGER + +alias aptin='sudo apt install' +alias aptup='sudo apt update && sudo apt upgrade' +alias aptupd='sudo apt update' +alias aptupg='sudo apt upgrade' +alias aptrm='sudo apt remove' +alias aptsr='sudo apt search' +alias aptsh='sudo apt show' +alias listup='sudo apt list --upgradeable' +alias listin='sudo apt list --installed' diff --git a/.config/shell/profile b/.config/shell/profile new file mode 100644 index 0000000..0093eed --- /dev/null +++ b/.config/shell/profile @@ -0,0 +1,30 @@ +umask 0077 + +export _JAVA_AWT_WM_NONREPARENTING=1 +export EDITOR="nvim" +export TERMINAL="st" +export BROWSER="firefox" + +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" + +export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" + +export LC_ALL=en_US.UTF-8 + +export MAIL=~/.mutt/Maildir +export NO_AT_BRIDGE=1 + +export GTK_IM_MODULE='ibus' +export QT_IM_MODULE='ibus' +export XMODIFIERS='@im=ibus' +export XDG_SESSION_TYPE='x11' + +export NVM_DIR="$HOME/.config/nvm" + +export PATH="$PATH:$HOME/.local/bin:$HOME/.fzf/bin:$HOME/.cargo/bin:/sbin:/usr/sbin:$HOME/.rvm/bin" + + + |
