about summary refs log tree commit diff stats
path: root/bash
diff options
context:
space:
mode:
authorCase Duckworth2023-05-13 23:50:35 -0500
committerCase Duckworth2023-05-13 23:50:35 -0500
commit832af38380ba5b6a020b034059b4bc5ff7443ded (patch)
treefce4708280ff964d80a9808ed6826a1f3799e804 /bash
parentuhhhh (diff)
downloadetc-832af38380ba5b6a020b034059b4bc5ff7443ded.tar.gz
etc-832af38380ba5b6a020b034059b4bc5ff7443ded.zip
uhhh
Diffstat (limited to 'bash')
-rw-r--r--bash/aliases.bash11
-rw-r--r--bash/bash_profile7
-rw-r--r--bash/functions.bash21
-rw-r--r--bash/prompt.bash2
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)
12for cmd in "${sudo_cmds[@]}"; do 12for 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
14done 19done
15 20
16# LS 21# LS
17alias ls='ls -F --color=never' 22alias ls='ls -F --color=never'
18alias ll='ls -l' 23alias ll='ls -l'
19# tree 24# tree
20alias tree='tree -F' 25#alias tree='tree -F'
21 26
22# make locally 27# make locally
23alias lake='make PREFIX=$LOCAL_PREFIX ' 28alias lake='make PREFIX=$LOCAL_PREFIX '
@@ -37,6 +42,8 @@ fi
37 42
38alias e="$EDITOR" 43alias e="$EDITOR"
39 44
45alias 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
8if test -z "$DISPLAY" && test /dev/tty1 = "$(tty)"
9then
10 swayrun
11fi
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
143apk() { # 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
154sl() {
155 printf >&2 '%s\n' "CHOO CHOO!"
156 ls "$@"
157}
158
159mkssh() {
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
77eval "$MY_BASH_PROMPT" 77eval "$MY_BASH_PROMPT"