summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-26 23:35:21 -0700
committerFuwn <[email protected]>2024-06-26 23:35:21 -0700
commit67cce55b6ebca007131b65164465e90c0aab0f44 (patch)
tree11162beeb705c4e1d47192c723703824f16575a3 /home
parentchanges (diff)
downloadhome-manager-config-67cce55b6ebca007131b65164465e90c0aab0f44.tar.xz
home-manager-config-67cce55b6ebca007131b65164465e90c0aab0f44.zip
changes
Diffstat (limited to 'home')
-rw-r--r--home/fuwn/meta/scripts/scripts/.gitignore6
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/altserver3
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/anidub2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/anime2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/apod2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/catboy2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/chan22
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/fim6
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/gmiwatch24
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/hon2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/locs102
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/reco2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/shiori2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/skyla2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/start-vm3
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/wal_mako2
-rwxr-xr-xhome/fuwn/meta/scripts/scripts/worlds15
17 files changed, 177 insertions, 2 deletions
diff --git a/home/fuwn/meta/scripts/scripts/.gitignore b/home/fuwn/meta/scripts/scripts/.gitignore
index bc90cf1..2ea4e67 100644
--- a/home/fuwn/meta/scripts/scripts/.gitignore
+++ b/home/fuwn/meta/scripts/scripts/.gitignore
@@ -1,4 +1,8 @@
know
hime
mirrors
-pok \ No newline at end of file
+pok
+bt
+counter
+rinny
+suzuri \ No newline at end of file
diff --git a/home/fuwn/meta/scripts/scripts/altserver b/home/fuwn/meta/scripts/scripts/altserver
index 732a973..0a0d5f9 100755
--- a/home/fuwn/meta/scripts/scripts/altserver
+++ b/home/fuwn/meta/scripts/scripts/altserver
@@ -1,3 +1,5 @@
+# Wrapper around AltServer for usage on *nix
+
# doas usbmuxd &
# export USBMUXD_SOCKET_ADDRESS=127.0.0.1:27015
@@ -6,4 +8,5 @@
docker run -d -v lib_cache:/opt/lib/ --restart=always -p 6969:6969 --name anisette dadoum/anisette-server:latest
+# Not very Nix ....
ALTSERVER_ANISETTE_SERVER=http://127.0.0.1:6969 python3 ~/.local/src/AltServer-Linux/main.py
diff --git a/home/fuwn/meta/scripts/scripts/anidub b/home/fuwn/meta/scripts/scripts/anidub
index 7a581b1..aacf84f 100755
--- a/home/fuwn/meta/scripts/scripts/anidub
+++ b/home/fuwn/meta/scripts/scripts/anidub
@@ -1 +1,3 @@
+# Wrapper around ani-cli (dubbed) for Rofi
+
ANI_CLI_PLAYER=clapper ani-cli --dub --rofi "${1}"
diff --git a/home/fuwn/meta/scripts/scripts/anime b/home/fuwn/meta/scripts/scripts/anime
index 73e9f4f..60b143b 100755
--- a/home/fuwn/meta/scripts/scripts/anime
+++ b/home/fuwn/meta/scripts/scripts/anime
@@ -1 +1,3 @@
+# Wrapper around ani-cli for Rofi
+
ANI_CLI_PLAYER=mpv ani-cli --rofi "${1}"
diff --git a/home/fuwn/meta/scripts/scripts/apod b/home/fuwn/meta/scripts/scripts/apod
index f0f38cd..a8814a9 100755
--- a/home/fuwn/meta/scripts/scripts/apod
+++ b/home/fuwn/meta/scripts/scripts/apod
@@ -1,3 +1,5 @@
+# Get today's Astronomy Picture of the Day (APOD) from NASA
+
printf \
"https://apod.nasa.gov/apod/%s\\n" \
"$(curl --silent "https://apod.nasa.gov/apod/" |
diff --git a/home/fuwn/meta/scripts/scripts/catboy b/home/fuwn/meta/scripts/scripts/catboy
index d94c233..cc75e52 100755
--- a/home/fuwn/meta/scripts/scripts/catboy
+++ b/home/fuwn/meta/scripts/scripts/catboy
@@ -1,3 +1,5 @@
+# VPN wrapper around catgirl
+
vpn_ip="$(piactl get vpnip)"
BIND_INTERFACE=wgpia0 \
diff --git a/home/fuwn/meta/scripts/scripts/chan2 b/home/fuwn/meta/scripts/scripts/chan2
index 9145fd8..525d5f1 100755
--- a/home/fuwn/meta/scripts/scripts/chan2
+++ b/home/fuwn/meta/scripts/scripts/chan2
@@ -1 +1,3 @@
+# Tiny wrapper around chan-downloader
+
chan-downloader -c 10 --thread "${1}" -o "${2}"
diff --git a/home/fuwn/meta/scripts/scripts/fim b/home/fuwn/meta/scripts/scripts/fim
new file mode 100755
index 0000000..ad21cd4
--- /dev/null
+++ b/home/fuwn/meta/scripts/scripts/fim
@@ -0,0 +1,6 @@
+# Finger "blog" updater
+
+HOST="sina"
+PROFILE="/var/lib/docker/volumes/gigi-data/_data/${1:-fuwn}"
+
+ssh -t "${HOST}" "vim -c 'autocmd BufWritePost * !fmt -w 80 % > %.tmp && mv %.tmp %' '${PROFILE}'"
diff --git a/home/fuwn/meta/scripts/scripts/gmiwatch b/home/fuwn/meta/scripts/scripts/gmiwatch
new file mode 100755
index 0000000..cf3e52a
--- /dev/null
+++ b/home/fuwn/meta/scripts/scripts/gmiwatch
@@ -0,0 +1,24 @@
+# Gemini capsule watcher, used for development
+
+usage() {
+ echo "usage: ${0} [-n interval] <url>"
+
+ exit 1
+}
+
+while getopts "n:" opt; do
+ case ${opt} in
+ n)
+ interval=${OPTARG}
+
+ shift 2
+ ;;
+ *) usage ;;
+ esac
+done
+
+if [ -z "${1}" ]; then
+ usage
+fi
+
+watch -n "${interval:-5}" -t gmni -j always "gemini://${1}"
diff --git a/home/fuwn/meta/scripts/scripts/hon b/home/fuwn/meta/scripts/scripts/hon
index d0bd2ad..b4436ec 100755
--- a/home/fuwn/meta/scripts/scripts/hon
+++ b/home/fuwn/meta/scripts/scripts/hon
@@ -1,3 +1,5 @@
+# Personal manga feed wrapper around Suzuri
+
SUZURI_MINIMAL=1 \
SUZURI_REVERSE=1 \
suzuri \
diff --git a/home/fuwn/meta/scripts/scripts/locs b/home/fuwn/meta/scripts/scripts/locs
new file mode 100755
index 0000000..7b0ea19
--- /dev/null
+++ b/home/fuwn/meta/scripts/scripts/locs
@@ -0,0 +1,102 @@
+# Silly lines-of-code counter
+
+DEFAULT_COMMENT_STYLES='(//|#|/\*|\*|<!--|-->)'
+FILE_MAX_LENGTH=5
+
+count_non_empty_lines() {
+ local file="${1}"
+ grep -cve '^\s*$' "${file}"
+}
+
+process_files() {
+ for file in "$@"; do
+ if [ -f "${file}" ]; then
+ if [ ${#file} -gt "${longest_filename}" ]; then
+ longest_filename=${#file}
+ fi
+ fi
+ done
+
+ for file in "$@"; do
+ if [ -f "${file}" ]; then
+ lines=$(count_non_empty_lines "${file}")
+ total_lines=$((total_lines + lines))
+
+ case "${file}" in
+ *.gleam) COMMENT_STYLE='(//)' ;;
+ *.cc | *.hh | *.cpp | *.hpp | *.c | *.h) COMMENT_STYLE='(//|/\*)' ;;
+ *) COMMENT_STYLE=${DEFAULT_COMMENT_STYLES} ;;
+ esac
+
+ comments=$(grep -E "^\s*${COMMENT_STYLE}\s*.*\s*$" "${file}" | grep -v '^\s*$' | wc -l)
+ total_comments=$((total_comments + comments))
+
+ printf "%-${longest_filename}s %-${FILE_MAX_LENGTH}s %s\n" "${file}" "$((lines - comments))" "${comments}"
+
+ if [ "${LOCS_PRINT_COMMENTS:-0}" = 1 ]; then
+ grep -n -E "^\s*${COMMENT_STYLE}\s*.*\s*$" "${file}" | grep -v '^\s*$' | sed 's/^/ /' | sed 's/\s*\/\///' | sed 's/\([0-9]\+\): /\1 | /'
+
+ if [ "${comments}" -gt 0 ]; then
+ echo
+ fi
+ fi
+ fi
+ done
+}
+
+main() {
+ local total_lines=0
+ local total_comments=0
+ local longest_filename=0
+
+ if [ -z "$1" ]; then
+ cat <<EOF
+usage: ${0} <glob_pattern>
+
+⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢲⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
+⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
+⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠄⠂⢉⠤⠐⠋⠈⠡⡈⠉⠐⠠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
+⠀⠀⠀⠀⢀⡀⢠⣤⠔⠁⢀⠀⠀⠀⠀⠀⠀⠀⠈⢢⠀⠀⠈⠱⡤⣤⠄⣀⠀⠀⠀⠀⠀
+⠀⠀⠰⠁⠀⣰⣿⠃⠀⢠⠃⢸⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠈⢞⣦⡀⠈⡇⠀⠀⠀
+⠀⠀⠀⢇⣠⡿⠁⠀⢀⡃⠀⣈⠀⠀⠀⠀⢰⡀⠀⠀⠀⠀⢢⠰⠀⠀⢺⣧⢰⠀⠀⠀⠀
+⠀⠀⠀⠈⣿⠁⡘⠀⡌⡇⠀⡿⠸⠀⠀⠀⠈⡕⡄⠀⠐⡀⠈⠀⢃⠀⠀⠾⠇⠀⠀⠀⠀
+⠀⠀⠀⠀⠇⡇⠃⢠⠀⠶⡀⡇⢃⠡⡀⠀⠀⠡⠈⢂⡀⢁⠀⡁⠸⠀⡆⠘⡀⠀⠀⠀⠀
+⠀⠀⠀⠸⠀⢸⠀⠘⡜⠀⣑⢴⣀⠑⠯⡂⠄⣀⣣⢀⣈⢺⡜⢣⠀⡆⡇⠀⢣⠀⠀⠀⠀
+⠀⠀⠀⠇⠀⢸⠀⡗⣰⡿⡻⠿⡳⡅⠀⠀⠀⠀⠈⡵⠿⠿⡻⣷⡡⡇⡇⠀⢸⣇⠀⠀⠀
+⠀⠀⢰⠀⠀⡆⡄⣧⡏⠸⢠⢲⢸⠁⠀⠀⠀⠀⠐⢙⢰⠂⢡⠘⣇⡇⠃⠀⠀⢹⡄⠀⠀
+⠀⠀⠟⠀⠀⢰⢁⡇⠇⠰⣀⢁⡜⠀⠀⠀⠀⠀⠀⠘⣀⣁⠌⠀⠃⠰⠀⠀⠀⠈⠰⠀⠀
+⠀⡘⠀⠀⠀⠀⢊⣤⠀⠀⠤⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠤⠄⠀⢸⠃⠀⠀⠀⠀⠀⠃⠀
+⢠⠁⢀⠀⠀⠀⠈⢿⡀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⢀⠏⠀⠀⠀⠀⠀⠀⠸⠀
+⠘⠸⠘⡀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠁⠀⠃⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⢠⠀⠀⡇
+⠀⠇⢆⢃⠀⠀⠀⠀⠀⡏⢲⢤⢀⡀⠀⠀⠀⠀⠀⢀⣠⠄⡚⠀⠀⠀⠀⠀⠀⣾⠀⠀⠀
+⢰⠈⢌⢎⢆⠀⠀⠀⠀⠁⣌⠆⡰⡁⠉⠉⠀⠉⠁⡱⡘⡼⠇⠀⠀⠀⠀⢀⢬⠃⢠⠀⡆
+⠀⢢⠀⠑⢵⣧⡀⠀⠀⡿⠳⠂⠉⠀⠀⠀⠀⠀⠀⠀⠁⢺⡀⠀⠀⢀⢠⣮⠃⢀⠆⡰⠀
+⠀⠀⠑⠄⣀⠙⡭⠢⢀⡀⠀⠁⠄⣀⣀⠀⢀⣀⣀⣀⡠⠂⢃⡀⠔⠱⡞⢁⠄⣁⠔⠁⠀
+⠀⠀⠀⠀⠀⢠⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠉⠁⠀⠀⠀⠀
+⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀
+
+EOF
+
+ exit 1
+ fi
+
+ local files
+
+ files=$(find "${@}" -type f)
+
+ process_files ${files} >/tmp/lines
+
+ if [ "${LOCS_HEADER:-1}" = 1 ]; then
+ printf "%-${longest_filename}s %-${FILE_MAX_LENGTH}s %s\n" "filename" "lines" "comments"
+ fi
+
+ if [ "${LOCS_PRINT_COMMENTS:-0}" = 1 ] || [ "${LOCS_SORT:-1}" = 0 ]; then
+ cat /tmp/lines
+ else
+ sort -k2nr </tmp/lines
+ fi
+
+ printf "%-${longest_filename}s %-${FILE_MAX_LENGTH}s %s\n" "total" "$((total_lines - total_comments))" "${total_comments}"
+}
+
+main "$@"
diff --git a/home/fuwn/meta/scripts/scripts/reco b/home/fuwn/meta/scripts/scripts/reco
index 0aba038..9402a1a 100755
--- a/home/fuwn/meta/scripts/scripts/reco
+++ b/home/fuwn/meta/scripts/scripts/reco
@@ -1,3 +1,5 @@
+# COBOL line number incrementer
+
if [ "$#" -lt 1 ]; then
echo "usage: $0 [-i x] filename"
diff --git a/home/fuwn/meta/scripts/scripts/shiori b/home/fuwn/meta/scripts/scripts/shiori
index 7430745..5f825e7 100755
--- a/home/fuwn/meta/scripts/scripts/shiori
+++ b/home/fuwn/meta/scripts/scripts/shiori
@@ -1,3 +1,5 @@
+# Random ASCII art
+
# https://zh.moegirl.org.cn/Shift_JIS%E8%89%BA%E6%9C%AF
art=()
diff --git a/home/fuwn/meta/scripts/scripts/skyla b/home/fuwn/meta/scripts/scripts/skyla
index 2434f08..a0d9030 100755
--- a/home/fuwn/meta/scripts/scripts/skyla
+++ b/home/fuwn/meta/scripts/scripts/skyla
@@ -1,3 +1,5 @@
+# yt-dlp wrapper for Crunchyroll
+
if [[ "$2" = "dl" ]]; then
START=$(date +%s)
diff --git a/home/fuwn/meta/scripts/scripts/start-vm b/home/fuwn/meta/scripts/scripts/start-vm
index db67cc6..df372c1 100755
--- a/home/fuwn/meta/scripts/scripts/start-vm
+++ b/home/fuwn/meta/scripts/scripts/start-vm
@@ -1,5 +1,6 @@
-# ref: https://askubuntu.com/questions/425754/how-do-i-run-a-sudo-command-inside-a-script
+# Virtual machine start script
+# ref: https://askubuntu.com/questions/425754/how-do-i-run-a-sudo-command-inside-a-script
USER_ID=$(id -u)
# ref: https://askubuntu.com/a/30157/8698
diff --git a/home/fuwn/meta/scripts/scripts/wal_mako b/home/fuwn/meta/scripts/scripts/wal_mako
index 757cd5d..5cf4b1f 100755
--- a/home/fuwn/meta/scripts/scripts/wal_mako
+++ b/home/fuwn/meta/scripts/scripts/wal_mako
@@ -1,3 +1,5 @@
+# Mako colourscheme setter for use with pywal
+
MAKO_CTL="/usr/bin/makoctl"
MAKO_CONFIG="${HOME}/.config/mako/config"
MAKO_CONFIG_TEMPLATE="${MAKO_CONFIG}.template"
diff --git a/home/fuwn/meta/scripts/scripts/worlds b/home/fuwn/meta/scripts/scripts/worlds
new file mode 100755
index 0000000..834079a
--- /dev/null
+++ b/home/fuwn/meta/scripts/scripts/worlds
@@ -0,0 +1,15 @@
+# WorldsPlayer runner for use in Bottles
+
+NAMESPACE=worlds
+
+# kitty -e doas termshark -i worlds_vo &
+wireshark -k -i "${NAMESPACE}_vo" &
+
+doas runnet \
+ --publish-all-ports \
+ --user=fuwn \
+ --netns=${NAMESPACE} \
+ --internet \
+ bottles-cli run \
+ -p WorldsPlayer \
+ -b 'WorldsPlayer'