From 90eaebabcaaea74237f34cf05709625345f276cc Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 12 May 2022 12:01:54 -0300 Subject: Move Git repository into ~/.usr/.git/ --- .usr/bin/backup | 128 -------------------- .usr/bin/brightness | 13 -- .usr/bin/clamp | 74 ------------ .usr/bin/color | 204 -------------------------------- .usr/bin/copy | 67 ----------- .usr/bin/e | 79 ------------- .usr/bin/email | 74 ------------ .usr/bin/gc | 105 ---------------- .usr/bin/grun | 102 ---------------- .usr/bin/max | 61 ---------- .usr/bin/min | 61 ---------- .usr/bin/mkdtemp | 24 ---- .usr/bin/mkstemp | 24 ---- .usr/bin/msg | 90 -------------- .usr/bin/open | 101 ---------------- .usr/bin/pre | 72 ----------- .usr/bin/print | 151 ----------------------- .usr/bin/qr | 58 --------- .usr/bin/rfc | 117 ------------------ .usr/bin/tmpname | 52 -------- .usr/bin/uuid | 53 --------- .usr/bin/with-email | 84 ------------- .usr/bin/without-env | 76 ------------ .usr/bin/xdg-open | 1 - .usr/bin/xmpp | 89 -------------- .usr/etc/afew/config | 6 - .usr/etc/alot/config | 1 - .usr/etc/bash/check.sh | 57 --------- .usr/etc/bash/inputrc | 2 - .usr/etc/bash/privrc.sh | 1 - .usr/etc/bash/vcs-ps1.sh | 158 ------------------------- .usr/etc/gnupg/gpg.conf | 1 - .usr/etc/gnupg/sshcontrol | 1 - .usr/etc/guix/channels.scm | 20 ---- .usr/etc/guix/home.scm | 152 ------------------------ .usr/etc/guix/system.scm | 102 ---------------- .usr/etc/hg/hgrc | 2 - .usr/etc/i3/config | 186 ----------------------------- .usr/etc/info/infokey | 7 -- .usr/etc/khal/config | 1 - .usr/etc/khard/khard.conf | 1 - .usr/etc/mailcaps/config | 1 - .usr/etc/mbsync/config | 1 - .usr/etc/msmtp/config | 1 - .usr/etc/newsboat/urls | 1 - .usr/etc/notmuch/default/config | 1 - .usr/etc/notmuch/default/hooks/post-new | 1 - .usr/etc/python/pythonrc.py | 15 --- .usr/etc/ranger/rc.conf | 1 - .usr/etc/sbcl/sbclrc.lisp | 6 - .usr/etc/ssh/known_hosts | 74 ------------ .usr/etc/tmux/tmux.conf | 81 ------------- .usr/etc/weechat/irc.conf | 1 - bin/backup | 128 ++++++++++++++++++++ bin/brightness | 13 ++ bin/clamp | 74 ++++++++++++ bin/color | 204 ++++++++++++++++++++++++++++++++ bin/copy | 67 +++++++++++ bin/e | 79 +++++++++++++ bin/email | 74 ++++++++++++ bin/gc | 105 ++++++++++++++++ bin/grun | 102 ++++++++++++++++ bin/max | 61 ++++++++++ bin/min | 61 ++++++++++ bin/mkdtemp | 24 ++++ bin/mkstemp | 24 ++++ bin/msg | 90 ++++++++++++++ bin/open | 101 ++++++++++++++++ bin/pre | 72 +++++++++++ bin/print | 151 +++++++++++++++++++++++ bin/qr | 58 +++++++++ bin/rfc | 117 ++++++++++++++++++ bin/tmpname | 52 ++++++++ bin/uuid | 53 +++++++++ bin/with-email | 84 +++++++++++++ bin/without-env | 76 ++++++++++++ bin/xdg-open | 1 + bin/xmpp | 89 ++++++++++++++ etc/afew/config | 6 + etc/alot/config | 1 + etc/bash/check.sh | 57 +++++++++ etc/bash/inputrc | 2 + etc/bash/privrc.sh | 1 + etc/bash/vcs-ps1.sh | 158 +++++++++++++++++++++++++ etc/gnupg/gpg.conf | 1 + etc/gnupg/sshcontrol | 1 + etc/guix/channels.scm | 20 ++++ etc/guix/home.scm | 152 ++++++++++++++++++++++++ etc/guix/system.scm | 102 ++++++++++++++++ etc/hg/hgrc | 2 + etc/i3/config | 186 +++++++++++++++++++++++++++++ etc/info/infokey | 7 ++ etc/khal/config | 1 + etc/khard/khard.conf | 1 + etc/mailcaps/config | 1 + etc/mbsync/config | 1 + etc/msmtp/config | 1 + etc/newsboat/urls | 1 + etc/notmuch/default/config | 1 + etc/notmuch/default/hooks/post-new | 1 + etc/python/pythonrc.py | 15 +++ etc/ranger/rc.conf | 1 + etc/sbcl/sbclrc.lisp | 6 + etc/ssh/known_hosts | 74 ++++++++++++ etc/tmux/tmux.conf | 81 +++++++++++++ etc/weechat/irc.conf | 1 + 106 files changed, 2842 insertions(+), 2842 deletions(-) delete mode 100755 .usr/bin/backup delete mode 100755 .usr/bin/brightness delete mode 100755 .usr/bin/clamp delete mode 100755 .usr/bin/color delete mode 100755 .usr/bin/copy delete mode 100755 .usr/bin/e delete mode 100755 .usr/bin/email delete mode 100755 .usr/bin/gc delete mode 100755 .usr/bin/grun delete mode 100755 .usr/bin/max delete mode 100755 .usr/bin/min delete mode 100755 .usr/bin/mkdtemp delete mode 100755 .usr/bin/mkstemp delete mode 100755 .usr/bin/msg delete mode 100755 .usr/bin/open delete mode 100755 .usr/bin/pre delete mode 100755 .usr/bin/print delete mode 100755 .usr/bin/qr delete mode 100755 .usr/bin/rfc delete mode 100755 .usr/bin/tmpname delete mode 100755 .usr/bin/uuid delete mode 100755 .usr/bin/with-email delete mode 100755 .usr/bin/without-env delete mode 120000 .usr/bin/xdg-open delete mode 100755 .usr/bin/xmpp delete mode 100644 .usr/etc/afew/config delete mode 120000 .usr/etc/alot/config delete mode 100755 .usr/etc/bash/check.sh delete mode 100644 .usr/etc/bash/inputrc delete mode 120000 .usr/etc/bash/privrc.sh delete mode 100644 .usr/etc/bash/vcs-ps1.sh delete mode 100644 .usr/etc/gnupg/gpg.conf delete mode 100644 .usr/etc/gnupg/sshcontrol delete mode 100644 .usr/etc/guix/channels.scm delete mode 100644 .usr/etc/guix/home.scm delete mode 100644 .usr/etc/guix/system.scm delete mode 100644 .usr/etc/hg/hgrc delete mode 100644 .usr/etc/i3/config delete mode 100644 .usr/etc/info/infokey delete mode 120000 .usr/etc/khal/config delete mode 120000 .usr/etc/khard/khard.conf delete mode 100644 .usr/etc/mailcaps/config delete mode 120000 .usr/etc/mbsync/config delete mode 120000 .usr/etc/msmtp/config delete mode 120000 .usr/etc/newsboat/urls delete mode 120000 .usr/etc/notmuch/default/config delete mode 120000 .usr/etc/notmuch/default/hooks/post-new delete mode 100644 .usr/etc/python/pythonrc.py delete mode 100644 .usr/etc/ranger/rc.conf delete mode 100644 .usr/etc/sbcl/sbclrc.lisp delete mode 100644 .usr/etc/ssh/known_hosts delete mode 100644 .usr/etc/tmux/tmux.conf delete mode 120000 .usr/etc/weechat/irc.conf create mode 100755 bin/backup create mode 100755 bin/brightness create mode 100755 bin/clamp create mode 100755 bin/color create mode 100755 bin/copy create mode 100755 bin/e create mode 100755 bin/email create mode 100755 bin/gc create mode 100755 bin/grun create mode 100755 bin/max create mode 100755 bin/min create mode 100755 bin/mkdtemp create mode 100755 bin/mkstemp create mode 100755 bin/msg create mode 100755 bin/open create mode 100755 bin/pre create mode 100755 bin/print create mode 100755 bin/qr create mode 100755 bin/rfc create mode 100755 bin/tmpname create mode 100755 bin/uuid create mode 100755 bin/with-email create mode 100755 bin/without-env create mode 120000 bin/xdg-open create mode 100755 bin/xmpp create mode 100644 etc/afew/config create mode 120000 etc/alot/config create mode 100755 etc/bash/check.sh create mode 100644 etc/bash/inputrc create mode 120000 etc/bash/privrc.sh create mode 100644 etc/bash/vcs-ps1.sh create mode 100644 etc/gnupg/gpg.conf create mode 100644 etc/gnupg/sshcontrol create mode 100644 etc/guix/channels.scm create mode 100644 etc/guix/home.scm create mode 100644 etc/guix/system.scm create mode 100644 etc/hg/hgrc create mode 100644 etc/i3/config create mode 100644 etc/info/infokey create mode 120000 etc/khal/config create mode 120000 etc/khard/khard.conf create mode 100644 etc/mailcaps/config create mode 120000 etc/mbsync/config create mode 120000 etc/msmtp/config create mode 120000 etc/newsboat/urls create mode 120000 etc/notmuch/default/config create mode 120000 etc/notmuch/default/hooks/post-new create mode 100644 etc/python/pythonrc.py create mode 100644 etc/ranger/rc.conf create mode 100644 etc/sbcl/sbclrc.lisp create mode 100644 etc/ssh/known_hosts create mode 100644 etc/tmux/tmux.conf create mode 120000 etc/weechat/irc.conf diff --git a/.usr/bin/backup b/.usr/bin/backup deleted file mode 100755 index cab37dc..0000000 --- a/.usr/bin/backup +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - backup [-v] [-C COMMENT] ARCHIVE_TAG - backup -h - EOF -} - -help() { - cat <<-'EOF' - - - Options: - -v enable verbose mode, useful for - interactive sessions - -C COMMENT the comment text to be attached to the archive - -h, --help show this message - - ARCHIVE_TAG the tag used to create the new - backup (default: "cronjob") - - - The repository is expected to have been created with: - - $ borg init -e repokey-blake2 - - The following environment variables are expected to be exported: - - $BORG_PASSCOMMAND - $BORG_REPO - $BORG_REMOTE_PATH - - Password-less SSH access is required, usually done via adding - ~/.ssh/id_rsa.pub to suyin:.ssh/authorized_keys. - - - Examples: - - Run backup from cronjob: - - $ backup cronjob - - Create backup with comment, and verbose mode active: - - $ backup -vC 'The backup has a comment' my-backup - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -VERBOSE_FLAGS='' -COMMENT='' -while getopts 'vC:h' flag; do - case "$flag" in - v) - VERBOSE_FLAGS='--verbose --progress' - ;; - C) - COMMENT="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - -ARCHIVE_TAG="${1:-}" -assert_arg "$ARCHIVE_TAG" 'ARCHIVE_TAG' - - -finish() { - STATUS=$? - printf '\n>>>\n>>> exit status: %s\n>>>\n\n' "$STATUS" >&2 -} -trap finish EXIT - -run() { - borg create \ - $VERBOSE_FLAGS \ - --comment "$COMMENT" \ - --exclude ~/.cache/ \ - --exclude ~/Downloads/ \ - --stats \ - --compression lzma,9 \ - "::{hostname}-{now}-$ARCHIVE_TAG" \ - ~/ - STATUS=$? - - if [ "$STATUS" = 0 ] || [ "$STATUS" = 1 ]; then - echo 'WARNING, but no ERROR.' >&2 - return 0 - else - return "$STATUS" - fi -} - -run || exit $? diff --git a/.usr/bin/brightness b/.usr/bin/brightness deleted file mode 100755 index 8e178ad..0000000 --- a/.usr/bin/brightness +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -set -eu - -BRIGHTNESS_DIFF="$1" - -DEVICE="$(cat "$XDG_CONFIG_HOME"/backlight-device)" -HANDLER="/sys/class/backlight/$DEVICE" - -OLD_BRIGHTNESS="$(cat "$HANDLER"/brightness)" -MAX_BRIGHTNESS="$(cat "$HANDLER"/max_brightness)" -SUM=$((OLD_BRIGHTNESS + BRIGHTNESS_DIFF)) -NEW_BRIGHTNESS="$(clamp -- "$SUM" 0 "$MAX_BRIGHTNESS")" -echo "$NEW_BRIGHTNESS" > "$HANDLER"/brightness || sudo chmod 666 "$HANDLER/brightness" diff --git a/.usr/bin/clamp b/.usr/bin/clamp deleted file mode 100755 index a40b823..0000000 --- a/.usr/bin/clamp +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - clamp NUMBER MIN MAX - clamp -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Clamp the NUMBER between MIN and MAX. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - -NUMBER="${1:-}" -MIN="${2:-}" -MAX="${3:-}" - -assert_arg "$NUMBER" 'NUMBER' -assert_arg "$MIN" 'MIN' -assert_arg "$MAX" 'MAX' - - -if [ "$MIN" -gt "$MAX" ]; then - printf 'MIN (%s) is greater then MAX (%s).\n' "$MIN" "$MAX" >&2 - exit 2 -fi - -min -- "$(max -- "$NUMBER" "$MIN")" "$MAX" diff --git a/.usr/bin/color b/.usr/bin/color deleted file mode 100755 index 0597278..0000000 --- a/.usr/bin/color +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - color -c COLOR TEXT - color -h - EOF -} - -help() { - cat <<-'EOF' - - - Options: - -c COLOR - -h, --help show this message - - - The available colors are: - EOF - list_colors | sed 's/^/ /' -} - - -END="\033[0m" - -black() { - BLACK="\033[0;30m" - printf "${BLACK}${1}${END}" -} - -blackb() { - BLACK_B="\033[1;30m" - printf "${BLACK_B}${1}${END}" -} - -blacki() { - BLACK_I="\033[0;90m" - printf "${BLACK_I}${1}${END}" -} - -white() { - WHITE="\033[0;37m" - printf "${WHITE}${1}${END}" -} - -whiteb() { - WHITE_B="\033[1;37m" - printf "${WHITE_B}${1}${END}" -} - -red() { - RED="\033[0;31m" - printf "${RED}${1}${END}" -} - -redb() { - RED_B="\033[1;31m" - printf "${RED_B}${1}${END}" -} - -green() { - GREEN="\033[0;32m" - printf "${GREEN}${1}${END}" -} - -greenb() { - GREEN_B="\033[1;32m" - printf "${GREEN_B}${1}${END}" -} - -yellow() { - YELLOW="\033[0;33m" - printf "${YELLOW}${1}${END}" -} - -yellowb() { - YELLOW_B="\033[1;33m" - printf "${YELLOW_B}${1}${END}" -} - -blue() { - BLUE="\033[0;34m" - printf "${BLUE}${1}${END}" -} - -blueb() { - BLUE_B="\033[1;34m" - printf "${BLUE_B}${1}${END}" -} - -bluei() { - BLUE_I="\033[0;94m" - printf "${BLUE_I}${1}${END}" -} - -purple() { - PURPLE="\033[0;35m" - printf "${PURPLE}${1}${END}" -} - - -purpleb() { - PURPLE_B="\033[1;35m" - printf "${PURPLE_B}${1}${END}" -} - -lightblue() { - LIGHT_BLUE="\033[0;36m" - printf "${LIGHT_BLUE}${1}${END}" -} - -lightblueb() { - LIGHT_BLUE_B="\033[1;36m" - printf "${LIGHT_BLUE_B}${1}${END}" -} - -COLOR_LIST=' -black -blackb -white -whiteb -red -redb -green -greenb -yellow -yellowb -blue -blueb -purple -purpleb -lightblue -lightblueb -blacki -bluei -' -list_colors() { - for c in $COLOR_LIST; do - printf '%s\n' "$("$c" "$c")" - done -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'c:h' flag; do - case "$flag" in - c) - EXISTS=false - for c in $COLOR_LIST; do - if [ "$OPTARG" = "$c" ]; then - EXISTS=true - break - fi - done - if [ "$EXISTS" = false ]; then - printf 'Invalid color: %s\n' "$OPTARG" >&2 - exit 2 - fi - COLOR_FN="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - -TEXT="${1:-}" -assert_arg "$COLOR_FN" '-c COLOR' -assert_arg "$TEXT" 'TEXT' - - -"$COLOR_FN" "$TEXT" diff --git a/.usr/bin/copy b/.usr/bin/copy deleted file mode 100755 index 64e1e32..0000000 --- a/.usr/bin/copy +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - copy [-n] < STDIN - copy -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -n remove newlines - -h, --help show this message - - Examples: - - Copy numbers to clipboard: - seq 10 | copy - - Copy string without newline: - echo 'with automatic newline' | copy -n - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -TRIM=false -while getopts 'nh' flag; do - case "$flag" in - n) - TRIM=true - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -if [ "$TRIM" = true ]; then - cat - | tr -d '\n' | xclip -sel clip -else - cat - | xclip -sel clip -fi diff --git a/.usr/bin/e b/.usr/bin/e deleted file mode 100755 index 76b4899..0000000 --- a/.usr/bin/e +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - e [FILE] - e -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help - - - Flexibly run a text editor, either directly on in a pipe. - - Examples: - - Edit "file.txt": - - $ e file.txt - - Manipulate the content of a pipe midway: - - $ seq 10 | e | grep 5 - - The editor used is either $VISUAL or $EDITOR, with a fallback to - vi in case any of those variables aren't defined. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -CMD="${VISUAL:-${EDITOR:-vi}}" - -if [ ! -t 0 ]; then - F="$(mkstemp)" - cat > "$F" - exec 0&1 - exec 1>/dev/tty - $CMD "$F" - cat "$F" >&3 -else - $CMD "$@" -fi diff --git a/.usr/bin/email b/.usr/bin/email deleted file mode 100755 index 0a1fd15..0000000 --- a/.usr/bin/email +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - mail -s SUBJECT ADDRESS... < BODY - mail -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -s SUBJECT the email subject - -h, --help show this message - - ADDRESS the email addresses to send the email to - BODY the text to be sent as the body - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 's:h' flag; do - case "$flag" in - s) - SUBJECT="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - { - printf 'Missing %s.\n' "$2" - printf '\n' - usage - } >&2 - exit 2 - fi -} - -assert_arg "${SUBJECT:-}" '-s SUBJECT' -assert_arg "${1:-}" 'ADDRESS' - -printf 'Subject: %s\n\n%s' \ - "$(echo "$SUBJECT" | tr -d '\n')" \ - "$(cat)" | - msmtpq -a euandreh "$@" diff --git a/.usr/bin/gc b/.usr/bin/gc deleted file mode 100755 index ec6a8f1..0000000 --- a/.usr/bin/gc +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - gc - gc -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -disk() { - df -h . | - awk 'NR == 2 { printf "%s - %s/%s\n", $4, $3, $2 }' -} - - -gc_guix() { - pass show velhinho/0-andreh-password | sudo -S guix system delete-generations - guix home delete-generations - guix gc -d -} - -gc_nohup() { - find ~/ -type f -name 'nohup.out' -exec rm -vf "{}" \; -} - -gc_trash() { - yes | trash-empty -} - -gc_tmpdir() { - find /tmp/ -type f -atime +10 -exec rm -vf "{}" \; ||: -} - -gc_docker() { - if command -v docker; then - yes | docker system prune -a - docker rmi "$(docker images -a -q)" ||: - docker rm "$(docker ps -a -f status=exited -q)" ||: - docker stop "$(docker ps -a -q)" ||: - docker rm "$(docker ps -a -q)" ||: - yes | docker volume prune - yes | docker container prune - fi -} - -gc_email() { - notmuch search --output=files --exclude=false tag:killed | - xargs -I{} rm -vf "{}" -} - - -BEFORE="$(disk)" -gc_guix -gc_nohup -gc_trash -gc_tmpdir -gc_docker -gc_email -wait -AFTER="$(disk)" - -printf 'Disk space:\n' -printf ' before: %s\n' "$BEFORE" -printf ' after: %s\n' "$AFTER" diff --git a/.usr/bin/grun b/.usr/bin/grun deleted file mode 100755 index 5884e9e..0000000 --- a/.usr/bin/grun +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - grun [-r RECIPIENT] FILENAME -- COMMAND... - grun -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -r RECIPIENT the recipient to encrypt to. Can be given - multiple for multiple recipients. - -h, --help show this message - - COMMAND A command to be executed, that accepts input - in STDIN and emits result in STDOUT, and emits - errors as non-zero return codes. - FILENAME The GPG-encrypted file to be processed. If it - doesn't exist yet, it will be created. - - Examples: - - Edit "secrets.txt.gpg" using `vipe` and the default recipient: - - $ grun secrets.txt.gpg -- vipe - - Delete lines containing "FIXME" in todos.gpg: - - $ grun -r ABC123DEF321 todos.gpg -- sed '/FIXME/d' - - If COMMAND emits a non-zero return code, the file is left - unmodified. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'rh' flag; do - case "$flag" in - r) - RECIPIENTS_FLAG="${RECIPIENTS_FLAG:-} -r $OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - -FILENAME="${1:-}" -assert_arg "$FILENAME" 'FILENAME' -shift - -if [ "${1:-}" != '--' ]; then - printf 'Missing "--" separator\n\n' >&2 - usage >&2 - exit 2 -fi -shift - -assert_arg "${1:-}" 'COMMAND' - - -if [ ! -e "$FILENAME" ]; then - OUT="$(printf '' | "$@")" -else - OUT="$(gpg -dq "$FILENAME" | "$@")" -fi - -echo "$OUT" | gpg -e ${RECIPIENTS_FLAG:--r eu@euandre.org} | sponge "$FILENAME" diff --git a/.usr/bin/max b/.usr/bin/max deleted file mode 100755 index 84585ee..0000000 --- a/.usr/bin/max +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - max NUMBER... - max -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Get the maximum number from the given values. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -if [ -z "${1:-}" ]; then - echo 0 - exit -fi - -N="$1" -for n in "$@"; do - N=$((N > n ? N : n)) -done -echo "$N" diff --git a/.usr/bin/min b/.usr/bin/min deleted file mode 100755 index 7868623..0000000 --- a/.usr/bin/min +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - min NUMBER... - min -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Get the minimun number from the given values. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -if [ -z "${1:-}" ]; then - echo 0 - exit -fi - -N="$1" -for n in "$@"; do - N=$((N < n ? N : n)) -done -echo "$N" diff --git a/.usr/bin/mkdtemp b/.usr/bin/mkdtemp deleted file mode 100755 index 9c7ddd8..0000000 --- a/.usr/bin/mkdtemp +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - mkstemp - mkstemp -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Create a new temporary file and echo its name back. - EOF -} - -name="$(tmpname)" -mkdir "$name" -echo "$name" diff --git a/.usr/bin/mkstemp b/.usr/bin/mkstemp deleted file mode 100755 index ec92c14..0000000 --- a/.usr/bin/mkstemp +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - mkstemp - mkstemp -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Create a new temporary file and echo its name back. - EOF -} - -name="$(tmpname)" -touch "$name" -echo "$name" diff --git a/.usr/bin/msg b/.usr/bin/msg deleted file mode 100755 index f3e893e..0000000 --- a/.usr/bin/msg +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - msg -X XMPP_MESSAGE -s -S SOUND_MESSAGE -m EMAIL -D DESKTOP -b - msg -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -X XMPP_MESSAGE send XMPP using the `xmpp` command - -s play ~/Desktop/medium.ogg sound - -S SOUND_MESSAGE say SOUND_MESSAGE using `speak` - -m EMAIL_SUBJECT send email with EMAIL_SUBJECT and empty body - -D DESKTOP_MESSAGE the desktop message for `notify-send` - -b print terminal bell - -h, --help show this message - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -sound() { - play ~/Desktop/medium.ogg 2>/dev/null & -} - -ACTION_DONE=false -while getopts 'X:sS:m:D:bh' flag; do - case "$flag" in - X) - xmpp -m "$OPTARG" eu@euandreh.xyz - ACTION_DONE=true - ;; - s) - sound - ACTION_DONE=true - ;; - S) - echo "$OPTARG" | speak -v pt-BR - ACTION_DONE=true - ;; - m) - echo "" | email -s "$OPTARG" eu@euandre.org - ACTION_DONE=true - ;; - D) - notify-send "$OPTARG" - ACTION_DONE=true - ;; - b) - printf '\a' - ACTION_DONE=true - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done - -if [ "$ACTION_DONE" = false ]; then - sound - usage - help -fi - -wait diff --git a/.usr/bin/open b/.usr/bin/open deleted file mode 100755 index df1ad56..0000000 --- a/.usr/bin/open +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - open FILE... - open -h -EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Examples: - - Open an HTML file on the current $BROWSER: - open index.html - - Open multiple PDF files (with zathura): - open *.pdf -EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -if [ -z "${1:-}" ]; then - usage >&2 - exit 2 -fi - -for f in "$@"; do - case "$f" in - *.ico|*.jpg|*.jpeg|*.png) - feh "$f" - ;; - https://www.youtube.com/watch*) - nohup mpv "$f" 1>&2 2>/dev/null & - ;; - *.flac|*.ogg|*.mkv|*.avi|*.mp4) - nohup mpv "$f" 1>&2 2>/dev/null & - ;; - http*|*.svg|*.html) - "$BROWSER" "$f" - ;; - gopher://*) - amfora "$f" - ;; - gemini://*) - telescope "$f" - ;; - *.pdf|*.djvu|*.ps|*.epub) - nohup zathura "$f" 1>&2 2>/dev/null & - ;; - *.txt) - less "$f" - ;; - *.midi) - timidity "$f" - ;; - mailto:*) - alot compose "$f" - ;; - *) - DIR="$(cd -- "$(dirname -- "$0")"; pwd)" - CMD="$(without-env PATH "$DIR" -- command -v xdg-open)" - "$CMD" "$f" - ;; - esac -done diff --git a/.usr/bin/pre b/.usr/bin/pre deleted file mode 100755 index 233ac1a..0000000 --- a/.usr/bin/pre +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - pre [-c COLOR] PREFIX - pre -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -c COLOR ANSI color to be used on the prefix text - -h, --help show this message - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -COLOR='' -while getopts 'c:h' flag; do - case "$flag" in - c) - COLOR="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - -PREFIX="${1:-}" -assert_arg "$PREFIX" 'PREFIX' - -while read -r line; do - if [ -z "$COLOR" ]; then - printf '%s: %s\n' "$PREFIX" "$line" - else - printf '%s: %s\n' "$(color -c "$COLOR" "$PREFIX")" "$line" - fi -done diff --git a/.usr/bin/print b/.usr/bin/print deleted file mode 100755 index 735d8ba..0000000 --- a/.usr/bin/print +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - print [-d] [-q QUALITY] [FILE...] - print -h -EOF -} - -help() { - cat <<-'EOF' - - Options: - -d print duplex/double-sided - -q QUALITY choose the print quality, either: - low, medium (default) or high. - -h, --help show this message - - Examples: - - Print the given PostScript file with default quality: - $ print f1.ps - - Print multiple PDF files with high quality: - $ print -dq high *.pdf - - Print the file from STDIN, double-sided: - $ print -d < f2.ps - - Print multiple source code files: - $ print src/*.{c,h} -EOF -} - -mkdtemp() { - name="$(echo 'mkstemp(template)' | - m4 -D template="${TMPDIR:-/tmp}/m4-tmpname.")" - rm -f "$name" - mkdir "$name" - echo "$name" -} - -n_pages() { - pdftk "$1" dump_data | awk '/NumberOfPages/ { print $2 }' -} - -main() { - if file -b "$FILE" | grep -q PostScript; then - ps2pdf "$FILE" "$NEWDIR"/in.pdf - elif file -b "$FILE" | grep -q PDF; then - cp "$FILE" "$NEWDIR"/in.pdf - else - enscript -o- "$FILE" | ps2pdf - "$NEWDIR"/in.pdf - fi - cd "$NEWDIR" - - if [ -z "$DUPLEX" ]; then - lp in.pdf - cd - > /dev/null - return - fi - - if [ "$(n_pages in.pdf)" = '1' ]; then - lp in.pdf - return - fi - - pdftk A=in.pdf cat Aodd output odd.pdf - pdftk A=in.pdf cat Aeven output even.pdf - - NODD="$(n_pages odd.pdf)" - NEVEN="$(n_pages even.pdf)" - - printf 'Printing odd pages...\n' >&2 - lp odd.pdf - printf 'Has printing finished yet? Once it does, reload the pages and hit it enter to continue. ' - read -r < /dev/tty - lp even.pdf - - if [ "$NODD" != "$NEVEN" ]; then - printf '\n' | lp - fi - - cd - > /dev/null -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -lpoptions -o PrintQuality=standard -DUPLEX= -while getopts 'dq:h' flag; do - case "$flag" in - d) - DUPLEX=1 - ;; - q) - case "$OPTARG" in - low) - lpoptions -o PrintQuality=draft - ;; - medium) - lpoptions -o PrintQuality=standard - ;; - high) - lpoptions -o PrintQuality=high - ;; - *) - echo "Bad QUALITY option: \"$OPTARG\"" >&2 - exit 2 - ;; - esac - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -NEWDIR="$(mkdtemp)" -if [ -z "${1:-}" ]; then - FILE="$NEWDIR"/STDIN - cat - > "$FILE" - main -else - for f in "$@"; do - FILE="$f" - main - done -fi diff --git a/.usr/bin/qr b/.usr/bin/qr deleted file mode 100755 index 4821a46..0000000 --- a/.usr/bin/qr +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - qr [-s PIXEL_SIZE] - qr -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -s PIXEL_SIZE size of the pixel (default 10) - -h, --help show this help message - - Read data from STDIN and present a QR image with said data. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -PIXEL_SIZE=10 -while getopts 's:h' flag; do - case "$flag" in - s) - PIXEL_SIZE="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -cat | qrencode -s "$PIXEL_SIZE" -o- | feh - diff --git a/.usr/bin/rfc b/.usr/bin/rfc deleted file mode 100755 index a483595..0000000 --- a/.usr/bin/rfc +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -set -eu - -TARBALL_URL='https://www.rfc-editor.org/in-notes/tar/RFC-all.tar.gz' - -usage() { - cat <<-'EOF' - Usage: - rfc [-w] RFC_NUMBER - rfc -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -w Show the path to the RFC file instead of displaying - its contents. - -h, --help show this message - - Lookup the given RFC - in $XDG_DATA_HOME/doc/rfc/ (defaults to ~/.local/share), - and feed it into the $PAGER, akin to doing: - - $ $PAGER $XDG_DATA_HOME/doc/rfc/rfc$RFC_NUMBER.txt - - If the $XDG_DATA_HOME/doc/rfc/ directory doesn't exist, it tries to - create it by downloading the latest RFC tarball [0] and placing all .txt - files there. - EOF - - printf '\n[0]: %s\n' "$TARBALL_URL" -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'wh' flag; do - case "$flag" in - w) - WHERE=true - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -RFC_NUMBER="${1:-}" -if [ -z "$RFC_NUMBER" ]; then - echo 'Missing argument RFC_NUMBER' >&2 - usage >&2 - exit 2 -fi - -D="${XDG_DATA_HOME:-$HOME/.local/share}/doc/rfc" -if [ ! -e "$D" ]; then - printf 'RFC directory does not exist:\n\t%s/\n\n' "$D" - printf 'Do you want to download the files to create it? [Y/n] ' - read -r yesno - if [ "$yesno" != 'n' ] && [ "$yesno" != 'N' ]; then - CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/rfc-cli" - mkdir -p "$CACHE_DIR" - wget -cO "$CACHE_DIR"/RFC-all.tar.gz "$TARBALL_URL" - rm -rf "$CACHE_DIR/tmp" - mkdir -p "$CACHE_DIR/tmp" - tar \ - -C "$CACHE_DIR/tmp" \ - -xvf "$CACHE_DIR"/RFC-all.tar.gz \ - --wildcards \ - 'rfc*.txt' - mkdir -p "$(dirname "$D")" - mv "$CACHE_DIR/tmp" "$D" - fi -fi - -F="$D/rfc${RFC_NUMBER}.txt" -if [ ! -e "$F" ]; then - printf 'Given RFC_NUMBER "%s" does not exist at:\n%s\n' \ - "$RFC_NUMBER" "$F" >&2 - exit 2 -fi - -if [ "${WHERE:-}" = true ]; then - printf '%s\n' "$F" - exit -fi - -view() { - if [ -t 1 ]; then - ${PAGER:-cat} - else - cat - fi -} - -view < "$F" diff --git a/.usr/bin/tmpname b/.usr/bin/tmpname deleted file mode 100755 index d83fc87..0000000 --- a/.usr/bin/tmpname +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - tmpname - tmpname -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Generate a temporary name. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -echo "${TMPDIR:-/tmp}/uuid-tmpname with spaces.$(uuid)" diff --git a/.usr/bin/uuid b/.usr/bin/uuid deleted file mode 100755 index 74d0fba..0000000 --- a/.usr/bin/uuid +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - uuid - uuid -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Generate UUID from /dev/random. - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -od -xN20 /dev/random | - awk 'NR == 1 { OFS="-"; print $2$3,$4,$5,$6,$7$8$9; exit }' diff --git a/.usr/bin/with-email b/.usr/bin/with-email deleted file mode 100755 index 9d6326b..0000000 --- a/.usr/bin/with-email +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - with-email [-s SUBJECT] COMMAND... - with-email -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -s SUBJECT set the subject of the email - -h, --help show this message - - COMMAND the command to be wrapped - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -SUBJECT='NO SUBJECT' -while getopts 's:h' flag; do - case "$flag" in - s) - SUBJECT="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n\n' "$2" >&2 - usage >&2 - exit 2 - fi -} - -assert_arg "${1:-}" 'COMMAND...' - -now() { - date '+%Y-%m-%dT%H:%M:%S%Z' -} - -OUT="$(mkstemp)" -{ - printf 'Running command: %s\n' "$*" - printf 'Starting at: %s\n' "$(now)" - printf '\n' - - STATUS=0 - "$@" 2>&1 || STATUS=$? - - printf '\n' - printf '\nFinished at: %s\n' "$(now)" -} 2>&1 1>"$OUT" - -email -s "(exit status: $STATUS) - $SUBJECT" eu@euandre.org < "$OUT" diff --git a/.usr/bin/without-env b/.usr/bin/without-env deleted file mode 100755 index 45c41ca..0000000 --- a/.usr/bin/without-env +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - without-env ENVVAR PATH -- COMMAND... - without-env [-h] - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - - Examples: - - Execute "command -V" filtering ~/bin, to get where "w3m" is - in $PATH, other than ~/bin: - $ without-env PATH ~/bin -- command -v w3m - - Compile foo.c, excluding ~/.local/include - from $C_INCLUDE_PATH: - $ without-env C_INCLUDE_PATH ~/.local/include -- cc -co foo.o foo.c - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s\n' "$2" >&2 - exit 2 - fi -} - -assert_arg "${1:-}" 'ENVVAR' -assert_arg "${2:-}" 'PATH' -assert_arg "${3:-}" '--' - -eval "export $1=\"\$(echo \"\$$1\" | sed \"s|\$2:||g\")\"" -shift # drop $1 -shift # drop $2 -shift # drop -- - -"$@" diff --git a/.usr/bin/xdg-open b/.usr/bin/xdg-open deleted file mode 120000 index ce4a72b..0000000 --- a/.usr/bin/xdg-open +++ /dev/null @@ -1 +0,0 @@ -open \ No newline at end of file diff --git a/.usr/bin/xmpp b/.usr/bin/xmpp deleted file mode 100755 index 472e9ca..0000000 --- a/.usr/bin/xmpp +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import getopt -import logging -import slixmpp - -USAGE = """\ -Usage: - xmpp [-d] [-F FROM_JID] -m MESSAGE TO_JID... - xmpp -h""" - -HELP = """ -Options: - -d run in DEBUG mode - -m MESSAGE the text of the message to be sent - -h, --help show this message - - FROM_JID the address used to send the message from - TO_JID the addresses where to send the message to""" - -class SendMsgBot(slixmpp.ClientXMPP): - def __init__(self, jid, password, on_start): - slixmpp.ClientXMPP.__init__(self, jid, password) - - self.on_start = on_start - self.add_event_handler("session_start", self.start) - - def start(self, event): - self.on_start(self) - self.disconnect(wait=True) - -def main(): - logging.basicConfig(level=logging.INFO) - from_ = "bot@euandreh.xyz" - message = "" - - for s in sys.argv: - if s == "--": - break - elif s == "--help": - print(USAGE) - print(HELP) - sys.exit() - - try: - opts, args = getopt.getopt(sys.argv[1:], 'm:F:dh') - except getopt.GetoptError as err: - print(err, file=sys.stderr) - print(USAGE, file=sys.stderr) - sys.exit(2) - for o, a in opts: - if o == "-m": - message = a - elif o == "-F": - from_ = a - elif o == "-d": - logging.basicConfig(level=logging.DEBUG) - elif o == "-h": - print(USAGE) - print(HELP) - sys.exit() - else: - assert False, "unhandled option" - - if message == "": - print("Missing -m MESSAGE", file=sys.stderr) - print(USAGE, file=sys.stderr) - sys.exit(2) - - if args == []: - print("Missing TO_JID", file=sys.stderr) - print(USAGE, file=sys.stderr) - sys.exit(2) - - passcmd = "pass show VPS/kuvira/XMPP/" + from_ + " | head -n1 | tr -d '\\n'" - password = os.popen(passcmd).read() - - def on_start(self): - for to in args: - self.send_message(mto=to, mbody=message, mtype='chat') - - xmpp = SendMsgBot(from_, password, on_start) - xmpp.connect() - xmpp.process(forever=False) - -if __name__ == "__main__": - main() diff --git a/.usr/etc/afew/config b/.usr/etc/afew/config deleted file mode 100644 index 94341e9..0000000 --- a/.usr/etc/afew/config +++ /dev/null @@ -1,6 +0,0 @@ -[SpamFilter] -[KillThreadsFilter] -[ListMailsFilter] -[ArchiveSentMailsFilter] -[MeFilter] -[InboxFilter] diff --git a/.usr/etc/alot/config b/.usr/etc/alot/config deleted file mode 120000 index a92319d..0000000 --- a/.usr/etc/alot/config +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/alot/config \ No newline at end of file diff --git a/.usr/etc/bash/check.sh b/.usr/etc/bash/check.sh deleted file mode 100755 index 7c12dec..0000000 --- a/.usr/etc/bash/check.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - check.sh - check.sh -h - EOF -} - -help() { - cat <<-'EOF' - - Options: - -h, --help show this message - EOF -} - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -shellcheck -xe 1090,1091 \ - "$XDG_CONFIG_HOME"/bash/rc \ - "$XDG_CONFIG_HOME"/bash/vcs-ps1.sh \ - "$XDG_CONFIG_HOME"/bash/check.sh \ - "$XDG_CONFIG_HOME"/bash/privrc.sh - -sh -eu ~/.profile diff --git a/.usr/etc/bash/inputrc b/.usr/etc/bash/inputrc deleted file mode 100644 index f5c7095..0000000 --- a/.usr/etc/bash/inputrc +++ /dev/null @@ -1,2 +0,0 @@ -"\e[B": history-search-forward -"\e[A": history-search-backward diff --git a/.usr/etc/bash/privrc.sh b/.usr/etc/bash/privrc.sh deleted file mode 120000 index 243a4bd..0000000 --- a/.usr/etc/bash/privrc.sh +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/privrc.sh \ No newline at end of file diff --git a/.usr/etc/bash/vcs-ps1.sh b/.usr/etc/bash/vcs-ps1.sh deleted file mode 100644 index f2103da..0000000 --- a/.usr/etc/bash/vcs-ps1.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/sh - -repo_status_git() { - BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" - OUT="$(git status --short --branch --porcelain)" - BRANCH_LINE="$(echo "$OUT" | head -n 1)" - DIFF_LINES="$(echo "$OUT" | tail -n +2)" - - IS_AHEAD=false - IS_BEHIND=false - if echo "$BRANCH_LINE" | grep -q 'ahead'; then - IS_AHEAD=true - fi - if echo "$BRANCH_LINE" | grep -q 'behind'; then - IS_BEHIND=true - fi - - LINE='' - - if [ "$IS_AHEAD" = true ] && [ "$IS_BEHIND" = true ]; then - LINE="^^^ $BRANCH_NAME vvv" - elif [ "$IS_AHEAD" = true ]; then - LINE="^ $BRANCH_NAME ^" - elif [ "$IS_BEHIND" = true ]; then - LINE="v $BRANCH_NAME v" - else - LINE="$BRANCH_NAME" - fi - - HAS_DIFF=false - HAS_UNTRACKED=false - if echo "$DIFF_LINES" | grep -q '^[A|D|M| ][M|D| ]'; then - HAS_DIFF=true - fi - if echo "$DIFF_LINES" | grep -q '^[?][?]'; then - HAS_UNTRACKED=true - fi - - if [ "$HAS_DIFF" = true ]; then - COLOR_FN=redb - LINE="{$LINE}" - elif [ "$IS_AHEAD" = true ] || [ "$IS_BEHIND" = true ]; then - COLOR_FN=bluei - LINE="[$LINE]" - elif [ "$HAS_UNTRACKED" = true ]; then - COLOR_FN=lightblue - LINE="{$LINE}" - else - COLOR_FN=green - LINE="($LINE)" - fi - - color -c "$COLOR_FN" "$LINE" - - BRANCH_COUNT="$(git branch --list | wc -l)" - if [ "$BRANCH_COUNT" -gt 1 ]; then - color -c lightblue "<$BRANCH_COUNT>" - fi - - STASH_COUNT="$(git stash list | wc -l)" - if [ "$STASH_COUNT" != 0 ]; then - color -c red "*$STASH_COUNT" - fi - - color -c blacki " - git/$(git rev-parse HEAD)" -} - -repo_status_fossil() { - BRANCH_NAME="$(fossil branch current)" - - if [ -n "$(fossil extras)" ]; then - HAS_UNTRACKED=1 - fi - - BRANCH_MARKER="$BRANCH_NAME" - - if [ -n "${HAS_UNTRACKED:-}" ]; then - COLOR_FN=lightblue - LINE="($BRANCH_MARKER)" - else - COLOR_FN=green - LINE="($BRANCH_MARKER)" - fi - - color -c "$COLOR_FN" "$LINE" - - color -c blacki " - fossil/$(fossil info | awk '/^checkout:/ { print $2 }')" -} - -repo_status_mercurial() { - BRANCH_NAME="$(hg branch)" -} - -repo_status() { - dir="$(basename "$PWD")" - if [ -d .git ]; then - repo_status_git - elif [ -f "$dir.fossil" ]; then - repo_status_fossil - elif [ -d .hg ]; then - repo_status_mercurial - fi -} - - -error_marker() { - STATUS=$? - if [ "$STATUS" != 0 ]; then - color -c redb " (!! $STATUS !!) " - fi -} - -timestamp() { - color -c blacki '\T' -} - -path() { - color -c yellowb '\w/' -} - -guix_env() { - if [ "$GUIX_ENVIRONMENT" != '' ]; then - printf '\n' - color -c blacki '~> ' - color -c purple 'guix environment ' - printf '(' - color -c blueb "$GUIX_ENVIRONMENT" - printf ')' - fi -} - -in_nix_shell() { - if [ "$IN_NIX_SHELL" != '' ]; then - printf '\n' - color -c blacki '~> ' - color -c purpleb "$IN_NIX_SHELL " - color -c purple 'nix-shell ' - printf '(' - color -c blueb "${name:-}" - printf ')' - fi -} - -PS1='`error_marker`'$(timestamp)' '$(path)' `repo_status``guix_env``in_nix_shell` -$ ' - - -vcs_status() { - git status "$@" -} - -vcs_diff() { - git diff "$@" -} - -vcs_diff_staged() { - git diff --staged "$@" -} diff --git a/.usr/etc/gnupg/gpg.conf b/.usr/etc/gnupg/gpg.conf deleted file mode 100644 index d4498fe..0000000 --- a/.usr/etc/gnupg/gpg.conf +++ /dev/null @@ -1 +0,0 @@ -keyserver pool.sks-keyservers.net diff --git a/.usr/etc/gnupg/sshcontrol b/.usr/etc/gnupg/sshcontrol deleted file mode 100644 index 1ae03ed..0000000 --- a/.usr/etc/gnupg/sshcontrol +++ /dev/null @@ -1 +0,0 @@ -750154E135FD7B11FDDF0107CC0904F92EBD2AE4 diff --git a/.usr/etc/guix/channels.scm b/.usr/etc/guix/channels.scm deleted file mode 100644 index 304db35..0000000 --- a/.usr/etc/guix/channels.scm +++ /dev/null @@ -1,20 +0,0 @@ -(append - (list - (channel - (name 'xyz-euandreh) - (url "git://euandreh.xyz/package-repository.git/") - (branch "main") - (introduction - (make-channel-introduction - "d749e053e6db365069cb9b2ef47a78b06f9e7361" - (openpgp-fingerprint - "5BDA E9B8 B2F6 C6BC BB0D 6CE5 81F9 0EC3 CD35 6060")))) - (channel - (name 'nonguix) - (url "https://gitlab.com/nonguix/nonguix") - (introduction - (make-channel-introduction - "897c1a470da759236cc11798f4e0a5f7d4d59fbc" - (openpgp-fingerprint - "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))) - %default-channels) diff --git a/.usr/etc/guix/home.scm b/.usr/etc/guix/home.scm deleted file mode 100644 index 607a059..0000000 --- a/.usr/etc/guix/home.scm +++ /dev/null @@ -1,152 +0,0 @@ -(use-modules - (curth0) - (gnu home services) - (gnu home services shells) - (gnu packages) - (gnu packages mail) - (gnu packages gnupg) - (gnu services) - (guix gexp) - (guix packages) - (guix utils)) - -(define msmtp-non-hardcoded - (package - (inherit msmtp) - (name "msmtp-non-hardcoded") - (arguments - (substitute-keyword-arguments (package-arguments msmtp) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'install-additional-files 'patch-hardcoded-paths - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (substitute* (string-append out "/bin/msmtpq") - (("^LOG=.*$") "LOG=${XDG_LOG_HOME:-$HOME/.local/var/log}/msmtpq.log\n") - (("^Q=.*$") "Q=${XDG_DATA_HOME:-$HOME/.local/share}/msmtp/queue\n") - (("mkdir -m 0700 \"\\$Q\"") "mkdir -p -m 0700 \"$Q\""))))))))))) - -(define (xdg-config-home s) - (string-append (getenv "XDG_CONFIG_HOME") "/" s)) - -(define gitconfig (mixed-text-file "gitconfig" #"- - [user] - email = eu@euandre.org - name = EuAndreh - signingkey = 81F90EC3CD356060 - [transfer] - fsckobjects = true - [push] - default = current - [commit] - gpgsign = true - verbose = true - [init] - defaultBranch = main - [sendemail] - assume8bitEncoding = UTF-8 - smtpserveroption = -a - smtpserveroption = euandreh - annotate = yes - confirm = never - smtpserver = "# msmtp-non-hardcoded "/bin/msmtpq\n")) - -(define gpg-agent.conf (mixed-text-file "gpg-agent.conf" #"- - default-cache-ttl 172800 - default-cache-ttl-ssh 172800 - max-cache-ttl 604800 - max-cache-ttl-ssh 604800 - enable-ssh-support - pinentry-program "# pinentry-gtk2 "/bin/pinentry-gtk-2\n")) - -(define config-files - `(("gnupg/gpg-agent.conf" ,gpg-agent.conf) - ("git/config" ,gitconfig))) - -(define (dot-config) - (define (prefix-with-config s) - (string-append (substring (getenv "XDG_CONFIG_HOME") - (+ 1 (string-length (getenv "HOME")))) - "/" - s)) - (map (lambda (t) - (list (prefix-with-config (first t)) - (second t))) - config-files)) - -(home-environment - (packages - (append - (map (compose list specification->package+output symbol->string) - '(man-pages - posix-man-pages - - tree - openssh - mailutils - entr - git - git:send-email - tmux - rsync - gnupg - pulseaudio - password-store - playerctl - pinentry-gtk2 - bmake - fzf - ranger - blueman - ledger - curl - xclip - cloc - strace - file - urlscan - rlwrap - direnv - borg - khal - khard - libfaketime - qrencode - feh - sox - xset - graphviz - moreutils - shellcheck - gettext - groff - - clojure - openjdk - sbcl - perl - perl-mojolicious - - st - i3status - dmenu - - weechat - alot - notmuch - isync - w3m - afew - - zathura - zathura-djvu - zathura-pdf-poppler - zathura-ps - firefox)) - (list msmtp-non-hardcoded))) - (services - (list (service home-bash-service-type - (home-bash-configuration - (bashrc - (list (plain-file "bashrc.sh" ". $XDG_CONFIG_HOME/bash/rc"))))) - (simple-service 'config-files home-files-service-type (dot-config))))) diff --git a/.usr/etc/guix/system.scm b/.usr/etc/guix/system.scm deleted file mode 100644 index 3bd7235..0000000 --- a/.usr/etc/guix/system.scm +++ /dev/null @@ -1,102 +0,0 @@ -(use-modules - (curth0) - (gnu bootloader) - (gnu bootloader grub) - (gnu packages) - (gnu services base) - (gnu services desktop) - (gnu services security-token) - (gnu services xorg) - (gnu system keyboard) - (gnu system file-systems) - (gnu system mapped-devices) - (guix gexp) - (nongnu packages linux) - (nongnu system linux-initrd)) - -(operating-system - (kernel linux) - (initrd microcode-initrd) - (firmware (list linux-firmware)) - (locale "fr_FR.UTF-8") - (timezone "America/Sao_Paulo") - (keyboard-layout - (keyboard-layout "br" #:options '("caps:swapescape" "esperanto:qwerty"))) - (host-name "velhinho") - (users - (append - (let ((user-groups '("wheel" "netdev" "audio" "video"))) - (list - (user-account - (name "andreh") - (comment "EuAndreh") - (group "users") - (supplementary-groups user-groups)) - (user-account - (name "other") - (comment "Other Self") - (group "users") - (supplementary-groups user-groups)))) - %base-user-accounts)) - (packages - (append - (map (compose list specification->package+output symbol->string) - '(nss-certs - i3-wm)) - %base-packages)) - (services - (append - (list - (service bluetooth-service-type) - (service pcscd-service-type) - (service gnome-desktop-service-type) - (set-xorg-configuration - (xorg-configuration - (keyboard-layout keyboard-layout) - (extra-config (list #"- - Section "InputClass" - Identifier "touchpad" - Driver "libinput" - MatchIsTouchpad "on" - Option "Tapping" "on" - EndSection - "#))))) - (modify-services %desktop-services - (guix-service-type config => - (guix-configuration - (inherit config) - (substitute-urls - (append '("https://substitutes.nonguix.org") - %default-substitute-urls)) - (authorized-keys - (append (list (plain-file "non-guix.pub" #"- - (public-key - (ecc - (curve Ed25519) - (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#))) - "#)) - %default-authorized-guix-keys))))))) - (bootloader - (bootloader-configuration - (bootloader grub-efi-bootloader) - (targets (list "/boot/efi")) - (keyboard-layout keyboard-layout))) - (mapped-devices - (list - (mapped-device - (source (uuid "6b0d38a6-d93e-4f8e-a59a-7729f5adf892")) - (target "cryptroot") - (type luks-device-mapping)))) - (file-systems - (append - (list - (file-system - (mount-point "/boot/efi") - (device (uuid "1B26-9F4E" 'fat32)) - (type "vfat")) - (file-system - (mount-point "/") - (device "/dev/mapper/cryptroot") - (type "ext4") - (dependencies mapped-devices))) - %base-file-systems))) diff --git a/.usr/etc/hg/hgrc b/.usr/etc/hg/hgrc deleted file mode 100644 index 656f40b..0000000 --- a/.usr/etc/hg/hgrc +++ /dev/null @@ -1,2 +0,0 @@ -[ui] -username = EuAndreh diff --git a/.usr/etc/i3/config b/.usr/etc/i3/config deleted file mode 100644 index 0b41311..0000000 --- a/.usr/etc/i3/config +++ /dev/null @@ -1,186 +0,0 @@ -set $mod Mod4 - - -# font pango:monospace 8 - -# This font is widely installed, provides lots of unicode glyphs, right-to-left -# text rendering and scalability on retina/hidpi displays (thanks to pango). -font pango:DejaVu Sans Mono 8 - -# Start XDG autostart .desktop files using dex. See also -# https://wiki.archlinux.org/index.php/XDG_Autostart -exec --no-startup-id dex --autostart --environment i3 - -# The combination of xss-lock, nm-applet and pactl is a popular choice, so -# they are included here as an example. Modify as you see fit. - -# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the -# screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork - -# NetworkManager is the most popular way to manage wireless networks on Linux, -# and nm-applet is a desktop environment-independent system tray GUI for it. -exec --no-startup-id nm-applet -exec --no-startup-id blueman-applet -exec --no-startup-id poweralertd -exec dunst - -# Use pactl to adjust volume in PulseAudio. -set $refresh_i3status killall -SIGUSR1 i3status -bindsym F1 exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status -bindsym F2 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status -bindsym F3 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status - -bindsym F4 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` position 5- -bindsym Shift+F4 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` previous -bindsym F5 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` play-pause -Bindsym Shift+F5 exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/rotate-mpris-player.sh -bindsym F6 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` position 5+ -bindsym Shift+F6 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` next - -# FIXME bad path -bindsym F7 exec --no-startup-id ~/.local/bin/brightness -1 -bindsym F8 exec --no-startup-id ~/.local/bin/brightness +1 - - - -bindsym $mod+Shift+s exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/toggle-pulseaudio-sink.sh && $refresh_i3status - - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -bindsym $mod+Return exec st -bindsym $mod+Shift+q kill -bindsym $mod+p exec --no-startup-id dmenu_run - - - - -# FIXME: better placement of these files -bindsym $mod+o exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-emoji.sh -bindsym $mod+v exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-clipmenu.sh -bindsym $mod+i exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-pass.sh -bindsym $mod+Control+i exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-pass-login.sh - - - - -# change focus -bindsym $mod+h focus left -bindsym $mod+j focus down -bindsym $mod+k focus up -bindsym $mod+l focus right - -# move focused window -bindsym $mod+Shift+h move left -bindsym $mod+Shift+j move down -bindsym $mod+Shift+k move up -bindsym $mod+Shift+l move right - -# bindsym $mod+h split h # what is this? - -# split in vertical orientation -# FIXME: what is this? It was in conflict with dmenu-clipmenu -# bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -bindsym $mod+d focus child - -# Define names for default workspaces for which we configure key bindings later on. -# We use variables to avoid repeating the names in multiple places. -set $ws1 "1" -set $ws2 "2" -set $ws3 "3" -set $ws4 "4" -set $ws5 "5" -set $ws6 "6" -set $ws7 "7" -set $ws8 "8" -set $ws9 "9" -set $ws10 "10" - -# switch to workspace -bindsym $mod+1 workspace number $ws1 -bindsym $mod+2 workspace number $ws2 -bindsym $mod+3 workspace number $ws3 -bindsym $mod+4 workspace number $ws4 -bindsym $mod+5 workspace number $ws5 -bindsym $mod+6 workspace number $ws6 -bindsym $mod+7 workspace number $ws7 -bindsym $mod+8 workspace number $ws8 -bindsym $mod+9 workspace number $ws9 -bindsym $mod+0 workspace number $ws10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace number $ws1 -bindsym $mod+Shift+2 move container to workspace number $ws2 -bindsym $mod+Shift+3 move container to workspace number $ws3 -bindsym $mod+Shift+4 move container to workspace number $ws4 -bindsym $mod+Shift+5 move container to workspace number $ws5 -bindsym $mod+Shift+6 move container to workspace number $ws6 -bindsym $mod+Shift+7 move container to workspace number $ws7 -bindsym $mod+Shift+8 move container to workspace number $ws8 -bindsym $mod+Shift+9 move container to workspace number $ws9 -bindsym $mod+Shift+0 move container to workspace number $ws10 - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym h resize shrink width 10 px or 10 ppt - bindsym j resize grow height 10 px or 10 ppt - bindsym k resize shrink height 10 px or 10 ppt - bindsym l resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - # bindsym Left resize shrink width 10 px or 10 ppt - # bindsym Down resize grow height 10 px or 10 ppt - # bindsym Up resize shrink height 10 px or 10 ppt - # bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape or $mod+r - bindsym Return mode "default" - bindsym Caps_Lock mode "default" - bindsym $mod+r mode "default" -} - -bindsym $mod+r mode "resize" - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -bar { - position top - status_command i3status -} - -default_border pixel -default_floating_border pixel diff --git a/.usr/etc/info/infokey b/.usr/etc/info/infokey deleted file mode 100644 index 90edc50..0000000 --- a/.usr/etc/info/infokey +++ /dev/null @@ -1,7 +0,0 @@ -^e down-line -^y up-line - -#var -link-style=cyan -active-link-style=blue,bold -match-style=underline,bold,bggreen diff --git a/.usr/etc/khal/config b/.usr/etc/khal/config deleted file mode 120000 index dfae173..0000000 --- a/.usr/etc/khal/config +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/khal/config \ No newline at end of file diff --git a/.usr/etc/khard/khard.conf b/.usr/etc/khard/khard.conf deleted file mode 120000 index f015b29..0000000 --- a/.usr/etc/khard/khard.conf +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/khard/khard.conf \ No newline at end of file diff --git a/.usr/etc/mailcaps/config b/.usr/etc/mailcaps/config deleted file mode 100644 index aeea68d..0000000 --- a/.usr/etc/mailcaps/config +++ /dev/null @@ -1 +0,0 @@ -text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput diff --git a/.usr/etc/mbsync/config b/.usr/etc/mbsync/config deleted file mode 120000 index 68a3234..0000000 --- a/.usr/etc/mbsync/config +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/mbsync/config \ No newline at end of file diff --git a/.usr/etc/msmtp/config b/.usr/etc/msmtp/config deleted file mode 120000 index 45cd0ac..0000000 --- a/.usr/etc/msmtp/config +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/msmtp/config \ No newline at end of file diff --git a/.usr/etc/newsboat/urls b/.usr/etc/newsboat/urls deleted file mode 120000 index 3c453f5..0000000 --- a/.usr/etc/newsboat/urls +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/newsboat/urls \ No newline at end of file diff --git a/.usr/etc/notmuch/default/config b/.usr/etc/notmuch/default/config deleted file mode 120000 index 3b9d2f4..0000000 --- a/.usr/etc/notmuch/default/config +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/notmuch/default/config \ No newline at end of file diff --git a/.usr/etc/notmuch/default/hooks/post-new b/.usr/etc/notmuch/default/hooks/post-new deleted file mode 120000 index 7992789..0000000 --- a/.usr/etc/notmuch/default/hooks/post-new +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/notmuch/post-new \ No newline at end of file diff --git a/.usr/etc/python/pythonrc.py b/.usr/etc/python/pythonrc.py deleted file mode 100644 index 1fc3bfe..0000000 --- a/.usr/etc/python/pythonrc.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -import atexit -import readline - -history = os.path.join(os.environ["XDG_STATE_HOME"], "python-history") - -try: - readline.read_history_file(history) -except OSError: - pass - -def write_history(): - readline.write_history_file(history) - -atexit.register(write_history) diff --git a/.usr/etc/ranger/rc.conf b/.usr/etc/ranger/rc.conf deleted file mode 100644 index ed2b538..0000000 --- a/.usr/etc/ranger/rc.conf +++ /dev/null @@ -1 +0,0 @@ -map DD shell trash %s diff --git a/.usr/etc/sbcl/sbclrc.lisp b/.usr/etc/sbcl/sbclrc.lisp deleted file mode 100644 index df7f57a..0000000 --- a/.usr/etc/sbcl/sbclrc.lisp +++ /dev/null @@ -1,6 +0,0 @@ -;;; The following lines added by ql:add-to-init-file: -#-quicklisp -(let ((quicklisp-init (merge-pathnames "dev/quicklisp/setup.lisp" - (user-homedir-pathname)))) - (when (probe-file quicklisp-init) - (load quicklisp-init))) diff --git a/.usr/etc/ssh/known_hosts b/.usr/etc/ssh/known_hosts deleted file mode 100644 index ad6b0b2..0000000 --- a/.usr/etc/ssh/known_hosts +++ /dev/null @@ -1,74 +0,0 @@ -|1|G2vfdmQ84glwobYXZZ0d+cCMVRE=|DZJYmWjbeP52J4K7+Bsz2e0dgBA= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= -|1|yosAhKlbZt51FfD2VvQJiVijSBA=|BFEig1gqq4EwCHEHagEASQZQmNI= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= -|1|5yKbUaAB5AFz4MINtTVhVAPwMtU=|LwcI5Z8hXwwKxtkk4KDpeZduyPQ= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0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VkMOBgEfr+OaXpFV3zQ3/Dp875skdTOZaA9DjQ0EeUS+M= -pt.hinarioespirita.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEnGFkXNEF6RHihT3szgVEBAhRKXlI6YKSUOQFzhuNVkMOBgEfr+OaXpFV3zQ3/Dp875skdTOZaA9DjQ0EeUS+M= -mtm.hinarioespirita.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEnGFkXNEF6RHihT3szgVEBAhRKXlI6YKSUOQFzhuNVkMOBgEfr+OaXpFV3zQ3/Dp875skdTOZaA9DjQ0EeUS+M= -77.109.148.18 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKBxDZv64oRMzRkywjmRRrml2pr0XFSZhlL46nUSmM60 -35.231.145.151 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= -git.sr.ht,173.195.146.142 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCj6y+cJlqK3BHZRLZuM+KP2zGPrh4H66DacfliU1E2DHAd1GGwF4g1jwu3L8gOZUTIvUptqWTkmglpYhFp4Iy4= -192.168.33.10 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCL+hEiW/Va2L6y5Y4MyxRBXHJw/9bIC02M3wGVe1zaD3DT8wsAUcJ2QO1lJILudvMInx+SaPyJmwBvUn58YR2c= -173.195.146.152 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCj6y+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OV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== -140.82.114.4 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== -2604:bf00:710:0:5054:ff:fe7d:8fa8 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCj6y+cJlqK3BHZRLZuM+KP2zGPrh4H66DacfliU1E2DHAd1GGwF4g1jwu3L8gOZUTIvUptqWTkmglpYhFp4Iy4= -azusa.runners.sr.ht,2604:bf00:710:0:ae1f:6bff:fead:55a ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPzxK5AM1FdMI9gZVDpw2O5iiS/49QokWpzANFntVt0Qig4qdBt4K7B0O6MrwggLh3A+zBlsXCMoWtvFtPQgLxA= -18.228.52.138 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdn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FzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== -hg.sr.ht,2604:bf00:710:0:5054:ff:fe25:1aa6 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL4aNGa+KnvMA0QoWrIVuI2QBU0Q/xX48sMBl3VtP/zPOGMvS50zGVMaA00RSzfcI2X0v/aUTsVm2vBNo/V1gTg= -euandre.org,2a03:b0c0:3:d0::387:b001 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF6wlJqwd7KWLzLovwnwbTmNfO4E4yVDyqxAAlUkn9eDsTtzV1RYNDsaLPWv4mweJqP4crZPFxg40sFVeMDbkC0= -2606:4700:90:0:f22e:fbec:5bed:a9b9 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= -46.101.160.115 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF6wlJqwd7KWLzLovwnwbTmNfO4E4yVDyqxAAlUkn9eDsTtzV1RYNDsaLPWv4mweJqP4crZPFxg40sFVeMDbkC0= -173.195.146.249 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPzxK5AM1FdMI9gZVDpw2O5iiS/49QokWpzANFntVt0Qig4qdBt4K7B0O6MrwggLh3A+zBlsXCMoWtvFtPQgLxA= -2604:a880:800:14::32:4000 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK8YTumqLFAL5MJ0AcDtFG9dWfbkJKU7FUDlH0xEgAZvHGU57TBr9DIQy2OHrxCxuhk9bZEUX8+vJiRXE05+Rzs= -2001:19f0:7001:5cec:5400:2ff:feec:9940 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPYRWlGutc+bRJ+N0sXHxhgnDsRvRoauQ92yM1U7N+8a -2001:19f0:6c01:2cf0:5400:2ff:feec:99c5 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMGiiEXB+koPS1vgGkwdExk2Q5fGv3Yc5rf8jVHB2FB7 -45.32.155.96 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfPxSXxvq3MHuMvthg+q69ooniSeqXbit1UiW0gbLZN -45.77.65.204 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfPxSXxvq3MHuMvthg+q69ooniSeqXbit1UiW0gbLZN -136.244.85.68 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfPxSXxvq3MHuMvthg+q69ooniSeqXbit1UiW0gbLZN -199.247.0.136 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -euandreh.xyz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -136.244.80.130 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -209.250.232.122 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -git.euandreh.xyz ssh-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DTdDkoohFzgbEY= -140.82.112.3 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== -45.32.158.17 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -95.179.253.243 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -95.179.163.103 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -217.69.2.177 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= -arrobaponto.org,104.238.167.189 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= -104.238.176.81 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= -git.arrobaponto.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= -173.199.70.52 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= -[remembering.euandreh.xyz]:23841 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ -167.71.86.194 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCXg/l/grol/OAY95VphKbVn4yXUStSWpxQjnka7PWXzWyForfX+fpmY+p72r1Uimx5oXIFISt8uSZW/tvD61iQ= -[localhost]:10022 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLHACdQJXUj5e4Znyh7KdTjB1RLznSfStRw6cuHZlu8rhANVfkjt300Fum9Jv6yLra6W4v2FLALWfcYpOlUzt9c= -107.191.63.70 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMONpsqwH79f/MsjtsOPitT5C+3hPPJqVh42oHMKOen6 -217.69.11.49 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPKbzWSlFwmlrC+k6XU9eUJaejREGxTF03OX/mT7KhSr -[arrobaponto.org]:23213 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPKbzWSlFwmlrC+k6XU9eUJaejREGxTF03OX/mT7KhSr -anoncvs.netbsd.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA3QiBl8leG9fqIJpKeNov0PKq5YryFFiroMWOPUv4hDFn8R0jC07YVaR/OSBrr37CTmGX5AFceXPzoFnLlwCqWR7rXg4NR75FTlTp9CG9EBAEtU8mee27KDrUFBTZdfVl2+aRYoAI5fTXA+0vpIO68Cq843vRWUZCcwinS4cNLUU= -git.2f30.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJSLZ4G5w4NysBUmAHmr6/V9om42IHSUCtqrNdhWoYQ0 -[arrobaponto.org]:38123 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoz1gFl6chY91vQ5SrZXSP5yHqRI3TdYy2ccEDpS7Z4 -[199.247.13.53]:38123 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoz1gFl6chY91vQ5SrZXSP5yHqRI3TdYy2ccEDpS7Z4 -[2001:19f0:6801:988:5400:3ff:fea1:b566]:38123 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoz1gFl6chY91vQ5SrZXSP5yHqRI3TdYy2ccEDpS7Z4 -[gerrit.wikimedia.org]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCF8pwFLehzCXhbF1jfHWtd9d1LFq2NirplEBQYs7AOrGwQ/6ZZI0gvZFYiEiaw1o+F1CMfoHdny1VfWOJF3mJ1y9QMKAacc8/Z3tG39jBKRQCuxmYLO1SWymv7/Uvx9WQlkNRoTdTTa9OJFy6UqvLQEXKYaokfMIUHZ+oVFf1CgQ== -2001:19f0:5:1d65:5400:3ff:fee3:7463 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF2EgU3IgCwv1ynnWfxFm0SHTSoE0AYG3MJT/TpN3pBz diff --git a/.usr/etc/tmux/tmux.conf b/.usr/etc/tmux/tmux.conf deleted file mode 100644 index dd718ca..0000000 --- a/.usr/etc/tmux/tmux.conf +++ /dev/null @@ -1,81 +0,0 @@ -# Use personal prefix over "C-b" -unbind C-b -set -g prefix C-v - -# Turn on mouse mode -# https://groups.google.com/forum/#!msg/tmux-users/TRwPgEOVqho/Ck_oth_SDgAJ -# https://github.com/tmux/tmux/blob/310f0a960ca64fa3809545badc629c0c166c6cd2/CHANGES#L12 -set -g mouse on - -# Bind "C-x r" to reload the configuration file -bind-key r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display-message "$XDG_CONFIG_HOME/tmux.conf reloaded" - -# Holy answer that properly implements copying from tmux! -# https://unix.stackexchange.com/a/349020/276661 -bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i" \; -bind-key y send-keys -X copy-pipe "xclip -selection clipboard -i" \; display-message "Copied system clipboard! Hooray! Long-live tmux!" - -# Moving around panes -bind-key -n M-h select-pane -L -bind-key -n M-j select-pane -D -bind-key -n M-k select-pane -U -bind-key -n M-l select-pane -R - -# Resizing panes -bind-key -n M-H resize-pane -L 5 -bind-key -n M-J resize-pane -D 5 -bind-key -n M-K resize-pane -U 5 -bind-key -n M-L resize-pane -R 5 - -# Reorder windows -bind-key -n C-S-Left swap-window -t -1\; select-window -t -1 -bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 -# -# To change the number of a window, use: PREFIX-., and pick a new unused number -# - -# Join windows -bind-key -n C-S-M-Left join-pane -s :-0 -t :-1 -bind-key -n C-S-M-Right join-pane -s :-0 -t :+1 - -# "M m" to actually clear the pane history -bind -n M-m send-keys -R \; clear-history - -# Keybinding to activate pane typing sync -# https://stackoverflow.com/questions/25909964/tmux-how-to-toggle-on-and-off-options-with-the-same-key -bind-key b setw synchronize-panes \; display-message "synchronize-panes toggle" - -setw -g mode-keys vi # Move around with vi keys -set-option -g status-key "vi" # Use vi mode for status bar command (like after typing "C-x [" one can search with "/") -set-option -g status-bg "#666666" # Status bar background color -set-option -g status-fg "#aaaaaa" # Status bar foreground color -set-option -g status-left-length 50 # session name in status bar length =[annex]= part -set-option -g history-limit 150000 # How many lines of history to keep -set-option -g status-right "" - -# Set the panes initial index value to 1 instead of 0 -# 0 is too far from ` ;) -set -g base-index 1 -set-window-option -g pane-base-index 1 - -# Automatically set window title -set-window-option -g automatic-rename on -set-option -g set-titles on - -# Set "correct term" -# https://wiki.archlinux.org/index.php/Tmux -set -g default-terminal screen-256color - -# No delay for escape key press -# https://mutelight.org/practical-tmux#faster-command-sequences -set -sg escape-time 0 - -# Display pane numbers for longer -# https://unix.stackexchange.com/questions/307696/how-to-increase-tmux-pane-numbers-display-time-ctrl-b-q -set -g display-panes-time 2500 - -bind-key t resize-pane -x 80 - -bind -n M-r attach-session -t . -c '#{pane_current_path}' \; display-message "CWD for session updated to #{pane_current_path}!" - -bind-key u capture-pane \; save-buffer /tmp/tmux-urlscan-buffer \; new-window -n "urlscan" '$SHELL -c "urlscan < /tmp/tmux-urlscan-buffer"' diff --git a/.usr/etc/weechat/irc.conf b/.usr/etc/weechat/irc.conf deleted file mode 120000 index 7dff360..0000000 --- a/.usr/etc/weechat/irc.conf +++ /dev/null @@ -1 +0,0 @@ -/home/andreh/dev/private/dotfiles/weechat/irc.conf \ No newline at end of file diff --git a/bin/backup b/bin/backup new file mode 100755 index 0000000..cab37dc --- /dev/null +++ b/bin/backup @@ -0,0 +1,128 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + backup [-v] [-C COMMENT] ARCHIVE_TAG + backup -h + EOF +} + +help() { + cat <<-'EOF' + + + Options: + -v enable verbose mode, useful for + interactive sessions + -C COMMENT the comment text to be attached to the archive + -h, --help show this message + + ARCHIVE_TAG the tag used to create the new + backup (default: "cronjob") + + + The repository is expected to have been created with: + + $ borg init -e repokey-blake2 + + The following environment variables are expected to be exported: + + $BORG_PASSCOMMAND + $BORG_REPO + $BORG_REMOTE_PATH + + Password-less SSH access is required, usually done via adding + ~/.ssh/id_rsa.pub to suyin:.ssh/authorized_keys. + + + Examples: + + Run backup from cronjob: + + $ backup cronjob + + Create backup with comment, and verbose mode active: + + $ backup -vC 'The backup has a comment' my-backup + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +VERBOSE_FLAGS='' +COMMENT='' +while getopts 'vC:h' flag; do + case "$flag" in + v) + VERBOSE_FLAGS='--verbose --progress' + ;; + C) + COMMENT="$OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + printf 'Missing %s\n' "$2" >&2 + usage >&2 + exit 2 + fi +} + +ARCHIVE_TAG="${1:-}" +assert_arg "$ARCHIVE_TAG" 'ARCHIVE_TAG' + + +finish() { + STATUS=$? + printf '\n>>>\n>>> exit status: %s\n>>>\n\n' "$STATUS" >&2 +} +trap finish EXIT + +run() { + borg create \ + $VERBOSE_FLAGS \ + --comment "$COMMENT" \ + --exclude ~/.cache/ \ + --exclude ~/Downloads/ \ + --stats \ + --compression lzma,9 \ + "::{hostname}-{now}-$ARCHIVE_TAG" \ + ~/ + STATUS=$? + + if [ "$STATUS" = 0 ] || [ "$STATUS" = 1 ]; then + echo 'WARNING, but no ERROR.' >&2 + return 0 + else + return "$STATUS" + fi +} + +run || exit $? diff --git a/bin/brightness b/bin/brightness new file mode 100755 index 0000000..8e178ad --- /dev/null +++ b/bin/brightness @@ -0,0 +1,13 @@ +#!/bin/sh +set -eu + +BRIGHTNESS_DIFF="$1" + +DEVICE="$(cat "$XDG_CONFIG_HOME"/backlight-device)" +HANDLER="/sys/class/backlight/$DEVICE" + +OLD_BRIGHTNESS="$(cat "$HANDLER"/brightness)" +MAX_BRIGHTNESS="$(cat "$HANDLER"/max_brightness)" +SUM=$((OLD_BRIGHTNESS + BRIGHTNESS_DIFF)) +NEW_BRIGHTNESS="$(clamp -- "$SUM" 0 "$MAX_BRIGHTNESS")" +echo "$NEW_BRIGHTNESS" > "$HANDLER"/brightness || sudo chmod 666 "$HANDLER/brightness" diff --git a/bin/clamp b/bin/clamp new file mode 100755 index 0000000..a40b823 --- /dev/null +++ b/bin/clamp @@ -0,0 +1,74 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + clamp NUMBER MIN MAX + clamp -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Clamp the NUMBER between MIN and MAX. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + printf 'Missing %s\n\n' "$2" >&2 + usage >&2 + exit 2 + fi +} + +NUMBER="${1:-}" +MIN="${2:-}" +MAX="${3:-}" + +assert_arg "$NUMBER" 'NUMBER' +assert_arg "$MIN" 'MIN' +assert_arg "$MAX" 'MAX' + + +if [ "$MIN" -gt "$MAX" ]; then + printf 'MIN (%s) is greater then MAX (%s).\n' "$MIN" "$MAX" >&2 + exit 2 +fi + +min -- "$(max -- "$NUMBER" "$MIN")" "$MAX" diff --git a/bin/color b/bin/color new file mode 100755 index 0000000..0597278 --- /dev/null +++ b/bin/color @@ -0,0 +1,204 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + color -c COLOR TEXT + color -h + EOF +} + +help() { + cat <<-'EOF' + + + Options: + -c COLOR + -h, --help show this message + + + The available colors are: + EOF + list_colors | sed 's/^/ /' +} + + +END="\033[0m" + +black() { + BLACK="\033[0;30m" + printf "${BLACK}${1}${END}" +} + +blackb() { + BLACK_B="\033[1;30m" + printf "${BLACK_B}${1}${END}" +} + +blacki() { + BLACK_I="\033[0;90m" + printf "${BLACK_I}${1}${END}" +} + +white() { + WHITE="\033[0;37m" + printf "${WHITE}${1}${END}" +} + +whiteb() { + WHITE_B="\033[1;37m" + printf "${WHITE_B}${1}${END}" +} + +red() { + RED="\033[0;31m" + printf "${RED}${1}${END}" +} + +redb() { + RED_B="\033[1;31m" + printf "${RED_B}${1}${END}" +} + +green() { + GREEN="\033[0;32m" + printf "${GREEN}${1}${END}" +} + +greenb() { + GREEN_B="\033[1;32m" + printf "${GREEN_B}${1}${END}" +} + +yellow() { + YELLOW="\033[0;33m" + printf "${YELLOW}${1}${END}" +} + +yellowb() { + YELLOW_B="\033[1;33m" + printf "${YELLOW_B}${1}${END}" +} + +blue() { + BLUE="\033[0;34m" + printf "${BLUE}${1}${END}" +} + +blueb() { + BLUE_B="\033[1;34m" + printf "${BLUE_B}${1}${END}" +} + +bluei() { + BLUE_I="\033[0;94m" + printf "${BLUE_I}${1}${END}" +} + +purple() { + PURPLE="\033[0;35m" + printf "${PURPLE}${1}${END}" +} + + +purpleb() { + PURPLE_B="\033[1;35m" + printf "${PURPLE_B}${1}${END}" +} + +lightblue() { + LIGHT_BLUE="\033[0;36m" + printf "${LIGHT_BLUE}${1}${END}" +} + +lightblueb() { + LIGHT_BLUE_B="\033[1;36m" + printf "${LIGHT_BLUE_B}${1}${END}" +} + +COLOR_LIST=' +black +blackb +white +whiteb +red +redb +green +greenb +yellow +yellowb +blue +blueb +purple +purpleb +lightblue +lightblueb +blacki +bluei +' +list_colors() { + for c in $COLOR_LIST; do + printf '%s\n' "$("$c" "$c")" + done +} + + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'c:h' flag; do + case "$flag" in + c) + EXISTS=false + for c in $COLOR_LIST; do + if [ "$OPTARG" = "$c" ]; then + EXISTS=true + break + fi + done + if [ "$EXISTS" = false ]; then + printf 'Invalid color: %s\n' "$OPTARG" >&2 + exit 2 + fi + COLOR_FN="$OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + printf 'Missing %s\n\n' "$2" >&2 + usage >&2 + exit 2 + fi +} + +TEXT="${1:-}" +assert_arg "$COLOR_FN" '-c COLOR' +assert_arg "$TEXT" 'TEXT' + + +"$COLOR_FN" "$TEXT" diff --git a/bin/copy b/bin/copy new file mode 100755 index 0000000..64e1e32 --- /dev/null +++ b/bin/copy @@ -0,0 +1,67 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + copy [-n] < STDIN + copy -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -n remove newlines + -h, --help show this message + + Examples: + + Copy numbers to clipboard: + seq 10 | copy + + Copy string without newline: + echo 'with automatic newline' | copy -n + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +TRIM=false +while getopts 'nh' flag; do + case "$flag" in + n) + TRIM=true + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +if [ "$TRIM" = true ]; then + cat - | tr -d '\n' | xclip -sel clip +else + cat - | xclip -sel clip +fi diff --git a/bin/e b/bin/e new file mode 100755 index 0000000..76b4899 --- /dev/null +++ b/bin/e @@ -0,0 +1,79 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + e [FILE] + e -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help + + + Flexibly run a text editor, either directly on in a pipe. + + Examples: + + Edit "file.txt": + + $ e file.txt + + Manipulate the content of a pipe midway: + + $ seq 10 | e | grep 5 + + The editor used is either $VISUAL or $EDITOR, with a fallback to + vi in case any of those variables aren't defined. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + + +CMD="${VISUAL:-${EDITOR:-vi}}" + +if [ ! -t 0 ]; then + F="$(mkstemp)" + cat > "$F" + exec 0&1 + exec 1>/dev/tty + $CMD "$F" + cat "$F" >&3 +else + $CMD "$@" +fi diff --git a/bin/email b/bin/email new file mode 100755 index 0000000..0a1fd15 --- /dev/null +++ b/bin/email @@ -0,0 +1,74 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + mail -s SUBJECT ADDRESS... < BODY + mail -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -s SUBJECT the email subject + -h, --help show this message + + ADDRESS the email addresses to send the email to + BODY the text to be sent as the body + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 's:h' flag; do + case "$flag" in + s) + SUBJECT="$OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + { + printf 'Missing %s.\n' "$2" + printf '\n' + usage + } >&2 + exit 2 + fi +} + +assert_arg "${SUBJECT:-}" '-s SUBJECT' +assert_arg "${1:-}" 'ADDRESS' + +printf 'Subject: %s\n\n%s' \ + "$(echo "$SUBJECT" | tr -d '\n')" \ + "$(cat)" | + msmtpq -a euandreh "$@" diff --git a/bin/gc b/bin/gc new file mode 100755 index 0000000..ec6a8f1 --- /dev/null +++ b/bin/gc @@ -0,0 +1,105 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + gc + gc -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + + +disk() { + df -h . | + awk 'NR == 2 { printf "%s - %s/%s\n", $4, $3, $2 }' +} + + +gc_guix() { + pass show velhinho/0-andreh-password | sudo -S guix system delete-generations + guix home delete-generations + guix gc -d +} + +gc_nohup() { + find ~/ -type f -name 'nohup.out' -exec rm -vf "{}" \; +} + +gc_trash() { + yes | trash-empty +} + +gc_tmpdir() { + find /tmp/ -type f -atime +10 -exec rm -vf "{}" \; ||: +} + +gc_docker() { + if command -v docker; then + yes | docker system prune -a + docker rmi "$(docker images -a -q)" ||: + docker rm "$(docker ps -a -f status=exited -q)" ||: + docker stop "$(docker ps -a -q)" ||: + docker rm "$(docker ps -a -q)" ||: + yes | docker volume prune + yes | docker container prune + fi +} + +gc_email() { + notmuch search --output=files --exclude=false tag:killed | + xargs -I{} rm -vf "{}" +} + + +BEFORE="$(disk)" +gc_guix +gc_nohup +gc_trash +gc_tmpdir +gc_docker +gc_email +wait +AFTER="$(disk)" + +printf 'Disk space:\n' +printf ' before: %s\n' "$BEFORE" +printf ' after: %s\n' "$AFTER" diff --git a/bin/grun b/bin/grun new file mode 100755 index 0000000..5884e9e --- /dev/null +++ b/bin/grun @@ -0,0 +1,102 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + grun [-r RECIPIENT] FILENAME -- COMMAND... + grun -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -r RECIPIENT the recipient to encrypt to. Can be given + multiple for multiple recipients. + -h, --help show this message + + COMMAND A command to be executed, that accepts input + in STDIN and emits result in STDOUT, and emits + errors as non-zero return codes. + FILENAME The GPG-encrypted file to be processed. If it + doesn't exist yet, it will be created. + + Examples: + + Edit "secrets.txt.gpg" using `vipe` and the default recipient: + + $ grun secrets.txt.gpg -- vipe + + Delete lines containing "FIXME" in todos.gpg: + + $ grun -r ABC123DEF321 todos.gpg -- sed '/FIXME/d' + + If COMMAND emits a non-zero return code, the file is left + unmodified. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'rh' flag; do + case "$flag" in + r) + RECIPIENTS_FLAG="${RECIPIENTS_FLAG:-} -r $OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + printf 'Missing %s\n\n' "$2" >&2 + usage >&2 + exit 2 + fi +} + +FILENAME="${1:-}" +assert_arg "$FILENAME" 'FILENAME' +shift + +if [ "${1:-}" != '--' ]; then + printf 'Missing "--" separator\n\n' >&2 + usage >&2 + exit 2 +fi +shift + +assert_arg "${1:-}" 'COMMAND' + + +if [ ! -e "$FILENAME" ]; then + OUT="$(printf '' | "$@")" +else + OUT="$(gpg -dq "$FILENAME" | "$@")" +fi + +echo "$OUT" | gpg -e ${RECIPIENTS_FLAG:--r eu@euandre.org} | sponge "$FILENAME" diff --git a/bin/max b/bin/max new file mode 100755 index 0000000..84585ee --- /dev/null +++ b/bin/max @@ -0,0 +1,61 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + max NUMBER... + max -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Get the maximum number from the given values. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +if [ -z "${1:-}" ]; then + echo 0 + exit +fi + +N="$1" +for n in "$@"; do + N=$((N > n ? N : n)) +done +echo "$N" diff --git a/bin/min b/bin/min new file mode 100755 index 0000000..7868623 --- /dev/null +++ b/bin/min @@ -0,0 +1,61 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + min NUMBER... + min -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Get the minimun number from the given values. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +if [ -z "${1:-}" ]; then + echo 0 + exit +fi + +N="$1" +for n in "$@"; do + N=$((N < n ? N : n)) +done +echo "$N" diff --git a/bin/mkdtemp b/bin/mkdtemp new file mode 100755 index 0000000..9c7ddd8 --- /dev/null +++ b/bin/mkdtemp @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + mkstemp + mkstemp -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Create a new temporary file and echo its name back. + EOF +} + +name="$(tmpname)" +mkdir "$name" +echo "$name" diff --git a/bin/mkstemp b/bin/mkstemp new file mode 100755 index 0000000..ec92c14 --- /dev/null +++ b/bin/mkstemp @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + mkstemp + mkstemp -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Create a new temporary file and echo its name back. + EOF +} + +name="$(tmpname)" +touch "$name" +echo "$name" diff --git a/bin/msg b/bin/msg new file mode 100755 index 0000000..f3e893e --- /dev/null +++ b/bin/msg @@ -0,0 +1,90 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + msg -X XMPP_MESSAGE -s -S SOUND_MESSAGE -m EMAIL -D DESKTOP -b + msg -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -X XMPP_MESSAGE send XMPP using the `xmpp` command + -s play ~/Desktop/medium.ogg sound + -S SOUND_MESSAGE say SOUND_MESSAGE using `speak` + -m EMAIL_SUBJECT send email with EMAIL_SUBJECT and empty body + -D DESKTOP_MESSAGE the desktop message for `notify-send` + -b print terminal bell + -h, --help show this message + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +sound() { + play ~/Desktop/medium.ogg 2>/dev/null & +} + +ACTION_DONE=false +while getopts 'X:sS:m:D:bh' flag; do + case "$flag" in + X) + xmpp -m "$OPTARG" eu@euandreh.xyz + ACTION_DONE=true + ;; + s) + sound + ACTION_DONE=true + ;; + S) + echo "$OPTARG" | speak -v pt-BR + ACTION_DONE=true + ;; + m) + echo "" | email -s "$OPTARG" eu@euandre.org + ACTION_DONE=true + ;; + D) + notify-send "$OPTARG" + ACTION_DONE=true + ;; + b) + printf '\a' + ACTION_DONE=true + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done + +if [ "$ACTION_DONE" = false ]; then + sound + usage + help +fi + +wait diff --git a/bin/open b/bin/open new file mode 100755 index 0000000..df1ad56 --- /dev/null +++ b/bin/open @@ -0,0 +1,101 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + open FILE... + open -h +EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Examples: + + Open an HTML file on the current $BROWSER: + open index.html + + Open multiple PDF files (with zathura): + open *.pdf +EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +if [ -z "${1:-}" ]; then + usage >&2 + exit 2 +fi + +for f in "$@"; do + case "$f" in + *.ico|*.jpg|*.jpeg|*.png) + feh "$f" + ;; + https://www.youtube.com/watch*) + nohup mpv "$f" 1>&2 2>/dev/null & + ;; + *.flac|*.ogg|*.mkv|*.avi|*.mp4) + nohup mpv "$f" 1>&2 2>/dev/null & + ;; + http*|*.svg|*.html) + "$BROWSER" "$f" + ;; + gopher://*) + amfora "$f" + ;; + gemini://*) + telescope "$f" + ;; + *.pdf|*.djvu|*.ps|*.epub) + nohup zathura "$f" 1>&2 2>/dev/null & + ;; + *.txt) + less "$f" + ;; + *.midi) + timidity "$f" + ;; + mailto:*) + alot compose "$f" + ;; + *) + DIR="$(cd -- "$(dirname -- "$0")"; pwd)" + CMD="$(without-env PATH "$DIR" -- command -v xdg-open)" + "$CMD" "$f" + ;; + esac +done diff --git a/bin/pre b/bin/pre new file mode 100755 index 0000000..233ac1a --- /dev/null +++ b/bin/pre @@ -0,0 +1,72 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + pre [-c COLOR] PREFIX + pre -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -c COLOR ANSI color to be used on the prefix text + -h, --help show this message + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +COLOR='' +while getopts 'c:h' flag; do + case "$flag" in + c) + COLOR="$OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + printf 'Missing %s\n\n' "$2" >&2 + usage >&2 + exit 2 + fi +} + +PREFIX="${1:-}" +assert_arg "$PREFIX" 'PREFIX' + +while read -r line; do + if [ -z "$COLOR" ]; then + printf '%s: %s\n' "$PREFIX" "$line" + else + printf '%s: %s\n' "$(color -c "$COLOR" "$PREFIX")" "$line" + fi +done diff --git a/bin/print b/bin/print new file mode 100755 index 0000000..735d8ba --- /dev/null +++ b/bin/print @@ -0,0 +1,151 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + print [-d] [-q QUALITY] [FILE...] + print -h +EOF +} + +help() { + cat <<-'EOF' + + Options: + -d print duplex/double-sided + -q QUALITY choose the print quality, either: + low, medium (default) or high. + -h, --help show this message + + Examples: + + Print the given PostScript file with default quality: + $ print f1.ps + + Print multiple PDF files with high quality: + $ print -dq high *.pdf + + Print the file from STDIN, double-sided: + $ print -d < f2.ps + + Print multiple source code files: + $ print src/*.{c,h} +EOF +} + +mkdtemp() { + name="$(echo 'mkstemp(template)' | + m4 -D template="${TMPDIR:-/tmp}/m4-tmpname.")" + rm -f "$name" + mkdir "$name" + echo "$name" +} + +n_pages() { + pdftk "$1" dump_data | awk '/NumberOfPages/ { print $2 }' +} + +main() { + if file -b "$FILE" | grep -q PostScript; then + ps2pdf "$FILE" "$NEWDIR"/in.pdf + elif file -b "$FILE" | grep -q PDF; then + cp "$FILE" "$NEWDIR"/in.pdf + else + enscript -o- "$FILE" | ps2pdf - "$NEWDIR"/in.pdf + fi + cd "$NEWDIR" + + if [ -z "$DUPLEX" ]; then + lp in.pdf + cd - > /dev/null + return + fi + + if [ "$(n_pages in.pdf)" = '1' ]; then + lp in.pdf + return + fi + + pdftk A=in.pdf cat Aodd output odd.pdf + pdftk A=in.pdf cat Aeven output even.pdf + + NODD="$(n_pages odd.pdf)" + NEVEN="$(n_pages even.pdf)" + + printf 'Printing odd pages...\n' >&2 + lp odd.pdf + printf 'Has printing finished yet? Once it does, reload the pages and hit it enter to continue. ' + read -r < /dev/tty + lp even.pdf + + if [ "$NODD" != "$NEVEN" ]; then + printf '\n' | lp + fi + + cd - > /dev/null +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +lpoptions -o PrintQuality=standard +DUPLEX= +while getopts 'dq:h' flag; do + case "$flag" in + d) + DUPLEX=1 + ;; + q) + case "$OPTARG" in + low) + lpoptions -o PrintQuality=draft + ;; + medium) + lpoptions -o PrintQuality=standard + ;; + high) + lpoptions -o PrintQuality=high + ;; + *) + echo "Bad QUALITY option: \"$OPTARG\"" >&2 + exit 2 + ;; + esac + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +NEWDIR="$(mkdtemp)" +if [ -z "${1:-}" ]; then + FILE="$NEWDIR"/STDIN + cat - > "$FILE" + main +else + for f in "$@"; do + FILE="$f" + main + done +fi diff --git a/bin/qr b/bin/qr new file mode 100755 index 0000000..4821a46 --- /dev/null +++ b/bin/qr @@ -0,0 +1,58 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + qr [-s PIXEL_SIZE] + qr -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -s PIXEL_SIZE size of the pixel (default 10) + -h, --help show this help message + + Read data from STDIN and present a QR image with said data. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +PIXEL_SIZE=10 +while getopts 's:h' flag; do + case "$flag" in + s) + PIXEL_SIZE="$OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + + +cat | qrencode -s "$PIXEL_SIZE" -o- | feh - diff --git a/bin/rfc b/bin/rfc new file mode 100755 index 0000000..a483595 --- /dev/null +++ b/bin/rfc @@ -0,0 +1,117 @@ +#!/bin/sh +set -eu + +TARBALL_URL='https://www.rfc-editor.org/in-notes/tar/RFC-all.tar.gz' + +usage() { + cat <<-'EOF' + Usage: + rfc [-w] RFC_NUMBER + rfc -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -w Show the path to the RFC file instead of displaying + its contents. + -h, --help show this message + + Lookup the given RFC + in $XDG_DATA_HOME/doc/rfc/ (defaults to ~/.local/share), + and feed it into the $PAGER, akin to doing: + + $ $PAGER $XDG_DATA_HOME/doc/rfc/rfc$RFC_NUMBER.txt + + If the $XDG_DATA_HOME/doc/rfc/ directory doesn't exist, it tries to + create it by downloading the latest RFC tarball [0] and placing all .txt + files there. + EOF + + printf '\n[0]: %s\n' "$TARBALL_URL" +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'wh' flag; do + case "$flag" in + w) + WHERE=true + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +RFC_NUMBER="${1:-}" +if [ -z "$RFC_NUMBER" ]; then + echo 'Missing argument RFC_NUMBER' >&2 + usage >&2 + exit 2 +fi + +D="${XDG_DATA_HOME:-$HOME/.local/share}/doc/rfc" +if [ ! -e "$D" ]; then + printf 'RFC directory does not exist:\n\t%s/\n\n' "$D" + printf 'Do you want to download the files to create it? [Y/n] ' + read -r yesno + if [ "$yesno" != 'n' ] && [ "$yesno" != 'N' ]; then + CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/rfc-cli" + mkdir -p "$CACHE_DIR" + wget -cO "$CACHE_DIR"/RFC-all.tar.gz "$TARBALL_URL" + rm -rf "$CACHE_DIR/tmp" + mkdir -p "$CACHE_DIR/tmp" + tar \ + -C "$CACHE_DIR/tmp" \ + -xvf "$CACHE_DIR"/RFC-all.tar.gz \ + --wildcards \ + 'rfc*.txt' + mkdir -p "$(dirname "$D")" + mv "$CACHE_DIR/tmp" "$D" + fi +fi + +F="$D/rfc${RFC_NUMBER}.txt" +if [ ! -e "$F" ]; then + printf 'Given RFC_NUMBER "%s" does not exist at:\n%s\n' \ + "$RFC_NUMBER" "$F" >&2 + exit 2 +fi + +if [ "${WHERE:-}" = true ]; then + printf '%s\n' "$F" + exit +fi + +view() { + if [ -t 1 ]; then + ${PAGER:-cat} + else + cat + fi +} + +view < "$F" diff --git a/bin/tmpname b/bin/tmpname new file mode 100755 index 0000000..d83fc87 --- /dev/null +++ b/bin/tmpname @@ -0,0 +1,52 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + tmpname + tmpname -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Generate a temporary name. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +echo "${TMPDIR:-/tmp}/uuid-tmpname with spaces.$(uuid)" diff --git a/bin/uuid b/bin/uuid new file mode 100755 index 0000000..74d0fba --- /dev/null +++ b/bin/uuid @@ -0,0 +1,53 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + uuid + uuid -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Generate UUID from /dev/random. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +od -xN20 /dev/random | + awk 'NR == 1 { OFS="-"; print $2$3,$4,$5,$6,$7$8$9; exit }' diff --git a/bin/with-email b/bin/with-email new file mode 100755 index 0000000..9d6326b --- /dev/null +++ b/bin/with-email @@ -0,0 +1,84 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + with-email [-s SUBJECT] COMMAND... + with-email -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -s SUBJECT set the subject of the email + -h, --help show this message + + COMMAND the command to be wrapped + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +SUBJECT='NO SUBJECT' +while getopts 's:h' flag; do + case "$flag" in + s) + SUBJECT="$OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + printf 'Missing %s\n\n' "$2" >&2 + usage >&2 + exit 2 + fi +} + +assert_arg "${1:-}" 'COMMAND...' + +now() { + date '+%Y-%m-%dT%H:%M:%S%Z' +} + +OUT="$(mkstemp)" +{ + printf 'Running command: %s\n' "$*" + printf 'Starting at: %s\n' "$(now)" + printf '\n' + + STATUS=0 + "$@" 2>&1 || STATUS=$? + + printf '\n' + printf '\nFinished at: %s\n' "$(now)" +} 2>&1 1>"$OUT" + +email -s "(exit status: $STATUS) - $SUBJECT" eu@euandre.org < "$OUT" diff --git a/bin/without-env b/bin/without-env new file mode 100755 index 0000000..45c41ca --- /dev/null +++ b/bin/without-env @@ -0,0 +1,76 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + without-env ENVVAR PATH -- COMMAND... + without-env [-h] + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + Examples: + + Execute "command -V" filtering ~/bin, to get where "w3m" is + in $PATH, other than ~/bin: + $ without-env PATH ~/bin -- command -v w3m + + Compile foo.c, excluding ~/.local/include + from $C_INCLUDE_PATH: + $ without-env C_INCLUDE_PATH ~/.local/include -- cc -co foo.o foo.c + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + printf 'Missing %s\n' "$2" >&2 + exit 2 + fi +} + +assert_arg "${1:-}" 'ENVVAR' +assert_arg "${2:-}" 'PATH' +assert_arg "${3:-}" '--' + +eval "export $1=\"\$(echo \"\$$1\" | sed \"s|\$2:||g\")\"" +shift # drop $1 +shift # drop $2 +shift # drop -- + +"$@" diff --git a/bin/xdg-open b/bin/xdg-open new file mode 120000 index 0000000..ce4a72b --- /dev/null +++ b/bin/xdg-open @@ -0,0 +1 @@ +open \ No newline at end of file diff --git a/bin/xmpp b/bin/xmpp new file mode 100755 index 0000000..472e9ca --- /dev/null +++ b/bin/xmpp @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 + +import os +import sys +import getopt +import logging +import slixmpp + +USAGE = """\ +Usage: + xmpp [-d] [-F FROM_JID] -m MESSAGE TO_JID... + xmpp -h""" + +HELP = """ +Options: + -d run in DEBUG mode + -m MESSAGE the text of the message to be sent + -h, --help show this message + + FROM_JID the address used to send the message from + TO_JID the addresses where to send the message to""" + +class SendMsgBot(slixmpp.ClientXMPP): + def __init__(self, jid, password, on_start): + slixmpp.ClientXMPP.__init__(self, jid, password) + + self.on_start = on_start + self.add_event_handler("session_start", self.start) + + def start(self, event): + self.on_start(self) + self.disconnect(wait=True) + +def main(): + logging.basicConfig(level=logging.INFO) + from_ = "bot@euandreh.xyz" + message = "" + + for s in sys.argv: + if s == "--": + break + elif s == "--help": + print(USAGE) + print(HELP) + sys.exit() + + try: + opts, args = getopt.getopt(sys.argv[1:], 'm:F:dh') + except getopt.GetoptError as err: + print(err, file=sys.stderr) + print(USAGE, file=sys.stderr) + sys.exit(2) + for o, a in opts: + if o == "-m": + message = a + elif o == "-F": + from_ = a + elif o == "-d": + logging.basicConfig(level=logging.DEBUG) + elif o == "-h": + print(USAGE) + print(HELP) + sys.exit() + else: + assert False, "unhandled option" + + if message == "": + print("Missing -m MESSAGE", file=sys.stderr) + print(USAGE, file=sys.stderr) + sys.exit(2) + + if args == []: + print("Missing TO_JID", file=sys.stderr) + print(USAGE, file=sys.stderr) + sys.exit(2) + + passcmd = "pass show VPS/kuvira/XMPP/" + from_ + " | head -n1 | tr -d '\\n'" + password = os.popen(passcmd).read() + + def on_start(self): + for to in args: + self.send_message(mto=to, mbody=message, mtype='chat') + + xmpp = SendMsgBot(from_, password, on_start) + xmpp.connect() + xmpp.process(forever=False) + +if __name__ == "__main__": + main() diff --git a/etc/afew/config b/etc/afew/config new file mode 100644 index 0000000..94341e9 --- /dev/null +++ b/etc/afew/config @@ -0,0 +1,6 @@ +[SpamFilter] +[KillThreadsFilter] +[ListMailsFilter] +[ArchiveSentMailsFilter] +[MeFilter] +[InboxFilter] diff --git a/etc/alot/config b/etc/alot/config new file mode 120000 index 0000000..a92319d --- /dev/null +++ b/etc/alot/config @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/alot/config \ No newline at end of file diff --git a/etc/bash/check.sh b/etc/bash/check.sh new file mode 100755 index 0000000..7c12dec --- /dev/null +++ b/etc/bash/check.sh @@ -0,0 +1,57 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + check.sh + check.sh -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + + +shellcheck -xe 1090,1091 \ + "$XDG_CONFIG_HOME"/bash/rc \ + "$XDG_CONFIG_HOME"/bash/vcs-ps1.sh \ + "$XDG_CONFIG_HOME"/bash/check.sh \ + "$XDG_CONFIG_HOME"/bash/privrc.sh + +sh -eu ~/.profile diff --git a/etc/bash/inputrc b/etc/bash/inputrc new file mode 100644 index 0000000..f5c7095 --- /dev/null +++ b/etc/bash/inputrc @@ -0,0 +1,2 @@ +"\e[B": history-search-forward +"\e[A": history-search-backward diff --git a/etc/bash/privrc.sh b/etc/bash/privrc.sh new file mode 120000 index 0000000..243a4bd --- /dev/null +++ b/etc/bash/privrc.sh @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/privrc.sh \ No newline at end of file diff --git a/etc/bash/vcs-ps1.sh b/etc/bash/vcs-ps1.sh new file mode 100644 index 0000000..f2103da --- /dev/null +++ b/etc/bash/vcs-ps1.sh @@ -0,0 +1,158 @@ +#!/bin/sh + +repo_status_git() { + BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" + OUT="$(git status --short --branch --porcelain)" + BRANCH_LINE="$(echo "$OUT" | head -n 1)" + DIFF_LINES="$(echo "$OUT" | tail -n +2)" + + IS_AHEAD=false + IS_BEHIND=false + if echo "$BRANCH_LINE" | grep -q 'ahead'; then + IS_AHEAD=true + fi + if echo "$BRANCH_LINE" | grep -q 'behind'; then + IS_BEHIND=true + fi + + LINE='' + + if [ "$IS_AHEAD" = true ] && [ "$IS_BEHIND" = true ]; then + LINE="^^^ $BRANCH_NAME vvv" + elif [ "$IS_AHEAD" = true ]; then + LINE="^ $BRANCH_NAME ^" + elif [ "$IS_BEHIND" = true ]; then + LINE="v $BRANCH_NAME v" + else + LINE="$BRANCH_NAME" + fi + + HAS_DIFF=false + HAS_UNTRACKED=false + if echo "$DIFF_LINES" | grep -q '^[A|D|M| ][M|D| ]'; then + HAS_DIFF=true + fi + if echo "$DIFF_LINES" | grep -q '^[?][?]'; then + HAS_UNTRACKED=true + fi + + if [ "$HAS_DIFF" = true ]; then + COLOR_FN=redb + LINE="{$LINE}" + elif [ "$IS_AHEAD" = true ] || [ "$IS_BEHIND" = true ]; then + COLOR_FN=bluei + LINE="[$LINE]" + elif [ "$HAS_UNTRACKED" = true ]; then + COLOR_FN=lightblue + LINE="{$LINE}" + else + COLOR_FN=green + LINE="($LINE)" + fi + + color -c "$COLOR_FN" "$LINE" + + BRANCH_COUNT="$(git branch --list | wc -l)" + if [ "$BRANCH_COUNT" -gt 1 ]; then + color -c lightblue "<$BRANCH_COUNT>" + fi + + STASH_COUNT="$(git stash list | wc -l)" + if [ "$STASH_COUNT" != 0 ]; then + color -c red "*$STASH_COUNT" + fi + + color -c blacki " - git/$(git rev-parse HEAD)" +} + +repo_status_fossil() { + BRANCH_NAME="$(fossil branch current)" + + if [ -n "$(fossil extras)" ]; then + HAS_UNTRACKED=1 + fi + + BRANCH_MARKER="$BRANCH_NAME" + + if [ -n "${HAS_UNTRACKED:-}" ]; then + COLOR_FN=lightblue + LINE="($BRANCH_MARKER)" + else + COLOR_FN=green + LINE="($BRANCH_MARKER)" + fi + + color -c "$COLOR_FN" "$LINE" + + color -c blacki " - fossil/$(fossil info | awk '/^checkout:/ { print $2 }')" +} + +repo_status_mercurial() { + BRANCH_NAME="$(hg branch)" +} + +repo_status() { + dir="$(basename "$PWD")" + if [ -d .git ]; then + repo_status_git + elif [ -f "$dir.fossil" ]; then + repo_status_fossil + elif [ -d .hg ]; then + repo_status_mercurial + fi +} + + +error_marker() { + STATUS=$? + if [ "$STATUS" != 0 ]; then + color -c redb " (!! $STATUS !!) " + fi +} + +timestamp() { + color -c blacki '\T' +} + +path() { + color -c yellowb '\w/' +} + +guix_env() { + if [ "$GUIX_ENVIRONMENT" != '' ]; then + printf '\n' + color -c blacki '~> ' + color -c purple 'guix environment ' + printf '(' + color -c blueb "$GUIX_ENVIRONMENT" + printf ')' + fi +} + +in_nix_shell() { + if [ "$IN_NIX_SHELL" != '' ]; then + printf '\n' + color -c blacki '~> ' + color -c purpleb "$IN_NIX_SHELL " + color -c purple 'nix-shell ' + printf '(' + color -c blueb "${name:-}" + printf ')' + fi +} + +PS1='`error_marker`'$(timestamp)' '$(path)' `repo_status``guix_env``in_nix_shell` +$ ' + + +vcs_status() { + git status "$@" +} + +vcs_diff() { + git diff "$@" +} + +vcs_diff_staged() { + git diff --staged "$@" +} diff --git a/etc/gnupg/gpg.conf b/etc/gnupg/gpg.conf new file mode 100644 index 0000000..d4498fe --- /dev/null +++ b/etc/gnupg/gpg.conf @@ -0,0 +1 @@ +keyserver pool.sks-keyservers.net diff --git a/etc/gnupg/sshcontrol b/etc/gnupg/sshcontrol new file mode 100644 index 0000000..1ae03ed --- /dev/null +++ b/etc/gnupg/sshcontrol @@ -0,0 +1 @@ +750154E135FD7B11FDDF0107CC0904F92EBD2AE4 diff --git a/etc/guix/channels.scm b/etc/guix/channels.scm new file mode 100644 index 0000000..304db35 --- /dev/null +++ b/etc/guix/channels.scm @@ -0,0 +1,20 @@ +(append + (list + (channel + (name 'xyz-euandreh) + (url "git://euandreh.xyz/package-repository.git/") + (branch "main") + (introduction + (make-channel-introduction + "d749e053e6db365069cb9b2ef47a78b06f9e7361" + (openpgp-fingerprint + "5BDA E9B8 B2F6 C6BC BB0D 6CE5 81F9 0EC3 CD35 6060")))) + (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))) + %default-channels) diff --git a/etc/guix/home.scm b/etc/guix/home.scm new file mode 100644 index 0000000..607a059 --- /dev/null +++ b/etc/guix/home.scm @@ -0,0 +1,152 @@ +(use-modules + (curth0) + (gnu home services) + (gnu home services shells) + (gnu packages) + (gnu packages mail) + (gnu packages gnupg) + (gnu services) + (guix gexp) + (guix packages) + (guix utils)) + +(define msmtp-non-hardcoded + (package + (inherit msmtp) + (name "msmtp-non-hardcoded") + (arguments + (substitute-keyword-arguments (package-arguments msmtp) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'install-additional-files 'patch-hardcoded-paths + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (substitute* (string-append out "/bin/msmtpq") + (("^LOG=.*$") "LOG=${XDG_LOG_HOME:-$HOME/.local/var/log}/msmtpq.log\n") + (("^Q=.*$") "Q=${XDG_DATA_HOME:-$HOME/.local/share}/msmtp/queue\n") + (("mkdir -m 0700 \"\\$Q\"") "mkdir -p -m 0700 \"$Q\""))))))))))) + +(define (xdg-config-home s) + (string-append (getenv "XDG_CONFIG_HOME") "/" s)) + +(define gitconfig (mixed-text-file "gitconfig" #"- + [user] + email = eu@euandre.org + name = EuAndreh + signingkey = 81F90EC3CD356060 + [transfer] + fsckobjects = true + [push] + default = current + [commit] + gpgsign = true + verbose = true + [init] + defaultBranch = main + [sendemail] + assume8bitEncoding = UTF-8 + smtpserveroption = -a + smtpserveroption = euandreh + annotate = yes + confirm = never + smtpserver = "# msmtp-non-hardcoded "/bin/msmtpq\n")) + +(define gpg-agent.conf (mixed-text-file "gpg-agent.conf" #"- + default-cache-ttl 172800 + default-cache-ttl-ssh 172800 + max-cache-ttl 604800 + max-cache-ttl-ssh 604800 + enable-ssh-support + pinentry-program "# pinentry-gtk2 "/bin/pinentry-gtk-2\n")) + +(define config-files + `(("gnupg/gpg-agent.conf" ,gpg-agent.conf) + ("git/config" ,gitconfig))) + +(define (dot-config) + (define (prefix-with-config s) + (string-append (substring (getenv "XDG_CONFIG_HOME") + (+ 1 (string-length (getenv "HOME")))) + "/" + s)) + (map (lambda (t) + (list (prefix-with-config (first t)) + (second t))) + config-files)) + +(home-environment + (packages + (append + (map (compose list specification->package+output symbol->string) + '(man-pages + posix-man-pages + + tree + openssh + mailutils + entr + git + git:send-email + tmux + rsync + gnupg + pulseaudio + password-store + playerctl + pinentry-gtk2 + bmake + fzf + ranger + blueman + ledger + curl + xclip + cloc + strace + file + urlscan + rlwrap + direnv + borg + khal + khard + libfaketime + qrencode + feh + sox + xset + graphviz + moreutils + shellcheck + gettext + groff + + clojure + openjdk + sbcl + perl + perl-mojolicious + + st + i3status + dmenu + + weechat + alot + notmuch + isync + w3m + afew + + zathura + zathura-djvu + zathura-pdf-poppler + zathura-ps + firefox)) + (list msmtp-non-hardcoded))) + (services + (list (service home-bash-service-type + (home-bash-configuration + (bashrc + (list (plain-file "bashrc.sh" ". $XDG_CONFIG_HOME/bash/rc"))))) + (simple-service 'config-files home-files-service-type (dot-config))))) diff --git a/etc/guix/system.scm b/etc/guix/system.scm new file mode 100644 index 0000000..3bd7235 --- /dev/null +++ b/etc/guix/system.scm @@ -0,0 +1,102 @@ +(use-modules + (curth0) + (gnu bootloader) + (gnu bootloader grub) + (gnu packages) + (gnu services base) + (gnu services desktop) + (gnu services security-token) + (gnu services xorg) + (gnu system keyboard) + (gnu system file-systems) + (gnu system mapped-devices) + (guix gexp) + (nongnu packages linux) + (nongnu system linux-initrd)) + +(operating-system + (kernel linux) + (initrd microcode-initrd) + (firmware (list linux-firmware)) + (locale "fr_FR.UTF-8") + (timezone "America/Sao_Paulo") + (keyboard-layout + (keyboard-layout "br" #:options '("caps:swapescape" "esperanto:qwerty"))) + (host-name "velhinho") + (users + (append + (let ((user-groups '("wheel" "netdev" "audio" "video"))) + (list + (user-account + (name "andreh") + (comment "EuAndreh") + (group "users") + (supplementary-groups user-groups)) + (user-account + (name "other") + (comment "Other Self") + (group "users") + (supplementary-groups user-groups)))) + %base-user-accounts)) + (packages + (append + (map (compose list specification->package+output symbol->string) + '(nss-certs + i3-wm)) + %base-packages)) + (services + (append + (list + (service bluetooth-service-type) + (service pcscd-service-type) + (service gnome-desktop-service-type) + (set-xorg-configuration + (xorg-configuration + (keyboard-layout keyboard-layout) + (extra-config (list #"- + Section "InputClass" + Identifier "touchpad" + Driver "libinput" + MatchIsTouchpad "on" + Option "Tapping" "on" + EndSection + "#))))) + (modify-services %desktop-services + (guix-service-type config => + (guix-configuration + (inherit config) + (substitute-urls + (append '("https://substitutes.nonguix.org") + %default-substitute-urls)) + (authorized-keys + (append (list (plain-file "non-guix.pub" #"- + (public-key + (ecc + (curve Ed25519) + (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#))) + "#)) + %default-authorized-guix-keys))))))) + (bootloader + (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets (list "/boot/efi")) + (keyboard-layout keyboard-layout))) + (mapped-devices + (list + (mapped-device + (source (uuid "6b0d38a6-d93e-4f8e-a59a-7729f5adf892")) + (target "cryptroot") + (type luks-device-mapping)))) + (file-systems + (append + (list + (file-system + (mount-point "/boot/efi") + (device (uuid "1B26-9F4E" 'fat32)) + (type "vfat")) + (file-system + (mount-point "/") + (device "/dev/mapper/cryptroot") + (type "ext4") + (dependencies mapped-devices))) + %base-file-systems))) diff --git a/etc/hg/hgrc b/etc/hg/hgrc new file mode 100644 index 0000000..656f40b --- /dev/null +++ b/etc/hg/hgrc @@ -0,0 +1,2 @@ +[ui] +username = EuAndreh diff --git a/etc/i3/config b/etc/i3/config new file mode 100644 index 0000000..0b41311 --- /dev/null +++ b/etc/i3/config @@ -0,0 +1,186 @@ +set $mod Mod4 + + +# font pango:monospace 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +font pango:DejaVu Sans Mono 8 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet +exec --no-startup-id blueman-applet +exec --no-startup-id poweralertd +exec dunst + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym F1 exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym F2 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym F3 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status + +bindsym F4 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` position 5- +bindsym Shift+F4 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` previous +bindsym F5 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` play-pause +Bindsym Shift+F5 exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/rotate-mpris-player.sh +bindsym F6 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` position 5+ +bindsym Shift+F6 exec --no-startup-id playerctl --player=`cat ~/.cache/euandreh-mpris-player.txt` next + +# FIXME bad path +bindsym F7 exec --no-startup-id ~/.local/bin/brightness -1 +bindsym F8 exec --no-startup-id ~/.local/bin/brightness +1 + + + +bindsym $mod+Shift+s exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/toggle-pulseaudio-sink.sh && $refresh_i3status + + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +bindsym $mod+Return exec st +bindsym $mod+Shift+q kill +bindsym $mod+p exec --no-startup-id dmenu_run + + + + +# FIXME: better placement of these files +bindsym $mod+o exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-emoji.sh +bindsym $mod+v exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-clipmenu.sh +bindsym $mod+i exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-pass.sh +bindsym $mod+Control+i exec --no-startup-id ~/dev/libre/dotfiles/xmonad/scripts/dmenu-pass-login.sh + + + + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# bindsym $mod+h split h # what is this? + +# split in vertical orientation +# FIXME: what is this? It was in conflict with dmenu-clipmenu +# bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + # bindsym Left resize shrink width 10 px or 10 ppt + # bindsym Down resize grow height 10 px or 10 ppt + # bindsym Up resize shrink height 10 px or 10 ppt + # bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Caps_Lock mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + position top + status_command i3status +} + +default_border pixel +default_floating_border pixel diff --git a/etc/info/infokey b/etc/info/infokey new file mode 100644 index 0000000..90edc50 --- /dev/null +++ b/etc/info/infokey @@ -0,0 +1,7 @@ +^e down-line +^y up-line + +#var +link-style=cyan +active-link-style=blue,bold +match-style=underline,bold,bggreen diff --git a/etc/khal/config b/etc/khal/config new file mode 120000 index 0000000..dfae173 --- /dev/null +++ b/etc/khal/config @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/khal/config \ No newline at end of file diff --git a/etc/khard/khard.conf b/etc/khard/khard.conf new file mode 120000 index 0000000..f015b29 --- /dev/null +++ b/etc/khard/khard.conf @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/khard/khard.conf \ No newline at end of file diff --git a/etc/mailcaps/config b/etc/mailcaps/config new file mode 100644 index 0000000..aeea68d --- /dev/null +++ b/etc/mailcaps/config @@ -0,0 +1 @@ +text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput diff --git a/etc/mbsync/config b/etc/mbsync/config new file mode 120000 index 0000000..68a3234 --- /dev/null +++ b/etc/mbsync/config @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/mbsync/config \ No newline at end of file diff --git a/etc/msmtp/config b/etc/msmtp/config new file mode 120000 index 0000000..45cd0ac --- /dev/null +++ b/etc/msmtp/config @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/msmtp/config \ No newline at end of file diff --git a/etc/newsboat/urls b/etc/newsboat/urls new file mode 120000 index 0000000..3c453f5 --- /dev/null +++ b/etc/newsboat/urls @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/newsboat/urls \ No newline at end of file diff --git a/etc/notmuch/default/config b/etc/notmuch/default/config new file mode 120000 index 0000000..3b9d2f4 --- /dev/null +++ b/etc/notmuch/default/config @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/notmuch/default/config \ No newline at end of file diff --git a/etc/notmuch/default/hooks/post-new b/etc/notmuch/default/hooks/post-new new file mode 120000 index 0000000..7992789 --- /dev/null +++ b/etc/notmuch/default/hooks/post-new @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/notmuch/post-new \ No newline at end of file diff --git a/etc/python/pythonrc.py b/etc/python/pythonrc.py new file mode 100644 index 0000000..1fc3bfe --- /dev/null +++ b/etc/python/pythonrc.py @@ -0,0 +1,15 @@ +import os +import atexit +import readline + +history = os.path.join(os.environ["XDG_STATE_HOME"], "python-history") + +try: + readline.read_history_file(history) +except OSError: + pass + +def write_history(): + readline.write_history_file(history) + +atexit.register(write_history) diff --git a/etc/ranger/rc.conf b/etc/ranger/rc.conf new file mode 100644 index 0000000..ed2b538 --- /dev/null +++ b/etc/ranger/rc.conf @@ -0,0 +1 @@ +map DD shell trash %s diff --git a/etc/sbcl/sbclrc.lisp b/etc/sbcl/sbclrc.lisp new file mode 100644 index 0000000..df7f57a --- /dev/null +++ b/etc/sbcl/sbclrc.lisp @@ -0,0 +1,6 @@ +;;; The following lines added by ql:add-to-init-file: +#-quicklisp +(let ((quicklisp-init (merge-pathnames "dev/quicklisp/setup.lisp" + (user-homedir-pathname)))) + (when (probe-file quicklisp-init) + (load quicklisp-init))) diff --git a/etc/ssh/known_hosts b/etc/ssh/known_hosts new file mode 100644 index 0000000..ad6b0b2 --- /dev/null +++ b/etc/ssh/known_hosts @@ -0,0 +1,74 @@ +|1|G2vfdmQ84glwobYXZZ0d+cCMVRE=|DZJYmWjbeP52J4K7+Bsz2e0dgBA= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= +|1|yosAhKlbZt51FfD2VvQJiVijSBA=|BFEig1gqq4EwCHEHagEASQZQmNI= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= +|1|5yKbUaAB5AFz4MINtTVhVAPwMtU=|LwcI5Z8hXwwKxtkk4KDpeZduyPQ= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr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XpFV3zQ3/Dp875skdTOZaA9DjQ0EeUS+M= +pt.hinarioespirita.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEnGFkXNEF6RHihT3szgVEBAhRKXlI6YKSUOQFzhuNVkMOBgEfr+OaXpFV3zQ3/Dp875skdTOZaA9DjQ0EeUS+M= +mtm.hinarioespirita.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEnGFkXNEF6RHihT3szgVEBAhRKXlI6YKSUOQFzhuNVkMOBgEfr+OaXpFV3zQ3/Dp875skdTOZaA9DjQ0EeUS+M= +77.109.148.18 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKBxDZv64oRMzRkywjmRRrml2pr0XFSZhlL46nUSmM60 +35.231.145.151 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= +git.sr.ht,173.195.146.142 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCj6y+cJlqK3BHZRLZuM+KP2zGPrh4H66DacfliU1E2DHAd1GGwF4g1jwu3L8gOZUTIvUptqWTkmglpYhFp4Iy4= +192.168.33.10 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCL+hEiW/Va2L6y5Y4MyxRBXHJw/9bIC02M3wGVe1zaD3DT8wsAUcJ2QO1lJILudvMInx+SaPyJmwBvUn58YR2c= +173.195.146.152 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCj6y+cJlqK3BHZRLZ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EYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== +140.82.114.4 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== +2604:bf00:710:0:5054:ff:fe7d:8fa8 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCj6y+cJlqK3BHZRLZuM+KP2zGPrh4H66DacfliU1E2DHAd1GGwF4g1jwu3L8gOZUTIvUptqWTkmglpYhFp4Iy4= +azusa.runners.sr.ht,2604:bf00:710:0:ae1f:6bff:fead:55a ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPzxK5AM1FdMI9gZVDpw2O5iiS/49QokWpzANFntVt0Qig4qdBt4K7B0O6MrwggLh3A+zBlsXCMoWtvFtPQgLxA= +18.228.52.138 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSw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VUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== +hg.sr.ht,2604:bf00:710:0:5054:ff:fe25:1aa6 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBL4aNGa+KnvMA0QoWrIVuI2QBU0Q/xX48sMBl3VtP/zPOGMvS50zGVMaA00RSzfcI2X0v/aUTsVm2vBNo/V1gTg= +euandre.org,2a03:b0c0:3:d0::387:b001 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF6wlJqwd7KWLzLovwnwbTmNfO4E4yVDyqxAAlUkn9eDsTtzV1RYNDsaLPWv4mweJqP4crZPFxg40sFVeMDbkC0= +2606:4700:90:0:f22e:fbec:5bed:a9b9 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= +46.101.160.115 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF6wlJqwd7KWLzLovwnwbTmNfO4E4yVDyqxAAlUkn9eDsTtzV1RYNDsaLPWv4mweJqP4crZPFxg40sFVeMDbkC0= +173.195.146.249 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPzxK5AM1FdMI9gZVDpw2O5iiS/49QokWpzANFntVt0Qig4qdBt4K7B0O6MrwggLh3A+zBlsXCMoWtvFtPQgLxA= +2604:a880:800:14::32:4000 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK8YTumqLFAL5MJ0AcDtFG9dWfbkJKU7FUDlH0xEgAZvHGU57TBr9DIQy2OHrxCxuhk9bZEUX8+vJiRXE05+Rzs= +2001:19f0:7001:5cec:5400:2ff:feec:9940 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPYRWlGutc+bRJ+N0sXHxhgnDsRvRoauQ92yM1U7N+8a +2001:19f0:6c01:2cf0:5400:2ff:feec:99c5 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMGiiEXB+koPS1vgGkwdExk2Q5fGv3Yc5rf8jVHB2FB7 +45.32.155.96 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfPxSXxvq3MHuMvthg+q69ooniSeqXbit1UiW0gbLZN +45.77.65.204 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfPxSXxvq3MHuMvthg+q69ooniSeqXbit1UiW0gbLZN +136.244.85.68 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKfPxSXxvq3MHuMvthg+q69ooniSeqXbit1UiW0gbLZN +199.247.0.136 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +euandreh.xyz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +136.244.80.130 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +209.250.232.122 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +git.euandreh.xyz ssh-ed25519 AAAAC3N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Y= +140.82.112.3 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== +45.32.158.17 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +95.179.253.243 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +95.179.163.103 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +217.69.2.177 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= +arrobaponto.org,104.238.167.189 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= +104.238.176.81 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= +git.arrobaponto.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= +173.199.70.52 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNhpYZqFXy4CkOrSg5naR5Any47jqgZUIwbiTvsl2Yhm5EiUtCZTIVHui7q262M5qlDY6syQ5lVMtSsLJuTce+I= +[remembering.euandreh.xyz]:23841 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvhhXQBEY9GhWOtBoLpDJRjqHAu7ci2A9l1xoet1Cz/ +167.71.86.194 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCXg/l/grol/OAY95VphKbVn4yXUStSWpxQjnka7PWXzWyForfX+fpmY+p72r1Uimx5oXIFISt8uSZW/tvD61iQ= +[localhost]:10022 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLHACdQJXUj5e4Znyh7KdTjB1RLznSfStRw6cuHZlu8rhANVfkjt300Fum9Jv6yLra6W4v2FLALWfcYpOlUzt9c= +107.191.63.70 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMONpsqwH79f/MsjtsOPitT5C+3hPPJqVh42oHMKOen6 +217.69.11.49 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPKbzWSlFwmlrC+k6XU9eUJaejREGxTF03OX/mT7KhSr +[arrobaponto.org]:23213 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPKbzWSlFwmlrC+k6XU9eUJaejREGxTF03OX/mT7KhSr +anoncvs.netbsd.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA3QiBl8leG9fqIJpKeNov0PKq5YryFFiroMWOPUv4hDFn8R0jC07YVaR/OSBrr37CTmGX5AFceXPzoFnLlwCqWR7rXg4NR75FTlTp9CG9EBAEtU8mee27KDrUFBTZdfVl2+aRYoAI5fTXA+0vpIO68Cq843vRWUZCcwinS4cNLUU= +git.2f30.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJSLZ4G5w4NysBUmAHmr6/V9om42IHSUCtqrNdhWoYQ0 +[arrobaponto.org]:38123 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoz1gFl6chY91vQ5SrZXSP5yHqRI3TdYy2ccEDpS7Z4 +[199.247.13.53]:38123 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoz1gFl6chY91vQ5SrZXSP5yHqRI3TdYy2ccEDpS7Z4 +[2001:19f0:6801:988:5400:3ff:fea1:b566]:38123 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoz1gFl6chY91vQ5SrZXSP5yHqRI3TdYy2ccEDpS7Z4 +[gerrit.wikimedia.org]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCF8pwFLehzCXhbF1jfHWtd9d1LFq2NirplEBQYs7AOrGwQ/6ZZI0gvZFYiEiaw1o+F1CMfoHdny1VfWOJF3mJ1y9QMKAacc8/Z3tG39jBKRQCuxmYLO1SWymv7/Uvx9WQlkNRoTdTTa9OJFy6UqvLQEXKYaokfMIUHZ+oVFf1CgQ== +2001:19f0:5:1d65:5400:3ff:fee3:7463 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF2EgU3IgCwv1ynnWfxFm0SHTSoE0AYG3MJT/TpN3pBz diff --git a/etc/tmux/tmux.conf b/etc/tmux/tmux.conf new file mode 100644 index 0000000..dd718ca --- /dev/null +++ b/etc/tmux/tmux.conf @@ -0,0 +1,81 @@ +# Use personal prefix over "C-b" +unbind C-b +set -g prefix C-v + +# Turn on mouse mode +# https://groups.google.com/forum/#!msg/tmux-users/TRwPgEOVqho/Ck_oth_SDgAJ +# https://github.com/tmux/tmux/blob/310f0a960ca64fa3809545badc629c0c166c6cd2/CHANGES#L12 +set -g mouse on + +# Bind "C-x r" to reload the configuration file +bind-key r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display-message "$XDG_CONFIG_HOME/tmux.conf reloaded" + +# Holy answer that properly implements copying from tmux! +# https://unix.stackexchange.com/a/349020/276661 +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i" \; +bind-key y send-keys -X copy-pipe "xclip -selection clipboard -i" \; display-message "Copied system clipboard! Hooray! Long-live tmux!" + +# Moving around panes +bind-key -n M-h select-pane -L +bind-key -n M-j select-pane -D +bind-key -n M-k select-pane -U +bind-key -n M-l select-pane -R + +# Resizing panes +bind-key -n M-H resize-pane -L 5 +bind-key -n M-J resize-pane -D 5 +bind-key -n M-K resize-pane -U 5 +bind-key -n M-L resize-pane -R 5 + +# Reorder windows +bind-key -n C-S-Left swap-window -t -1\; select-window -t -1 +bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 +# +# To change the number of a window, use: PREFIX-., and pick a new unused number +# + +# Join windows +bind-key -n C-S-M-Left join-pane -s :-0 -t :-1 +bind-key -n C-S-M-Right join-pane -s :-0 -t :+1 + +# "M m" to actually clear the pane history +bind -n M-m send-keys -R \; clear-history + +# Keybinding to activate pane typing sync +# https://stackoverflow.com/questions/25909964/tmux-how-to-toggle-on-and-off-options-with-the-same-key +bind-key b setw synchronize-panes \; display-message "synchronize-panes toggle" + +setw -g mode-keys vi # Move around with vi keys +set-option -g status-key "vi" # Use vi mode for status bar command (like after typing "C-x [" one can search with "/") +set-option -g status-bg "#666666" # Status bar background color +set-option -g status-fg "#aaaaaa" # Status bar foreground color +set-option -g status-left-length 50 # session name in status bar length =[annex]= part +set-option -g history-limit 150000 # How many lines of history to keep +set-option -g status-right "" + +# Set the panes initial index value to 1 instead of 0 +# 0 is too far from ` ;) +set -g base-index 1 +set-window-option -g pane-base-index 1 + +# Automatically set window title +set-window-option -g automatic-rename on +set-option -g set-titles on + +# Set "correct term" +# https://wiki.archlinux.org/index.php/Tmux +set -g default-terminal screen-256color + +# No delay for escape key press +# https://mutelight.org/practical-tmux#faster-command-sequences +set -sg escape-time 0 + +# Display pane numbers for longer +# https://unix.stackexchange.com/questions/307696/how-to-increase-tmux-pane-numbers-display-time-ctrl-b-q +set -g display-panes-time 2500 + +bind-key t resize-pane -x 80 + +bind -n M-r attach-session -t . -c '#{pane_current_path}' \; display-message "CWD for session updated to #{pane_current_path}!" + +bind-key u capture-pane \; save-buffer /tmp/tmux-urlscan-buffer \; new-window -n "urlscan" '$SHELL -c "urlscan < /tmp/tmux-urlscan-buffer"' diff --git a/etc/weechat/irc.conf b/etc/weechat/irc.conf new file mode 120000 index 0000000..7dff360 --- /dev/null +++ b/etc/weechat/irc.conf @@ -0,0 +1 @@ +/home/andreh/dev/private/dotfiles/weechat/irc.conf \ No newline at end of file -- cgit v1.2.3