diff options
Diffstat (limited to 'bash')
-rw-r--r-- | bash/aliases.bash | 11 | ||||
-rw-r--r-- | bash/bash_profile | 7 | ||||
-rw-r--r-- | bash/functions.bash | 21 | ||||
-rw-r--r-- | bash/prompt.bash | 2 |
4 files changed, 38 insertions, 3 deletions
diff --git a/bash/aliases.bash b/bash/aliases.bash index 6515873..18cd7d2 100644 --- a/bash/aliases.bash +++ b/bash/aliases.bash | |||
@@ -10,14 +10,19 @@ sudo_cmds=( | |||
10 | visudo | 10 | visudo |
11 | ) | 11 | ) |
12 | for cmd in "${sudo_cmds[@]}"; do | 12 | for cmd in "${sudo_cmds[@]}"; do |
13 | alias $cmd="sudo $cmd" | 13 | if command -v sudo >/dev/null 2>&1; then |
14 | alias $cmd="sudo $cmd" | ||
15 | elif command -v doas >/dev/null 2>&1; then | ||
16 | alias $cmd="doas $cmd" | ||
17 | alias sudo=doas | ||
18 | fi | ||
14 | done | 19 | done |
15 | 20 | ||
16 | # LS | 21 | # LS |
17 | alias ls='ls -F --color=never' | 22 | alias ls='ls -F --color=never' |
18 | alias ll='ls -l' | 23 | alias ll='ls -l' |
19 | # tree | 24 | # tree |
20 | alias tree='tree -F' | 25 | #alias tree='tree -F' |
21 | 26 | ||
22 | # make locally | 27 | # make locally |
23 | alias lake='make PREFIX=$LOCAL_PREFIX ' | 28 | alias lake='make PREFIX=$LOCAL_PREFIX ' |
@@ -37,6 +42,8 @@ fi | |||
37 | 42 | ||
38 | alias e="$EDITOR" | 43 | alias e="$EDITOR" |
39 | 44 | ||
45 | alias crontab='env EDITOR=ed VISUAL=vi crontab' | ||
46 | |||
40 | ## ffmpeg | 47 | ## ffmpeg |
41 | # agafnd | i have ffmpeg and ffprobe aliased to ffwhatever -hide_banner | 48 | # agafnd | i have ffmpeg and ffprobe aliased to ffwhatever -hide_banner |
42 | # agafnd | because if you don't do this it spits out all of the options it was | 49 | # agafnd | because if you don't do this it spits out all of the options it was |
diff --git a/bash/bash_profile b/bash/bash_profile index 4439ca7..92ce061 100644 --- a/bash/bash_profile +++ b/bash/bash_profile | |||
@@ -2,3 +2,10 @@ | |||
2 | 2 | ||
3 | [[ -f ~/.profile ]] && source ~/.profile | 3 | [[ -f ~/.profile ]] && source ~/.profile |
4 | [[ -f ~/.bashrc ]] && source ~/.bashrc | 4 | [[ -f ~/.bashrc ]] && source ~/.bashrc |
5 | |||
6 | # start sway on tty 1 | ||
7 | |||
8 | if test -z "$DISPLAY" && test /dev/tty1 = "$(tty)" | ||
9 | then | ||
10 | swayrun | ||
11 | fi | ||
diff --git a/bash/functions.bash b/bash/functions.bash index debea2c..4241c8d 100644 --- a/bash/functions.bash +++ b/bash/functions.bash | |||
@@ -139,3 +139,24 @@ up() { | |||
139 | UP_SPECIALARGS= | 139 | UP_SPECIALARGS= |
140 | return "$ret" | 140 | return "$ret" |
141 | } | 141 | } |
142 | |||
143 | apk() { # wrapper for apk(1) | ||
144 | apk="$(which apk)" | ||
145 | test -z "$apk" && return 1 | ||
146 | case "$1" in | ||
147 | add|del|fix|update|upgrade) doas "$apk" "$@" ;; | ||
148 | install) shift; apk add "$@" ;; | ||
149 | remove) shift; apk del "$@" ;; | ||
150 | *) "$apk" "$@" ;; | ||
151 | esac | ||
152 | } | ||
153 | |||
154 | sl() { | ||
155 | printf >&2 '[0;36m%s[0m\n' "CHOO CHOO!" | ||
156 | ls "$@" | ||
157 | } | ||
158 | |||
159 | mkssh() { | ||
160 | ssh-keygen -t ed25519 -f "$HOME/.ssh/$1" | ||
161 | cat "$HOME/.ssh/$1.pub" | tee /dev/stdout | wl-copy | ||
162 | } | ||
diff --git a/bash/prompt.bash b/bash/prompt.bash index bee5223..e51db96 100644 --- a/bash/prompt.bash +++ b/bash/prompt.bash | |||
@@ -71,7 +71,7 @@ smiley_prompt() { | |||
71 | git_prompt_integration | 71 | git_prompt_integration |
72 | 72 | ||
73 | PS1+='\[$(__prompt_term_title "$USER@$(hostname): $PWD")\]' | 73 | PS1+='\[$(__prompt_term_title "$USER@$(hostname): $PWD")\]' |
74 | PS1+='\$ ' | 74 | PS1+=' \$ ' |
75 | } | 75 | } |
76 | 76 | ||
77 | eval "$MY_BASH_PROMPT" | 77 | eval "$MY_BASH_PROMPT" |