====== my most used local scripts ======
in ''~/.local/bin'' usually. also in my [[https://bytes.4-walls.net/kat/dotfiles/src/branch/main/config/.local/bin|dotfiles]]. sometimes from my ''.bashrc'' file.
==== whatip ====
get my internal & external IP address. results are piped to lolcat because i like cute things ok
# print internal & external IPs
whatip() {
# internal
echo -n "internal IP: " | lolcat -p 0.7; hostname -I | awk '{print $1}'
# external
echo -n "external IP: " | lolcat -p 0.7; curl -4 icanhazip.com
}
==== notif ====
used after long-running programs like ''watch'' or ''dig'' because i will easily forget about something i'm waiting on like that.
# to get quick notifs
# after long commands
notif() {
notify-send "done!"
aplay -q /usr/share/sounds/sound-icons/start
spd-say -t female3 -r +25 "done!"
}
==== mvpn ====
launch applications excluded from current and future VPN sessions (until window is closed).
i have this aliased to ''mterm'' and ''mftp'', respectively, to launch a terminal or filezilla window with this script.
#!/bin/bash
nohup mullvad-exclude $1 > /dev/null 2>&1 &
==== resize img ====
this is for when i use [[https://syncthing.net/|syncthing]] to transfer camera photos from my phone to my computer, then need to resize them for easier sharing
#!/bin/bash
WORKDIR=$(pwd)
TMPDIR="/home/kat/Pictures/Camera/tmp-resize"
cd ${WORKDIR}
for f in *.jpg; do mv $f ${TMPDIR}; done
cd ${TMPDIR} && magick -size 3000x4000 *.jpg -resize 40% "../${f%.*}-resized.jpg" && rm -rf *.jpg