bash: turn aliases into scripts
This makes the common actions previously encoded as bash aliases independent of the shell (I'm using /bin/sh for the scripts), which will make a potential switch to zsh easier by having less bash-specific stuff around.
This commit is contained in:
parent
c650622193
commit
e44b318e61
8 changed files with 29 additions and 17 deletions
4
bin/,head
Executable file
4
bin/,head
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
# Head as much as fits on screen
|
||||
exec head -n $(echo "$(tput lines) - 5" | bc) "$@"
|
||||
|
3
bin/,mpath
Executable file
3
bin/,mpath
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
echo "$MANPATH" | tr -s ":" "\n"
|
||||
|
9
bin/,myip
Executable file
9
bin/,myip
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
# A few options to get public IP address on command line. The dig solution
|
||||
# below using the OpenDNS resolver doesn't work when connected to
|
||||
# ExpressVPN because all DNS requests are handled by the ExpressVPN DNS
|
||||
# servers and the OpenDNS DNS resolver is blocked.
|
||||
exec curl -s https://ifconfig.co
|
||||
#exec curl -s https://ifconfig.me
|
||||
#exec dig +short myip.opendns.com @resolver1.opendns.com
|
||||
|
3
bin/,myipinfo
Executable file
3
bin/,myipinfo
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
exec curl -s ipinfo.io
|
||||
|
3
bin/,path
Executable file
3
bin/,path
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
echo "$PATH" | tr -s ":" "\n"
|
||||
|
4
bin/,tail
Executable file
4
bin/,tail
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
# Tail as much as fits on screen
|
||||
exec tail -n $(echo "$(tput lines) - 5" | bc) "$@"
|
||||
|
3
bin/,tmux
Executable file
3
bin/,tmux
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
exec tmux -f "$XDG_CONFIG_HOME/tmux/tmux.conf" "$@"
|
||||
|
17
files/bashrc
17
files/bashrc
|
@ -175,23 +175,6 @@ alias vim='nvim'
|
|||
alias grep="grep --color=auto"
|
||||
alias egrep="egrep --color=auto"
|
||||
alias fgrep="fgrep --color=auto"
|
||||
alias path='echo $PATH | tr -s ":" "\n"'
|
||||
alias mpath='echo $MANPATH | tr -s ":" "\n"'
|
||||
|
||||
alias tmux='tmux -f "$XDG_CONFIG_HOME/tmux/tmux.conf"'
|
||||
|
||||
# Head and tail as much as fits on screen
|
||||
alias head='head -n $((${LINES:-15}-5))'
|
||||
alias tail='tail -n $((${LINES:-15}-5))'
|
||||
|
||||
# A few options to get public IP address on command line. The dig solution
|
||||
# below using the OpenDNS resolver doesn't work when connected to
|
||||
# ExpressVPN because all DNS requests are handled by the ExpressVPN DNS
|
||||
# servers and the OpenDNS DNS resolver is blocked.
|
||||
alias ipinfo="curl -s ipinfo.io"
|
||||
alias myip="curl -s https://ifconfig.co"
|
||||
#alias myip="curl -s https://ifconfig.me"
|
||||
#alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
|
||||
|
||||
alias dark='change_bg dark'
|
||||
alias light='change_bg light'
|
||||
|
|
Loading…
Add table
Reference in a new issue