alexozer / flitter

A LiveSplit-inspired speedrunning split timer for Linux/macOS terminal. Supports global hotkeys.
MIT License
132 stars 11 forks source link

After getting around some installation issues on macOS, no response to global hotkeys. #19

Closed slackwing closed 3 days ago

slackwing commented 4 years ago

I'm on macOS High Sierra 10.13.6 and encountered the same issues as @slashinfty in #15, but got past them. However, the application does not respond to any of the global hotkeys.


First though, it should be mentioned that at first I skipped opam switch 4.07.0 because it asked if I meant opam switch create 4.07.0 instead. I figured I'd take my chances with the newer version I had installed (4.09.x) than do something that seemed semantically different. Later in a second attempt I came back to try opam switch create 4.07.0.

Either way, on dune build I got the message about uuseg, lwt_ppx, and uutf being missing. (And one of the hints has a typo, saying to install uuset instead of uuseg.) After installing these, in my first attempt with 4.09.x I got the same as @slashinfty, about pp_set_formatter_tag_functions being deprecated. But on my second attempt with 4.07.0, I had less errors, only this:

$ dune build
File "_none_", line 1:
Warning 58: no cmx file was found in path for module Toploop, and its interface was not compiled with -opaque
File "vendor/notty/lwt/notty_lwt.ml", line 68, characters 25-64:
Error: This expression has type (unit -> unit) Lwt.t
       but an expression was expected of type unit Lwt.t
       Hint: Did you forget to provide `()' as argument?

Opening up vendor/notty/lwt/notty_lwt.ml and changing

Lwt.async (fun () -> Lwt_stream.closed stream >|= fun _ -> f);

to

Lwt.async (fun () -> Lwt_stream.closed stream >|= fun _ -> f ());

fixed this for me, despite warnings. I was then able to dune install and run flitter examples/my-splits.scm:

image

Unfortunately, none of the global hotkeys do anything, whether or not the terminal is focused.

If the author would like to pair on solving this issue for macOS, happy to offer my time in exchange for guidance. @alexozer

slackwing commented 4 years ago

Additionally I seem unable to ^z or ^c out of the application. Not sure if that's normal or not.

Anyway, let's see if fixing some of the warnings solves the issue:

11:22 $ dune build
File "_none_", line 1:
Warning 58: no cmx file was found in path for module Toploop, and its interface was not compiled with -opaque
File "vendor/notty/lwt/notty_lwt.ml", line 131, characters 6-24:
Warning 3: deprecated: module Lwt_sequence
 Use package lwt-dllist. See
   https://github.com/mirage/lwt-dllist
File "vendor/notty/lwt/notty_lwt.ml", line 131, characters 47-66:
Warning 3: deprecated: Lwt_main.exit_hooks
 Use module Lwt_main.Exit_hooks.
File "vendor/notty/lwt/notty_lwt.ml", line 131, characters 6-24:
Warning 3: deprecated: module Lwt_sequence
 Use package lwt-dllist. See
   https://github.com/mirage/lwt-dllist
File "vendor/notty/lwt/notty_lwt.ml", line 131, characters 47-66:
Warning 3: deprecated: Lwt_main.exit_hooks
 Use module Lwt_main.Exit_hooks.

Changing Lwt_main.exit_hooks to Lwt_main.Exit_hooks results in

11:25 $ dune build
File "vendor/notty/lwt/notty_lwt.ml", line 131, characters 6-24:
Warning 3: deprecated: module Lwt_sequence
 Use package lwt-dllist. See
   https://github.com/mirage/lwt-dllist
File "vendor/notty/lwt/notty_lwt.ml", line 131, characters 47-66:
Error: Unbound constructor Lwt_main.Exit_hooks

and I'm not sure what to do about that. It seems the version of lwt is quite old though, so maybe I will try using a more recent version.

slackwing commented 4 years ago

Saw @OlivierBlanvillain's PR #17 and decided to give it a shot.

  1. Updated url in .gitmodules as directed in #17.
  2. Undid my changes in vendor/notty by going to vendor/notty and doing git reset --hard.
  3. Went back to flitter dir and updated submodules with git submodule update --init --recursive --remote.
  4. dune build

Now seeing

11:43 $ dune build
File "_none_", line 1:
Warning 58: no cmx file was found in path for module Toploop, and its interface was not compiled with -opaque
File "src/big.ml", line 49, characters 49-64:
Error: This expression has type image but an expression was expected of type
         Uchar.t array -> 'a
File "src/display.ml", line 28, characters 34-45:
Error: The function applied to this argument has type ?attr:attr -> image
This argument cannot be applied without label

I suspect now I'm too far ahead in versions with Notty.

alexozer commented 3 years ago

Try building again with 666c5483bc93efa6d01e0b7a927461269f8e14de.

l0go commented 3 years ago

Hi, I am able to build, but I also have no response to global hotkeys.

alexozer commented 3 days ago

I rewrote Flitter from scratch, and this is no longer an issue