From: Armaan Bhojwani Date: Sun, 21 Nov 2021 03:15:40 +0000 (-0500) Subject: Import changes from laptop X-Git-Url: https://git.armaanb.net/?p=dotfiles.git;a=commitdiff_plain;h=19dc2aa9b96d5cc0df6327d21a0022e422a77851 Import changes from laptop --- diff --git a/.cwmrc b/.cwmrc index 53b6872..42113a4 100644 --- a/.cwmrc +++ b/.cwmrc @@ -4,7 +4,6 @@ color activeborder purple bind-mouse M-3 window-resize command firefox firefox-esr -command cmus "xterm -e cmus" command xterm xterm ignore xclock diff --git a/.gitconfig b/.gitconfig index ae26d6e..5bd28d4 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,11 +1,33 @@ -[color] - ui = false - branch = false - diff = false - interactive = false - status = false - log = false - [user] name = Armaan Bhojwani email = me@armaanb.net + +[init] + defaultBranch = main + +[sendemail] + smtpserver = smtp.mailbox.org + smtpuser = me@armaanb.net + smtpencryption = ssl + smtpserverport = 465 + confirm = auto + +[submodule] + recurse = true + +[alias] + sclean = clean -dfX + quickfix = commit --amend --no-edit + subup = submodule update --remote + push-all = !git remote | xargs -L1 git push --all + +[commit] + verbose = true + +[add "interactive"] + usebuiltin = true + +[imap] + folder = Drafts + host = imaps://imap.mailbox.org + user = me@armaanb.net diff --git a/.kshrc b/.kshrc index d272cd6..87a0890 100644 --- a/.kshrc +++ b/.kshrc @@ -1,29 +1,80 @@ +[ $(hostname) = "alcatraz.armaanb.net" ] && { + date + apm | head -n 1 +} + set -o vi -ulimit -c unlimited -alias rsync="openrsync -rv" -export CDPATH=:~ + +alias pman='man -M /usr/local/share/doc/posix/man' +alias papropos='apropos -M /usr/local/share/doc/posix/man' +alias pwhatis='whatis -M /usr/local/share/doc/posix/man' + +alias rsync='openrsync -rv' + +ufile() { + [ "$(file -bi "$1")" = "text/plain" ] && ext="txt" + ext=$(printf "%s" "$1" | awk -F . '{print $NF}') + fname="$(basename ${2:-tmp$RANDOM.$ext})" + rsync "$1" "l.armaanb.net:/var/www/htdocs/l.armaanb.net/$fname" + printf "https://l.armaanb.net/%s\n" "$fname" | xclip && \ + xclip -o +} + +export GPG_TTY="$(tty)" +export CDPATH=":~" + alias ls="LC_COLLATE=C ls -lhF" -alias rm="rm -iv" +alias df="df -h" +alias du="du -h" alias cp="cp -riv" -alias mv="mv -iv" -alias grep="grep -in" -alias nl="nl -b all" -alias rclone="rclone -P" +alias rm='rm -iv' +alias mv='mv -iv' +alias ln='ln -v' +alias grep='grep -in' +alias mkdir='mkdir -p' +alias nl='nl -b all' +alias rclone='rclone -P' + +alias ytmusic="youtube-dl --add-metadata --extract-audio \ + --audio-format vorbis --prefer-ffmpeg --restrict-filenames \ + -o '%(title)s.%(ext)s'" alias mosh="env LC_CTYPE=en_US.UTF-8 mosh" -alias ytmusic="youtube-dl --add-metadata --extract-audio --audio-format vorbis --restrict-filenames -o '%(title)s.%(ext)s'" +alias serve="python3 -m http.server" +alias wttr='curl wttr.in?format="%l+%T\n%C+%t\nSunrise:+%S,+Sunset+%s\n"' +alias nv="nvim" +alias dotgit="git --git-dir=~/.local/share/dotfiles --work-tree=~" -stty dsusp undef +pass() { + printf "Master password: " + stty -echo + read masterpass + stty echo + sqlcipher .passwords.db -column -cmd "PRAGMA key = \"$masterpass\"" "$1" +} + +plike() { + pass "SELECT * FROM p WHERE name LIKE \"%$1%\";" +} + +pget() { + pass "SELECT * FROM p WHERE name = \"$1\";" +} -alias mspdf="groff -Tpdf -M ~/var/docs -ms -macheam" +pinsert() { + printf "New password: " + stty -echo + read newpass + stty echo + pass "INSERT INTO p VALUES (\"$1\", \"$2\", \"$newpass\");" +} -rpdf() { - tmp=/tmp/rpdf${RANDOM}.pdf - mspdf $1 > $tmp - zathura $tmp & - fwa $1 | while read; do mspdf $1 > $tmp; done - rm -f $tmp +pgen() { + tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' < /dev/urandom \ + | fold -w 20 \ + | head -n 1 } + dosa() { echo "Dosa! Yum yum yum" doas $@ @@ -35,6 +86,4 @@ watch() { fwa $inp | while read; do $@; done } -alias wttr='curl wttr.in?format="%l+%T\n%C+%t\nSunrise:+%S,+Sunset+%s\n"' -alias nv="nvim" -alias dotgit="git --git-dir=~/.local/share/dotfiles --work-tree=~" +stty dsusp undef diff --git a/.profile b/.profile new file mode 100644 index 0000000..f13b29d --- /dev/null +++ b/.profile @@ -0,0 +1,5 @@ +PATH=$HOME/src/bin:$HOME/.local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games +ENV="$HOME/.kshrc" +CFLAGS="-W -Wall -Wextra -g" +MAKEFLAGS="-j4" +export PATH HOME TERM ENV CFLAGS MAKEFLAGS