aboutsummaryrefslogtreecommitdiffstats
path: root/.zshrc-linux-desktop
blob: 93b8c2b9bddc406da3e57b22fdd23737e19d8883 (plain)
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
################### ALIASES ##################

alias smutt='ssh -o ServerAliveInterval=5 -t shmibs@airen-no-jikken.icu mutt'
alias ssmutt='ssh -o ServerAliveInterval=5 -t shmibs@airen-no-jikken.icu mutt -f sent'
alias kmutt='ssh -o ServerAliveInterval=5 -t k@airen-no-jikken.icu mutt'
alias ksmutt='ssh -o ServerAliveInterval=5 -t k@airen-no-jikken.icu mutt -f sent'
alias amutt='ssh -o ServerAliveInterval=5 -t ageha@airen-no-jikken.icu mutt'
alias asmutt='ssh -o ServerAliveInterval=5 -t ageha@airen-no-jikken.icu mutt -f sent'

if [[ $(whence sshfs) != "" ]] then
	alias smount='mkdir -p ~/mount-shmibs && sshfs shmibs@airen-no-jikken.icu: ~/mount-shmibs || rmdir ~/mount-shmibs'
	alias kmount='mkdir -p ~/mount-k && sshfs k@airen-no-jikken.icu: ~/mount-k || rmdir ~/mount-k'
	alias amount='mkdir -p ~/mount-ageha && sshfs ageha@airen-no-jikken.icu: ~/mount-ageha || rmdir ~/mount-ageha'
	alias sumount='fusermount -u ~/mount-shmibs && rmdir ~/mount-shmibs'
	alias kumount='fusermount -u ~/mount-k && rmdir ~/mount-k'
	alias aumount='fusermount -u ~/mount-ageha && rmdir ~/mount-ageha'
fi

if [[ $(whence mpc) != "" ]] then
	alias mc='mpc clear'
	alias ml='mpc playlist'
	alias mr='mpc random'
	alias ms='mpc search any'
fi

if [[ $(whence timew) != "" ]] then
	alias t='timew'
	alias ts='timew summary :week'
	alias tt='timew track'
	alias tu='timew undo'
fi

if [[ -f $HOME/mount/enc.iso && $(whence cryptsetup) ]] then
emount() {
	mkdir -p $HOME/enc || return 1
	sudo cryptsetup luksOpen $HOME/mount/enc.iso enc || { rmdir $HOME/enc; return 1 }
	sudo mount /dev/mapper/enc $HOME/enc || { sudo cryptsetup luksClose enc; rmdir $HOME/enc; return 1 }
}

eumount() {
	[[ -d $HOME/enc ]] && sudo umount $HOME/enc
	sudo cryptsetup luksClose enc
	[[ -d $HOME/enc ]] && rmdir $HOME/enc
}
fi

if [[ $(whence pacmd) != "" ]] then
pacsink() {
	[[ $(pacmd list-sinks) =~ 'name: <book>' ]] && return

	pacmd load-module module-null-sink sink_name=book
	pacmd update-sink-proplist book device.description=book
}
fi