~mil/f_scripts

ref: 4d320ea002e135fefd7070024fed466f6f8d8d08 f_scripts/scripts/f_game -rwxr-xr-x 636 bytes
4d320ea0Miles Alan All scripts: unset strict_errexit to resolve regression with oil 0.11 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env osh
shopt -s strict:all; shopt --unset strict_errexit
DEP="moon-buggy"
DEC="Play classic console games"
DOC="
  Launches classic console games with keybindings set in fbp.
  Currently supports only the game: moon-buggy!
"

moonbuggy() {
  [ -p /tmp/fbp.fifo ] && { echo -e "\b\f\e"; echo "j a q r y" | tr " " "\n"; } > /tmp/fbp.fifo
  moon-buggy
}

main() {
  local RUN CHOICES
  CHOICES="moonbuggy"
  while true; do
    clear
    [ -p /tmp/fbp.fifo ] && { echo -e "\b\f\r"; echo "$CHOICES" | tr " " "\n"; } > /tmp/fbp.fifo
    read -p "Run ($CHOICES): " RUN
    "$RUN"
  done
}

if [ -n "$1" ]; then "$@"; else main; fi