Skip to content

Instantly share code, notes, and snippets.

View apathor's full-sized avatar
💭
🐦

Mike Lalumiere apathor

💭
🐦
View GitHub Profile
# MFL's config for i3
# font
font Terminus
# modifier
set $mod Mod4
floating_modifier $mod
# decorations
#!/bin/bash
uniclock() {
local clocks=(🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠
🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦)
local hour=0 min=0 now=0 num=0
now="${1:-$(printf "%(%s)T\n" "-1")}"
read -r hour min < <(printf "%(%l %M)T\n" "$now")
min="${min#0}"
num=$(( (hour * 2) + (min >= 30) ))
printf "%s\n" "${clocks[$num]}"
# ; -*-shell-script-*-
# goenv bash config
goenv_setup() {
# the bin directory
local bin="${1:-$HOME/bin}"
local ver="${2:-1.14.1}"
# the goenv directory
local dir="${3:-$HOME/.goenv}"
# clone goenv
if ! [ -d "$dir" ]; then
unimoon is a function
unimoon ()
{
local pha=(🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘);
local cyc=2551392 adj=-604800;
local now pos num;
now="${1:-$(printf "%(%s)T\n" "-1")}";
pos=$(( (now + adj) % cyc ));
num=$(( pos / ( cyc / ${#pha[@]} ) ));
printf "%s\n" "${pha[$num]}"
#!/bin/bash
# cz - Line selection abstraction (plus utilities!)
# (C) 2020 by Mike Lalumiere
# TODO optional prompt (see 'dmenu -p foo')
# TODO cached input selection
###
req() {
local x=""
for x in "$@"; do
if ! hash "$x" &>/dev/null; then
@apathor
apathor / cz
Last active June 7, 2022 01:43
#!/bin/bash
# cz - Line selection abstraction (plus utilities!)
# (C) 2020 by Mike Lalumiere
###
req() {
local x=""
for x in "$@"; do
if ! hash "$x" &>/dev/null; then
printf "%s -- %s is required!\n" "${FUNCNAME[1]}" "$x" >&2
return 1
2019-04-08 11:18:03 basdb bitlbee fucked itself, too, no longer picking up `set nick_form
2019-03-20 10:55:53 apathor it doesnt know to ask your agent?
2019-04-08 10:23:05 apathor havent heard of opencm3
2019-02-18 22:14:28 <-- basdb (~bastian@2601:18c:8500:7f5b::8e4) has quit (Quit: WeeCha
2019-02-18 18:46:03 apathor word
2019-04-08 14:38:34 basdb yeah
2019-04-05 13:03:54 apathor sshuttle does fancy proxying over SSH somehow
2019-04-04 14:12:53 apathor at least it's not PHP
2019-02-18 19:53:41 basdb yeah once you get the hang of it
2019-04-01 12:11:07 basdb modified it, i prefet notifications in the bottom-right
SSH_AUTH_SOCK=/tmp/ssh-o9sq2BF9QCdO/agent.17386; export SSH_AUTH_SOCK;
SSH_AGENT_PID=17387; export SSH_AGENT_PID;
echo Agent pid 17387;
# ; -*-shell-script-*-
# MFL's bash profile config for ssh and gpg agent
# shellcheck disable=SC1090
keyagents() {
# TODO
# add keys
# option to use gpg-agent for ssh
# ssh-agent
#; -*-shell-script-*-
# rleval COMMAND
# Eval command and write the output into readline line buffer.
rleval() {
local a="${READLINE_LINE:0:$READLINE_POINT}"
local b="${READLINE_LINE:$READLINE_POINT}"
local s; s=$(eval "$@")
READLINE_LINE="${a}${s}${b}"
let READLINE_POINT+=${#s}
}