2022-02-05 22:58:21 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# some housekeeping
|
|
|
|
set -o vi
|
|
|
|
shopt -s autocd
|
2022-10-18 18:19:26 -05:00
|
|
|
alias rc=". ~/.config/bash/bashrc"
|
|
|
|
alias erc="nvim ~/.config/bash/bashrc"
|
|
|
|
alias reload=". ~/.config/bash/bashrc; . ~/.config/bash/profile"
|
2022-02-05 22:58:21 -06:00
|
|
|
|
|
|
|
# ssh keeping tidy
|
|
|
|
alias ssh="ssh -F $HOME/.config/ssh/config"
|
2022-02-19 17:42:51 -06:00
|
|
|
|
|
|
|
# remind alias
|
|
|
|
alias sched="nvim $DOTREMINDERS"
|
2022-02-22 13:52:11 -06:00
|
|
|
alias cal="rem -cl"
|
2022-10-17 13:20:52 -05:00
|
|
|
alias shutdown="sudo shutdown -h now"
|
2022-06-26 19:01:06 -05:00
|
|
|
|
2022-10-18 18:19:26 -05:00
|
|
|
alias ls="ls --color=auto"
|
2022-11-10 14:35:43 -06:00
|
|
|
alias irssi="irssi --home=$HOME/.config/irssi"
|
2022-10-18 18:19:26 -05:00
|
|
|
|
2022-06-26 19:01:06 -05:00
|
|
|
PS1="\w\$ "
|
|
|
|
|
|
|
|
# repos func
|
|
|
|
repos() {
|
|
|
|
sel="$(ls ~/git | fzy | awk '{print "/home/usr/git/"$1}')"
|
|
|
|
[ "$?" -eq 1 ] && exit
|
|
|
|
|
|
|
|
cd "$sel"
|
|
|
|
}
|
2022-10-18 18:19:26 -05:00
|
|
|
|
|
|
|
files() {
|
2022-12-04 15:32:50 -06:00
|
|
|
sel=$(find /home/$(whoami) |
|
|
|
|
grep -v '\.cache\|\.pki\|/scratch/\|\.config/chromium\|\.git\|\.local/lib\|\.mozilla/firefox/' |
|
|
|
|
fzy -l 50)
|
2022-10-18 18:19:26 -05:00
|
|
|
[ -z "$sel" ] && return 1
|
|
|
|
[ -d "$sel" ] && cd "$sel" || nvim "$sel"
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2022-11-27 13:17:51 -06:00
|
|
|
rss() {
|
|
|
|
cd ~/.local/share/sfeed/
|
2023-01-03 23:13:10 -06:00
|
|
|
touch .urls
|
2022-11-27 13:17:51 -06:00
|
|
|
sfeed_curses *
|
|
|
|
cd -
|
|
|
|
}
|
|
|
|
|
2022-12-24 00:54:45 -06:00
|
|
|
# stolen from stackoverflow
|
|
|
|
# code from a stranger is always perfect
|
|
|
|
git_main_branch () {
|
|
|
|
git branch | cut -c 3- | grep -E '^master$|^main$'
|
|
|
|
}
|
|
|
|
|
|
|
|
gp() {
|
2022-12-24 00:55:49 -06:00
|
|
|
# a bodge -- git authentication doesn't work quite right
|
|
|
|
pash c tildegit
|
2022-12-24 00:54:45 -06:00
|
|
|
git push -u origin $(git_main_branch)
|
|
|
|
}
|
|
|
|
|
2023-01-03 23:13:10 -06:00
|
|
|
start_bitlbee() {
|
|
|
|
mkdir -p $HOME/.config/bitlbee/
|
|
|
|
touch $HOME/.config/bitlbee/config
|
|
|
|
bitlbee #-D -c $HOME/.config/bitlbee/config -d $HOME/.config/bitlbee/
|
|
|
|
}
|
|
|
|
|
|
|
|
record() {
|
|
|
|
tmp=$(mktemp)
|
|
|
|
res=$(xrandr |
|
|
|
|
grep ' connected' |
|
|
|
|
awk -F' ' '{print $1 " " $4}' |
|
|
|
|
awk -F'+' '{print $1}' |
|
|
|
|
fzy |
|
|
|
|
awk -F' ' '{print $2}' )
|
|
|
|
|
|
|
|
ffmpeg -video_size "$res" -f x11grab -framerate 60 -i $DISPLAY -preset ultrafast -pix_fmt yuv420p "$tmp.mp4"
|
|
|
|
|
|
|
|
printf "> written to %s\n" "$tmp.mp4"
|
|
|
|
while true; do
|
|
|
|
result=$(printf "delete\nupload to pastebin\nreview footage\nquit\n" | fzy --prompt="what next?")
|
|
|
|
case "$result" in
|
|
|
|
*upload*)
|
|
|
|
paste "$tmp.mp4" | xclip -i
|
|
|
|
;;
|
|
|
|
*review*)
|
|
|
|
mpv "$tmp.mp4"
|
|
|
|
;;
|
|
|
|
*delete*)
|
|
|
|
rm "$tmp.mp4"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
*quit*)
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2022-12-24 00:54:45 -06:00
|
|
|
alias gs='git status'
|
2022-10-18 18:19:26 -05:00
|
|
|
alias f=files
|