~mil/f_scripts

f_scripts/scripts/f_maps -rwxr-xr-x 864 bytes
4d320ea0Miles Alan All scripts: unset strict_errexit to resolve regression with oil 0.11 25 days 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
27
28
29
#!/usr/bin/env osh
shopt -s strict:all; shopt --unset strict_errexit
DEP="mepo tslib directfb mesa-gl kbd vis"
DEC="Browse OSM maps using mepo (via SDL directfb)."
DOC="
  Launches mepo to browse OSM maps in SDL / directfb mode.  Uses chvt
  and vis-menu to present menus as needed via mepo's helper menu script.
"

runmepo() {
  export SDL_VIDEODRIVER=directfb
  export DFBARGS="system=fbdev,no-cursor,disable-module=linux_input,no-vt-switch,bg-none"
  INPUTDEV="$(ts_uinput -d -v)"
  export TSLIB_TSDEVICE="$INPUTDEV"
  ts_calibrate

  OPTS="$(mepo_ui_central_menu.sh menuoptions | cut -d^ -f3 | sort | tr -d " ")"

  [ -p /tmp/fbp.fifo ] && { echo -e "\b\f\e"; echo -e "c\n$OPTS"; } > /tmp/fbp.fifo
  mepo

  [ -p /tmp/fbp.fifo ] && echo -e "\v" > /tmp/fbp.fifo
}

main() {
  sudo USER=$USER "$(realpath $0)" runmepo
}

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