-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path20-alias.base
More file actions
59 lines (48 loc) · 2.01 KB
/
20-alias.base
File metadata and controls
59 lines (48 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /usr/bin/env zsh
##
# Basic Aliasses and Universal Settings
##
source ~/.zshrc.d/01-local
# Add default options to programs
# some of these probably don't need checking, but for the sake of autocompleations being correct i will anyway
exists ssh && alias ssh='ssh -o ConnectionAttempts=4'
exists ssh && alias xssh='ssh -YC'
#-o ConnectTimeout=1'
exists nano && alias nano="nano -w"
exists wget && alias wget='wget -c -t 5 --waitretry 60'
exists ed && alias ed='ed -p "*"'
exists sl && alias sl='sl -l'
exists sshfs && alias sshfs="sshfs -C -o reconnect"
exists mc && alias mc="mc -a"
exists autossh && alias autossh='autossh -M 0'
exists pianobar && alias pianobar='pianobar 2> /dev/null'
exists find && alias finds='find 2>/dev/null'
exists less && alias less='less -FXR'
exists tmux && alias tmux='tmux -2 -u'
alias logged_in_others='who | grep -v $(whoami)'
if exists shutdown; then
alias shutdown='logged_in_others || sudo shutdown'
if exists poweroff; then
alias poweroff='logged_in_others || sudo poweroff'
else
alias poweroff='logged_in_others || sudo shutdown'
fi
else if exists poweroff; then
alias shutdown='logged_in_others || sudo poweroff'
alias poweroff='logged_in_others || sudo poweroff'
fi
fi
alias rhtop="sudo htop"
#TODO:make a function for umount as root
#alias s2ram="sudo s2ram"
#alias s2ram="sudo 'swapon /dev/sda3 && s2ram && swapoff /dev/sda3'"
exists reboot && alias reboot="sudo reboot"
[ `os` = "gentoo" ] && alias dhcpcd-reset="sudo 'dhcpcd && dhcpcd -x && dhcpcd && dhcpcd -x && dhcpcd'"
[ `os` = "gentoo" ] && exists wicd-curses && alias wicd-restart="sudo 'rc-config restart wicd'"
exists ls && alias l="ls -lha"
exists find && alias rmdire="find . -type d -empty -delete"
exists zoxide && eval "$(zoxide init zsh --cmd cd)"
exists fzf && eval "$(fzf --zsh)"
#check that not running pulse audio
#exists skype && alias skype='apulse skype'
[[ -e ~/tmp ]] && alias tmp_clear='rm -rf ~/tmp/*'