Compare commits

..

No commits in common. "38bbc87472bf894e1c89dc49b4908f0af04ee2a6" and "495b8c110fd01425961f67a6600d163c4e4b11ce" have entirely different histories.

5 changed files with 22 additions and 40 deletions

21
.bashrc
View File

@ -205,21 +205,6 @@ CDPATH="."\
":${HOME}/projects/aoc/2023" ":${HOME}/projects/aoc/2023"
################################## FUNCTIONS ################################### ################################## FUNCTIONS ###################################
################################ man (wrapper) #################################
# Depends on mktemp, nvim, man
man () (
__have mktemp || { log.err 'mktemp missing' ; exit 1 ; }
__have nvim || { log.err 'nvim missing' ; exit 2 ; }
__have man || { log.err 'man missing' ; exit 3 ; }
set -euo pipefail
trap '/bin/rm -f -- "${raw_manpage}"' EXIT
raw_manpage="$(mktemp)"
2>/dev/null MANPAGER=cat command man "$@" > "${raw_manpage}"
command nvim +Man! -- "${raw_manpage}"
command rm -f -- "${raw_manpage}"
)
################################# vix (posix) ################################## ################################# vix (posix) ##################################
vix () { vix () {
__have vi || { log.err 'vi missing' ; return 1 ; } __have vi || { log.err 'vi missing' ; return 1 ; }
@ -260,11 +245,11 @@ viw () {
vi "${@}" "$(type -P "${first}")" vi "${@}" "$(type -P "${first}")"
} }
################################# yolo (posix) ################################# #################################### paruuu (posix) ####################################
# Update arch linux system with pacman, paru and ssid whitelist # Update arch linux system with pacman, paru and ssid whitelist
# Clears cache and removes orphans. Arguably dangerous, but YOLO # Clears cache and removes orphans. Arguably dangerous.
# Depends on iw, paru, pacman, rankmirrors, sudo, curl # Depends on iw, paru, pacman, rankmirrors, sudo, curl
yolo () { paruuu () {
__have iw || { log.err 'iw missing' ; exit 1 ; } __have iw || { log.err 'iw missing' ; exit 1 ; }
__have paru || { log.err 'paru missing' ; exit 2 ; } __have paru || { log.err 'paru missing' ; exit 2 ; }
__have pacman || { log.err 'pacman missing' ; exit 3 ; } __have pacman || { log.err 'pacman missing' ; exit 3 ; }

View File

@ -43,9 +43,9 @@ vim.opt.updatetime = 50
vim.opt.paste = false vim.opt.paste = false
vim.opt.splitright = false vim.opt.splitright = false
vim.diagnostic.config({ -- vim.diagnostic.config({
virtual_lines = false, -- virtual_lines = false,
virtual_text = false, -- virtual_text = false,
underline = false, -- underline = false,
signs = true, -- signs = true,
}) -- })

View File

@ -1,2 +1,2 @@
#! /bin/sh - #! /bin/sh -
exec xrandr --output DP-1 --auto --output eDP-1 --off --output HDMI-1 --off exec xrandr --output DP-1 --auto --output eDP-1 --off

View File

@ -1,2 +1,2 @@
#! /bin/sh - #! /bin/sh -
exec xrandr --output HDMI-1 --auto --output eDP-1 --off --output DP-1 --off exec xrandr --output HDMI-1 --auto --output eDP-1 --off

View File

@ -2,23 +2,20 @@
set -e set -e
[ -z "${1}" ] && { xargs -n 1 -d '\n' "${0}"; exit 0; } [ -z "$1" ] && { xargs -n 1 -d '\n' "$0"; exit 0; }
[ -z "${HTITLE_WIDTH}" ] && HTITLE_WIDTH="80" || HTITLE_WIDTH="$((HTITLE_WIDTH + 0))" title=$*
[ "${HTITLE_WIDTH}" -lt 0 ] && HTITLE_WIDTH="0" title_len=${#title}
[ $title_len -gt 78 ] && { printf '%s\n' "$title"; exit 0; }
title="${*}" missing=$((80 - title_len - 2))
title_len="${#title}" i=0
[ "${title_len}" -gt "$((HTITLE_WIDTH - 2))" ] && { printf '%s\n' "${title}"; exit 0; } while [ $i -lt $((missing / 2)) ]; do
missing="$((HTITLE_WIDTH - title_len - 2))"
i="0"
while [ "${i}" -lt "$((missing / 2))" ]; do
printf '#' printf '#'
i="$((i+1))" i=$((i+1))
done done
printf ' %s ' "${title}" printf ' %s ' "$title"
while [ "${i}" -lt "${missing}" ]; do while [ $i -lt $missing ]; do
printf '#' printf '#'
i="$((i+1))" i=$((i+1))
done done
printf '\n' printf '\n'