aboutsummaryrefslogtreecommitdiff
path: root/env/.local/bin/scripts
diff options
context:
space:
mode:
authoriceyrazor <iceyrazor@mailfence.com>2025-10-17 18:31:32 -0500
committericeyrazor <iceyrazor@mailfence.com>2025-10-17 18:31:32 -0500
commitfe74ef66ee5882495e00bae731c8e299811c7c1d (patch)
treec33ce3e4c6b456ca532a0284f6138f64d1db303f /env/.local/bin/scripts
parent62ba4da27df06a91fa75ef08cfa69fba4c82a72e (diff)
Squashed commit of the following:
- rofi kaomoji-picker.sh and keybind in i3 - rofi edit for vimish motions - indent change - swapped tmux keys - echo port on auto port - added proxy ignore to newsboat autofetch - added xorg-xwayland - autoport mc script using socat - removed /dev from cam alias
Diffstat (limited to 'env/.local/bin/scripts')
-rwxr-xr-xenv/.local/bin/scripts/autoport_mc.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/env/.local/bin/scripts/autoport_mc.sh b/env/.local/bin/scripts/autoport_mc.sh
new file mode 100755
index 0000000..8ccf0b0
--- /dev/null
+++ b/env/.local/bin/scripts/autoport_mc.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# this finds the log file from a picked instance using rofi. then fords traffic thorugh 25565
+if [ -z "$LOG_FILE" ]; then
+ choice="$HOME/stuff/minecraft/polymc/instances/$(ls ~/stuff/minecraft/polymc/instances | rofi -dmenu -p "Instance")"
+ LOG_FILE="$(find "$choice" -mindepth 1 -maxdepth 1 -type d | grep "minecraft$")/logs/latest.log"
+fi
+
+setport="$(cat "$LOG_FILE" | grep "Started on" | sed 's/.*Started on //' | tail -n 1)"
+echo $setport
+if [ "$setport" ]; then
+ doas socat TCP6-LISTEN:25565,fork TCP4:127.0.0.1:$setport
+fi