my dotz
0

Configure Feed

Select the types of activity you want to include in your feed.

Add some dylanaraps stuff

+125 -1
+109
bin/bud
··· 1 + #!/bin/sh -f 2 + # 3 + # pywalesque posix sh alternative. 4 + 5 + img() { 6 + [ -d "$1" ] && { 7 + set +f 8 + set -f -- "$1/"* 9 + shift "$(shuf -i "1-$#" -n 1)" 10 + } 11 + 12 + [ -f "${img:=$1}" ] || exit 1 13 + 14 + printf '%s\n' "$img" 15 + } 16 + 17 + hex2rgb() { 18 + set -- "${1##\#}" 19 + 20 + r=${1%%????} 21 + g=${1##??} 22 + g=${g%%??} 23 + b=${1##????} 24 + 25 + r=$((0x$r)) 26 + g=$((0x$g)) 27 + b=$((0x$b)) 28 + } 29 + 30 + mod() { 31 + hex2rgb "$2" 32 + 33 + # The operator is stored in a variable 34 + # which makes shellcheck freak out. 35 + # shellcheck disable=1102,2086 36 + { 37 + r=$((r $3 $4)) 38 + g=$((g $3 $4)) 39 + b=$((b $3 $4)) 40 + } 41 + 42 + r=$((r > 255 ? 255 : r < 0 ? 0 : r)) 43 + g=$((g > 255 ? 255 : g < 0 ? 0 : g)) 44 + b=$((b > 255 ? 255 : b < 0 ? 0 : b)) 45 + 46 + export "$1=$(printf '%02x%02x%02x' "$r" "$g" "$b")" 47 + } 48 + 49 + col() { 50 + cache_file=$(printf %s "$img" | base64) 51 + 52 + # Backticks need to be used here to fix bugs in 53 + # some specific POSIX shells. 54 + # 55 + # Word splitting is also intentional and safe here. 56 + # shellcheck disable=2046,2006 57 + if [ -f "$cache_dir/$cache_file" ]; then 58 + paleta < "$cache_dir/$cache_file" & 59 + 60 + else 61 + set -- `\ 62 + convert "$img" \ 63 + -alpha off \ 64 + -resize 64x64 \ 65 + -posterize 16 \ 66 + -fill white \ 67 + -colorize 30% \ 68 + -modulate 125,175,100 \ 69 + -unique-colors \ 70 + txt:- | 71 + while IFS='# ' read -r _ _ col _; do 72 + i=$((i+1)) 73 + [ "$i" -lt 11 ] && continue 74 + [ "$i" -gt 16 ] && continue 75 + printf '%s\n' "$col" 76 + done 77 + ` 78 + 79 + # These variables are dynamically defined, 80 + # ignore undeclared variable warnings. 81 + # shellcheck disable=2154 82 + { 83 + mod bg "$2" / 4 84 + mod fg "$2" + 150 85 + mod co "$bg" + 125 86 + 87 + set -- "$bg" "$@" "$fg" "$co" "$@" "$fg" 88 + } 89 + 90 + printf '%s\n' "$@" | paleta & 91 + printf '%s\n' "$@" > "$cache_dir/$cache_file" 92 + fi 93 + } 94 + 95 + main() { 96 + mkdir -p "${cache_dir:=${XDG_CACHE_HOME:=${HOME}/.cache}/bud}" 97 + 98 + img "$1" 99 + 100 + display \ 101 + -page 3200x \ 102 + -sample 3200x \ 103 + -window root \ 104 + "$img" & 105 + 106 + col & 107 + } 108 + 109 + main "$1"
+2
bin/n
··· 1 1 #!/bin/sh 2 + # 3 + # Open notes file & take notes 2 4 3 5 notefile="$HOME/sync/notes.md" 4 6 printf '\n' >> "$notefile"
+13
bin/scr
··· 1 + #!/bin/sh 2 + # 3 + # Take a screenshot 4 + 5 + scr_dir=~/pix/screenshots 6 + 7 + date=$(date +%F) 8 + time=$(date +%I-%M-%S) 9 + file=$scr_dir/$date/$date-$time.jpg 10 + 11 + mkdir -p "$scr_dir/$date" 12 + import -window root "$file" 13 + cp -f "$file" "$scr_dir/current.jpg"
+1 -1
bin/xdg-open
··· 1 1 #!/bin/sh 2 2 case "${1%%:*}" in 3 3 http|https|*.pdf) 4 - exec qutebrowser "$1" 4 + exec firefox "$1" 5 5 ;; 6 6 mailto) 7 7 exec aerc "$1"