From 832af38380ba5b6a020b034059b4bc5ff7443ded Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 13 May 2023 23:50:35 -0500 Subject: uhhh --- bash/aliases.bash | 11 +++++++++-- bash/bash_profile | 7 +++++++ bash/functions.bash | 21 +++++++++++++++++++++ bash/prompt.bash | 2 +- 4 files changed, 38 insertions(+), 3 deletions(-) (limited to 'bash') 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=( visudo ) for cmd in "${sudo_cmds[@]}"; do - alias $cmd="sudo $cmd" + if command -v sudo >/dev/null 2>&1; then + alias $cmd="sudo $cmd" + elif command -v doas >/dev/null 2>&1; then + alias $cmd="doas $cmd" + alias sudo=doas + fi done # LS alias ls='ls -F --color=never' alias ll='ls -l' # tree -alias tree='tree -F' +#alias tree='tree -F' # make locally alias lake='make PREFIX=$LOCAL_PREFIX ' @@ -37,6 +42,8 @@ fi alias e="$EDITOR" +alias crontab='env EDITOR=ed VISUAL=vi crontab' + ## ffmpeg # agafnd | i have ffmpeg and ffprobe aliased to ffwhatever -hide_banner # 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 @@ [[ -f ~/.profile ]] && source ~/.profile [[ -f ~/.bashrc ]] && source ~/.bashrc + +# start sway on tty 1 + +if test -z "$DISPLAY" && test /dev/tty1 = "$(tty)" +then + swayrun +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() { UP_SPECIALARGS= return "$ret" } + +apk() { # wrapper for apk(1) + apk="$(which apk)" + test -z "$apk" && return 1 + case "$1" in + add|del|fix|update|upgrade) doas "$apk" "$@" ;; + install) shift; apk add "$@" ;; + remove) shift; apk del "$@" ;; + *) "$apk" "$@" ;; + esac +} + +sl() { + printf >&2 '%s\n' "CHOO CHOO!" + ls "$@" +} + +mkssh() { + ssh-keygen -t ed25519 -f "$HOME/.ssh/$1" + cat "$HOME/.ssh/$1.pub" | tee /dev/stdout | wl-copy +} 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() { git_prompt_integration PS1+='\[$(__prompt_term_title "$USER@$(hostname): $PWD")\]' - PS1+='\$ ' + PS1+=' \$ ' } eval "$MY_BASH_PROMPT" -- cgit 1.4.1-21-gabe81