asmagill / hammerspoon_asm.undocumented

Hammerspoon and Mjolnir modules utilizing undocumented APIs
MIT License
50 stars 6 forks source link

Trouble Compiling #3

Closed raguay closed 8 years ago

raguay commented 9 years ago

Hi,

I just downloaded these modules to use with my Hammerspoon install. But, I can not get them to compile. I also use lua installed by homebrew. This is what I did and the results:

PREFIX="/usr/local/Cellar/lua/5.2.4_1/" TARGET="Hammerspoon" make install

rm -v -fr init.lua internal.m Makefile.Hammerspoon Hammerspoon Makefile.Mjolnir Mjolnir init.lua internal.m Makefile.Hammerspoon sed -e 's/{MODULE}/raguay spaces/g' \ -e 's/{PATH}/hs._asm.undocumented/g' \ template.lua > init.lua sed -e 's/{TARGET}/Hammerspoon/g' \ -e 's/{MODULE}/raguay spaces/g' \ -e 's/{PATH}/hs._asm.undocumented/g' \ template.m > internal.m sed -e 's/{MODULE}/raguay spaces/g' \ -e 's/{SOFILE}/internal-raguay spaces.so/g' \ -e 's/{PREFIX}//usr/local/Cellar/lua/5.2.4_1//g' \ Makefile.template > Makefile.Hammerspoon sed: 1: "s/{PREFIX}//usr/local/C ...": bad flag in substitute command: 'u' make: *\ [Makefile.Hammerspoon] Error 1

asmagill commented 9 years ago

The makefile does some substitutions in the actual source files trying to make a single set of install files compatible with both Mjolnir and Hammerspoon... It makes some assumptions about the current directory name, specifically that it is the end point of the module name (i.e. in this case "spaces")... From the output above, I'm guessing you renamed the directory "raguay spaces"... I'm not sure what effect this would have on the process.

Try renaming the containing directory to just "spaces" or change line 2 of the Makefile, which reads as current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path)))) to read current_dir := spaces.

When I get a chance, I'll clean these up and separate Mjolnir and Hammerspoon builds completely... maintaining compatibility has been the source of most of my problems with these.

asmagill commented 9 years ago

Check it out now. A precompiled version is also available.

raguay commented 9 years ago

Hi, I got it downloaded and many of the functions work except for moving to spaces. The hotkeys to move spaces just moves from one side to the other side of the screen. The dots at the bottom show one per screen, but just makes a sound when clicked (error sound). The console doesn't show anything. But, I am running 10.11.2 beta 3. It just loaded today.

Are you going to make a pre-compiled of the other _asm modules? I would like to try your menu items as well. I am using your code to really learn Lua and how Hammerspoon works in more details. Thanks!

asmagill commented 9 years ago

That's been a known problem with that function... that specific code is more or less identical to code that was used 2 forks back of Hammerspoon and most users were running OS X 10.8 or 10.9 at the time... It's a little better if you uncheck "Displays Have Separate Spaces" in Mission Control, but not much... I should probably add that to the documentation.

Some progress has been made with workarounds using hs.eventtap. Check https://github.com/Hammerspoon/hammerspoon/issues/581 and https://github.com/Hammerspoon/hammerspoon/issues/235 for examples. It's also why I added the animating function -- to remove at least the usleep before release the events.

asmagill commented 8 years ago

If you missed my posting to the Hammerspoon Google group, it seems that issuing hs.execute("killall Dock") after the change seems to fix the problems with the spaces module.

However, check out the repository now -- a lot has been changed and added to spaces.

As for my other modules, I am in the process of slowly reorganizing them and plan to add downloadable releases as I do.