aboutsummaryrefslogtreecommitdiff
path: root/dot-bash_aliases
blob: 39c0b73f3fac40fe8c05af881ffa0b7e8b814bd3 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#
# ~/.bash_aliases
#

# Better defaults
alias ls="ls -hvF --group-directories --color=auto"
alias rm="rm -iv"

#
# NEW COMMANDS
#
command -v eza &>/dev/null && alias ls="eza --group-directories-first"

# file tree
command -v tree &>/dev/null && alias tree="tree --dirsfirst"

# ascii text
command -v figlet &>/dev/null && alias ascii="figlet -f standard"

# pdf
command -v zathura &>/dev/null && alias pdf="zathura"

# dictionary
command -v sdcv &>/dev/null && alias dict="sdcv"

# image viewer
command -v swayimg &>/dev/null && alias img="swayimg"

# keys
command -v xkbcli &>/dev/null && alias keys="xkbcli interactive-wayland"

# Git
if command -v git &>/dev/null; then
	alias gs="git status"
	alias gl="git log"
	alias gll="git log --all"
	alias gd="git diff"
	alias gds="git diff --staged"
	alias gu="git add --update"
fi

# tmux
if comand -v tmux &>/dev/null; then
	function tmux() {
		if [ "$#" -eq 0 ]; then
			command tmux new-session -s "TMUX"
		else
			command tmux "$@"
		fi
	}
fi

# podman
if command -v podman &>/dev/null; then
	alias pd="podman"
	alias pdi="podman images ls"
fi

# ssh
if command -v ssh-agent &>/dev/null; then
	function ssh-on() {
		ssh-agent -k &>/dev/null
		eval $(ssh-agent)
		[ "$#" -eq 0 ] && duration=0
		ssh-add -t "$duration"
	}
	function ssh-off() {
		ssh-agent -k
	}
fi