summaryrefslogtreecommitdiff
path: root/bin/extra
diff options
context:
space:
mode:
Diffstat (limited to 'bin/extra')
-rwxr-xr-xbin/extra/confirm4
-rwxr-xr-xbin/extra/gml33
-rwxr-xr-xbin/extra/pomo31
-rwxr-xr-xbin/extra/setip16
4 files changed, 36 insertions, 48 deletions
diff --git a/bin/extra/confirm b/bin/extra/confirm
index 116b468..630d701 100755
--- a/bin/extra/confirm
+++ b/bin/extra/confirm
@@ -5,8 +5,8 @@ read_char ()
old_stty_cfg=$(stty -g 2> /dev/null)
stty raw -echo 2> /dev/null
dd ibs=1 count=1 2> /dev/null
- stty $old_stty_cfg 2> /dev/null
+ stty "$old_stty_cfg" 2> /dev/null
}
->&2 printf "$1 "
+>&2 printf "%s " "$1"
read_char | grep -q "[yY]"
diff --git a/bin/extra/gml b/bin/extra/gml
index 0f2f143..f8d6b7e 100755
--- a/bin/extra/gml
+++ b/bin/extra/gml
@@ -32,14 +32,14 @@ minecraft()
-mindepth 1 -maxdepth 1 \
-type d \
-printf "%f\n"
- ) | commander -d -c -s)"
+ ) | commander -d -c -s)"
- [ -z "$world" ] && exit 1
+ [ -z "$world" ] && exit 1
- if [ "$world" = 'none' ]
- then setsid multimc -l "$instance" > /dev/null 2>&1
- else setsid multimc -l "$instance" -w "$world" > /dev/null 2>&1
- fi
+ if [ "$world" = 'none' ]
+ then setsid multimc -l "$instance" > /dev/null 2>&1
+ else setsid multimc -l "$instance" -w "$world" > /dev/null 2>&1
+ fi
fi
}
@@ -47,24 +47,27 @@ minecraft()
steam()
{
choice="$(
- cat <<-EOF | column -t -l 2 | commander -d -x -c | awk '{printf $1}'
- 274190 broforce
- 291550 brawlhalla
- 1712840 tiny tina
- 105600 terraria
- kill
-EOF
- )"
+ cat <<-EOF |
+ 274190 broforce
+ 291550 brawlhalla
+ 1712840 tiny tina
+ 105600 terraria
+ kill
+ EOF
+ column -t -l 2 | commander -d -x -c | awk '{printf $1}')"
+
case "$choice" in
kill) pkill steam ;;
+ "") ;;
*) setsid steam steam://rungameid/"$choice" ;;
esac
exit
}
eval "$(
- cat <<-EOF | commander -c -w 9 -y 2
+ cat <<-EOF | commander -c -w 9 -y 3
minecraft
steam
+ lutris
EOF
)"
diff --git a/bin/extra/pomo b/bin/extra/pomo
deleted file mode 100755
index a2c371d..0000000
--- a/bin/extra/pomo
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-notif() { notify-send -t 1000 -w "pomo" "$1"; }
-
-for msg in "three" "two" "one"
-do notif "$msg"
-done
-
-# $1: time in minutes
-# $2: msg for notification
-ring_ring()
-{
- date '+%R B'
- notify-send -w "$(($1*1000*60))" -u critical "pomo" "$2"
-}
-
-i="${1-0}"
-while true
-
-do
- notif "<b>START</b>"
- date '+%R S'
- sleep 20m
- if [ "$i" -eq 3 ]
- then
- i=0
- ring_ring 20 "GIGA BREAK TIME"
- else
- ring_ring 5 "BREAK TIME"
- i=$((i+1))
- fi
-done
diff --git a/bin/extra/setip b/bin/extra/setip
new file mode 100755
index 0000000..b10e7cc
--- /dev/null
+++ b/bin/extra/setip
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+ips="192.168.178.79 192.168.178.52 10.7.0.1 none"
+
+for ip in $ips
+do ping -i .2 -c 1 "$ip" > /dev/null 2>&1 && break
+done
+
+if [ "$ip" = "none" ]
+then
+ >&2 printf 'No ip.\n'
+ exit 1
+fi
+
+sed -i "/Host db/,/^$/s/.*HostName.*/\tHostname $ip/" "$HOME"/.ssh/config
+>&2 printf 'Done: %s \n' "$ip"