modify several aliases
This commit is contained in:
parent
4d985ba07e
commit
a0d5904ece
147
general/.aliases
147
general/.aliases
@ -1,10 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
export SCREENSHOT_DIR='~/pictures/screenshots'
|
# When using zsh, see also
|
||||||
|
# $HOME/.oh-my-zsh/lib
|
||||||
|
|
||||||
# ░█▀█░█▀▄░█▀█░█▀▀░█▀▄░█▀█░█▄█░█▀▀
|
export SCREENSHOT_DIR='$HOME/pictures/screenshots'
|
||||||
# ░█▀▀░█▀▄░█░█░█░█░█▀▄░█▀█░█░█░▀▀█
|
|
||||||
# ░▀░░░▀░▀░▀▀▀░▀▀▀░▀░▀░▀░▀░▀░▀░▀▀▀
|
# ░█▀▀░█░█░▀█▀░░░█▀▀░█▀█░█▀▀░▀█▀░█░█░█▀█░█▀▄░█▀▀
|
||||||
|
# ░█▀▀░▄▀▄░░█░░░░▀▀█░█░█░█▀▀░░█░░█▄█░█▀█░█▀▄░█▀▀
|
||||||
|
# ░▀▀▀░▀░▀░░▀░░░░▀▀▀░▀▀▀░▀░░░░▀░░▀░▀░▀░▀░▀░▀░▀▀▀
|
||||||
|
|
||||||
alias m="ncmpcpp"
|
alias m="ncmpcpp"
|
||||||
|
|
||||||
@ -32,15 +35,17 @@ if command -v youtube-dl &> /dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v maim &> /dev/null; then
|
if command -v maim &> /dev/null; then
|
||||||
alias skusho='maim -u -k $(echo $SCREENSHOT_DIR)/$(date +%s).png'
|
alias skusho='maim --hidecursor --nokeyboard $(echo $SCREENSHOT_DIR)/$(date +%s).png'
|
||||||
|
|
||||||
if command -v xclip &> /dev/null; then
|
if command -v xclip &> /dev/null; then
|
||||||
alias skushoclip='maim -k -s -u | xclip -selection clipboard -t image/png -i'
|
alias skushoclip='maim --hidecursor --nokeyboard --select | xclip -selection clipboard -target image/png -in'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v rsync &> /dev/null; then
|
if command -v rsync &> /dev/null; then
|
||||||
alias cp='rsync --progress -h'
|
alias ccp='/usr/bin/cp'
|
||||||
|
alias cp='rsync --progress --human-readable'
|
||||||
|
alias cpr='rsync --progress --human-readable --recursive'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v bat &> /dev/null; then
|
if command -v bat &> /dev/null; then
|
||||||
@ -52,16 +57,29 @@ if command -v netstat &> /dev/null; then
|
|||||||
alias ports='sudo netstat -tulpn | grep LISTEN'
|
alias ports='sudo netstat -tulpn | grep LISTEN'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# alias tangle-doom-emacs='cd $HOME/.doom.d && $HOME/.emacs.d/bin/org-tangle config.org && cd -'
|
||||||
|
|
||||||
|
if command -v xmonad &> /dev/null; then
|
||||||
|
alias xr='xmonad --recompile'
|
||||||
|
|
||||||
|
# TODO: Update to paru
|
||||||
|
alias xmr='yay -S xmobar-git --answerclean A --answerdiff N'
|
||||||
|
alias xxmr='xr; xmr'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f $HOME/.scripts/dropbox.py ]]; then
|
||||||
|
alias dp="python $HOME/.scripts/dropbox.py"
|
||||||
|
fi
|
||||||
|
|
||||||
# ░█▀▀░█▀█░█░░░█▀█░█▀▄
|
# ░█▀▀░█▀█░█░░░█▀█░█▀▄
|
||||||
# ░█░░░█░█░█░░░█░█░█▀▄
|
# ░█░░░█░█░█░░░█░█░█▀▄
|
||||||
# ░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀
|
# ░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀
|
||||||
|
|
||||||
|
|
||||||
if command -v exa &> /dev/null; then
|
if command -v exa &> /dev/null; then
|
||||||
|
alias lls='/usr/bin/ls'
|
||||||
alias ls='exa'
|
alias ls='exa'
|
||||||
alias ll='exa --long --header --git'
|
alias sl='ls'
|
||||||
alias sl='exa -a --long --header --git'
|
alias lsa='exa -lah --changed --time-style long-iso --git --group'
|
||||||
alias la='exa -a'
|
|
||||||
else
|
else
|
||||||
alias ls='ls --group-directories-first --color=auto'
|
alias ls='ls --group-directories-first --color=auto'
|
||||||
alias ll='ls -alFh --group-directories-first --color=auto'
|
alias ll='ls -alFh --group-directories-first --color=auto'
|
||||||
@ -74,36 +92,12 @@ alias grep='grep --color=auto'
|
|||||||
alias fgrep='fgrep --color=auto'
|
alias fgrep='fgrep --color=auto'
|
||||||
alias egrep='egrep --color=auto'
|
alias egrep='egrep --color=auto'
|
||||||
|
|
||||||
alias echo-colors='for x in 0 1 4 5 7 8; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "";'
|
# ░█▀▄░▀█▀░█▀▄░░░▀▀█░█░█░█▄█░█▀█░█▀▀
|
||||||
|
# ░█░█░░█░░█▀▄░░░░░█░█░█░█░█░█▀▀░▀▀█
|
||||||
|
# ░▀▀░░▀▀▀░▀░▀░░░▀▀░░▀▀▀░▀░▀░▀░░░▀▀▀
|
||||||
|
|
||||||
# ░█▄█░▀█▀░█▀▀░█▀▀
|
alias gt='cd $HOME/git'
|
||||||
# ░█░█░░█░░▀▀█░█░░
|
alias tmp='cd /tmp'
|
||||||
# ░▀░▀░▀▀▀░▀▀▀░▀▀▀
|
|
||||||
|
|
||||||
# Cd to git folder
|
|
||||||
alias gt='cd ~/git'
|
|
||||||
|
|
||||||
# Make ftp server
|
|
||||||
alias makeftp='python -m pyftpdlib --directory=$HOME/ --port=2121'
|
|
||||||
|
|
||||||
# Get current Fcitx mode
|
|
||||||
alias get-fcitx-mode='qdbus "org.fcitx.Fcitx" "/inputmethod" "GetCurrentIM"'
|
|
||||||
|
|
||||||
c-file() {
|
|
||||||
nvim $($HOME/.scripts/rofi/config-selector.py)
|
|
||||||
}
|
|
||||||
|
|
||||||
alias openfile='~/.scripts/rofi/config-selector.py | xargs nvim'
|
|
||||||
|
|
||||||
# alias tangle-doom-emacs='cd $HOME/.doom.d && $HOME/.emacs.d/bin/org-tangle config.org && cd -'
|
|
||||||
|
|
||||||
alias xr='xmonad --recompile'
|
|
||||||
|
|
||||||
# TODO: Update to paru
|
|
||||||
alias xmr='yay -S xmobar-git --answerclean A --answerdiff N'
|
|
||||||
alias xxmr='xr; xmr'
|
|
||||||
|
|
||||||
alias killall-tmux='tmux ls | awk '{print $1}' | sed 's/://g' | xargs -I{} tmux kill-session -t {}'
|
|
||||||
|
|
||||||
alias cd..='cd ..'
|
alias cd..='cd ..'
|
||||||
alias ..='cd ..'
|
alias ..='cd ..'
|
||||||
@ -112,24 +106,81 @@ alias ....='cd ../../..'
|
|||||||
alias .....='cd ../../../..'
|
alias .....='cd ../../../..'
|
||||||
alias ......='cd ../../../../..'
|
alias ......='cd ../../../../..'
|
||||||
|
|
||||||
|
# ░█▄█░▀█▀░█▀▀░█▀▀
|
||||||
|
# ░█░█░░█░░▀▀█░█░░
|
||||||
|
# ░▀░▀░▀▀▀░▀▀▀░▀▀▀
|
||||||
|
|
||||||
|
alias sz='du -sh'
|
||||||
|
|
||||||
|
alias realias='source $HOME/.aliases'
|
||||||
|
|
||||||
|
alias openfile='$HOME/.scripts/rofi/config-selector.py | xargs nvim'
|
||||||
|
|
||||||
alias q='exit'
|
alias q='exit'
|
||||||
|
|
||||||
|
alias rmr='rmdir'
|
||||||
|
|
||||||
|
alias pagga='toilet -f pagga'
|
||||||
|
|
||||||
# Supposed to be used as a pipe: "cat file | rainbow"
|
# Supposed to be used as a pipe: "cat file | rainbow"
|
||||||
alias rainbow='toilet -f pagga | lolcat'
|
alias rainbow='toilet -f pagga | lolcat'
|
||||||
|
|
||||||
if [[ -f ~/.scripts/dropbox.py ]]; then
|
# ░█▀█░█▀█░█▀▀░█░░░▀█▀░█▀█░█▀▀░█▀▄░█▀▀
|
||||||
alias dp="python ~/.scripts/dropbox.py"
|
# ░█░█░█░█░█▀▀░█░░░░█░░█░█░█▀▀░█▀▄░▀▀█
|
||||||
|
# ░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░▀▀
|
||||||
|
|
||||||
|
alias killall-tmux='tmux ls | awk '{print $1}' | sed 's/://g' | xargs -I{} tmux kill-session -t {}'
|
||||||
|
|
||||||
|
# Get current Fcitx mode
|
||||||
|
alias get-fcitx-mode='qdbus "org.fcitx.Fcitx" "/inputmethod" "GetCurrentIM"'
|
||||||
|
|
||||||
|
alias wcd='find . -type f -exec cat {} + | wc -l'
|
||||||
|
|
||||||
|
# Make ftp server
|
||||||
|
alias makeftp='python -m pyftpdlib --directory=$HOME/ --port=2121'
|
||||||
|
|
||||||
|
alias echo-colors='for x in 0 1 4 5 7 8; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "";'
|
||||||
|
|
||||||
|
# ░█▀▀░█░█░█▀█░█▀▀░▀█▀░▀█▀░█▀█░█▀█░█▀▀
|
||||||
|
# ░█▀▀░█░█░█░█░█░░░░█░░░█░░█░█░█░█░▀▀█
|
||||||
|
# ░▀░░░▀▀▀░▀░▀░▀▀▀░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀
|
||||||
|
|
||||||
|
gac(){
|
||||||
|
git add $1 && git commit -a -m $2
|
||||||
|
}
|
||||||
|
|
||||||
|
c-file() {
|
||||||
|
nvim $($HOME/.scripts/rofi/config-selector.py)
|
||||||
|
}
|
||||||
|
|
||||||
|
if command -v netstat &> /dev/null; then
|
||||||
|
# Usage: $ conn-ips 80
|
||||||
|
conn-ips() {
|
||||||
|
netstat -tn 2>/dev/null | grep :$1 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f ~/.aliases.private ]]; then
|
|
||||||
source ~/.aliases.private
|
# ░█▀▀░█▀█░█░█░█▀▄░█▀▀░█▀▀░█▀▀
|
||||||
|
# ░▀▀█░█░█░█░█░█▀▄░█░░░█▀▀░▀▀█
|
||||||
|
# ░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀▀▀
|
||||||
|
|
||||||
|
if [[ -f $HOME/.aliases.private ]]; then
|
||||||
|
source $HOME/.aliases.private
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f ~/.aliases.desktop ]]; then
|
if [[ -f $HOME/.aliases.desktop ]]; then
|
||||||
source ~/.aliases.desktop
|
source $HOME/.aliases.desktop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f ~/.aliases.laptop ]]; then
|
if [[ -f $HOME/.aliases.laptop ]]; then
|
||||||
source ~/.aliases.laptop
|
source $HOME/.aliases.laptop
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "$HOME/.project-template-aliases" ]]; then
|
||||||
|
for f in $(find $HOME/.project-template-aliases/ -maxdepth 1 -type f)
|
||||||
|
do
|
||||||
|
source $f
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
[alias]
|
[alias]
|
||||||
graph = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
|
|
||||||
graphv = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
|
graph = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
|
||||||
g = !"git graph"
|
|
||||||
|
graphv = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
|
||||||
|
|
||||||
|
g = !"git graph"
|
||||||
|
|
||||||
|
uncommit = reset --soft HEAD^
|
||||||
|
|
||||||
|
11
general/.project-template-aliases/latex
Normal file
11
general/.project-template-aliases/latex
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
project-latex () {
|
||||||
|
mkdir $1
|
||||||
|
cd $1
|
||||||
|
mkdir graphics
|
||||||
|
mkdir scripts
|
||||||
|
cp $HOME/.project-template-aliases/latex-resources/main.tex .
|
||||||
|
cp $HOME/.project-template-aliases/latex-resources/.latexmkrc .
|
||||||
|
cp $HOME/.project-template-aliases/latex-resources/bibliography.bib .
|
||||||
|
}
|
9
general/.project-template-aliases/python
Normal file
9
general/.project-template-aliases/python
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
project-venv() {
|
||||||
|
mkdir $1
|
||||||
|
cd $1
|
||||||
|
python -m venv venv
|
||||||
|
echo venv > .gitignore
|
||||||
|
source venv/bin/activate
|
||||||
|
}
|
@ -1,9 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
#TODO: Fix dynamic disable and enable (16 was a one time occurence)
|
#TODO: Fix dynamic disable and enable (16 was a one time occurence)
|
||||||
alias disable-touch="xinput set-prop 16 'Device Enabled' 0"
|
# alias disable-touch="xinput set-prop 16 'Device Enabled' 0"
|
||||||
alias enable-touch="xinput set-prop 16 'Device Enabled' 1"
|
# alias enable-touch ="xinput set-prop 16 'Device Enabled' 1"
|
||||||
|
|
||||||
alias singleScreen="xrandr --output DP-3 --off"
|
alias turnOffScreenHDMI="xrandr --output DP-3 --off"
|
||||||
alias doubleScreen="xrandr --output DP-3 --mode 1920x1080"
|
alias doubleScreenHDMI="xrandr --output DP-3 --mode 1920x1080"
|
||||||
alias extendScreen="xrandr --output DP-3 --mode 1920x1080 --right-of eDP-1"
|
alias extendScreenHDMI="xrandr --output DP-3 --mode 1920x1080 --right-of eDP-1"
|
||||||
|
|
||||||
|
alias turnOffScreenUSBC="xrandr --output DP-1 --off"
|
||||||
|
alias doubleScreenUSBC="xrandr --output DP-1 --mode 1920x1080"
|
||||||
|
alias extendScreenUSBC="xrandr --output DP-1 --mode 1920x1080 --right-of eDP-1"
|
||||||
|
Loading…
Reference in New Issue
Block a user