agzam / spacehammer Goto Github PK
View Code? Open in Web Editor NEWHammerspoon config inspired by Spacemacs
License: MIT License
Hammerspoon config inspired by Spacemacs
License: MIT License
After updating to hammerspoon 0.9.80 spacehammer fails to load, have tried both with my configuration and the default one. I get the following error message:
2020-09-22 13:54:37: -- Loading ~/.hammerspoon/init.lua
2020-09-22 13:54:37: -- Loading extension: alert
2020-09-22 13:54:37: *** ERROR: ...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: module 'fennel' not found:
no field package.preload['fennel']
no file '/Users/mattias/.hammerspoon/fennel.lua'
no file '/Users/mattias/.hammerspoon/fennel/init.lua'
no file '/Users/mattias/.hammerspoon/Spoons/fennel.spoon/init.lua'
no file '/usr/local/share/lua/5.4/fennel.lua'
no file '/usr/local/share/lua/5.4/fennel/init.lua'
no file '/usr/local/lib/lua/5.4/fennel.lua'
no file '/usr/local/lib/lua/5.4/fennel/init.lua'
no file './fennel.lua'
no file './fennel/init.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel/init.lua'
no file '/Users/mattias/.luarocks/share/lua/5.4/fennel.lua'
no file '/Users/mattias/.luarocks/share/lua/5.4/fennel/init.lua'
no file '/Users/mattias/.luarocks/share/lua/5.3/fennel.lua'
no file '/Users/mattias/.luarocks/share/lua/5.3/fennel/init.lua'
no file '/Users/mattias/.hammerspoon/fennel.so'
no file '/usr/local/lib/lua/5.4/fennel.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './fennel.so'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel.so'
no file '/Users/mattias/.luarocks/lib/lua/5.4/fennel.so'
no file '/Users/mattias/.luarocks/lib/lua/5.3/fennel.so'
stack traceback:
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: in function 'require'
/Users/mattias/.hammerspoon/init.lua:22: in main chunk
[C]: in function 'xpcall'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:702: in function 'hs._coresetup.setup'
(...tail calls...)
Downgrading to 0.9.78 solves the issue. Have tried to reinstall luarocks and fennel with brew but that doesn't help.
I'm not sure if this is something that's broken on my machine or if it's a bug somewhere, any assistance to figure this out is appreciated!
When a modal is active other keys (that have no dedicated action) should be disabled
I love this product. Thanks for building this!
It will be great if there is a new mode with basic VIM normal mode keybindings.
Let's call it VIM mode.
Once user is in this mode, we can initially have 'hjkl' mapped to respective arrow keys.
For Example, If I press 'h' key when this mode is enabled, right arrow key should be triggered.
After 'hjkl' we can add more bindings.
I will work on this mode and send a pull request if you are ok with this idea.
I'm not sure is the spacehammer bug on my mac or I just did totally wrong. I downloaded the latest version of Hammerspoon ( 0.9.52 ), then clone this repo. after restart os, when I press CMD SPC nothing happened. Did i missing some thing?
Right now moving app windows with <Lead w h/j/k/l>
moves them up to the edge of the display but no further. I think it should continue onto then next display (if available), creating an illusion of a single big screen estate area.
I'd like to support spacehammer via Patreon or some other sort of sponsorship (open collective, etc.)
Do you have something like this?
These interfere with using Opt+N to add an accent character ("ñ"), and since the way Hammerspoon binds keys isn't visible from the System Preferences Keyboard panel, this can lead to surprising the user.
IIRC this binding wasn't present in a prior version of Spacehammer, so I was surprised 😄
When activating Emacs, spacehammer opens a new instance instead of focusing on an existing one.
I'm using the default config and a vanilla emacs setup.
My emacs 28 was installed by building it with build-emacs-for-macos, and symlinked to /Applications/Emacs.app.
I open emacs by running emacs &!
on my zsh.
Is there anything suspicious in my setup that could lead to this issue?
I do have a server running and can connect to it via emacsclient.
Other potentially relevant info:
Hammerspoon latest (0.9.86)
spacehammer latest (81ca4e0)
MacOS Catalina 10.15.7
Hello,
I've always loved Spacemacs keybindings and was really looking forward to using this Hammerspoon config but unfortunately, I have yet to be able to get it running. I followed all of the install steps... Not sure if this is an issue in Big Sur, if so, I understand completely and will wait for the code to be updated. If not I'd really appreciate some guidance on how to fix this error. Thank you in advance!
2020-11-04 23:21:41: -- Lazy extension loading enabled
2020-11-04 23:21:42: -- Loading ~/.hammerspoon/init.lua
2020-11-04 23:21:42: -- Loading extension: alert
2020-11-04 23:21:42: *** ERROR: ...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: module 'fennel' not found:
no field package.preload['fennel']
no file '/Users/brick/.hammerspoon/fennel.lua'
no file '/Users/brick/.hammerspoon/fennel/init.lua'
no file '/Users/brick/.hammerspoon/Spoons/fennel.spoon/init.lua'
no file '/usr/local/share/lua/5.4/fennel.lua'
no file '/usr/local/share/lua/5.4/fennel/init.lua'
no file '/usr/local/lib/lua/5.4/fennel.lua'
no file '/usr/local/lib/lua/5.4/fennel/init.lua'
no file './fennel.lua'
no file './fennel/init.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel/init.lua'
no file '/Users/brick/.luarocks/share/lua/5.4/fennel.lua'
no file '/Users/brick/.luarocks/share/lua/5.4/fennel/init.lua'
no file '/Users/brick/.luarocks/share/lua/5.3/fennel.lua'
no file '/Users/brick/.luarocks/share/lua/5.3/fennel/init.lua'
no file '/Users/brick/.hammerspoon/fennel.so'
no file '/usr/local/lib/lua/5.4/fennel.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './fennel.so'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel.so'
no file '/Users/brick/.luarocks/lib/lua/5.4/fennel.so'
no file '/Users/brick/.luarocks/lib/lua/5.3/fennel.so'
stack traceback:
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: in function 'require'
/Users/brick/.hammerspoon/init.lua:22: in main chunk
[C]: in function 'xpcall'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:702: in function 'hs._coresetup.setup'
(...tail calls...)
I wanted to try this cool project out, but it looks like a step in the installation process is missing: it looks like you need to compile the fennel files. Is that right?
I didn't have luarocks or fennel installed, so I did this:
brew install luarocks
luarocks install fennel
git clone https://github.com/agzam/spacehammer ~/.hammerspoon
Then I reloaded the hammerspoon config with the button in the top-right. (Note I didn't reboot.)
Cool spacehammer keybindings.
2020-09-17 16:54:20: -- Lazy extension loading enabled
2020-09-17 16:54:20: -- Loading ~/.hammerspoon/init.lua
2020-09-17 16:54:20: -- Loading extension: alert
2020-09-17 16:54:20: *** ERROR: ...app/Contents/Resources/extensions/hs/_coresetup/init.lua:597: module 'core' not found:
no field package.preload['core']
no file '/Users/nielius/.hammerspoon/core.lua'
no file '/Users/nielius/.hammerspoon/core/init.lua'
no file '/Users/nielius/.hammerspoon/Spoons/core.spoon/init.lua'
no file '/usr/local/share/lua/5.3/core.lua'
no file '/usr/local/share/lua/5.3/core/init.lua'
no file '/usr/local/lib/lua/5.3/core.lua'
no file '/usr/local/lib/lua/5.3/core/init.lua'
no file './core.lua'
no file './core/init.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/core.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/core/init.lua'
no file '/Users/nielius/.hammerspoon/core.so'
no file '/usr/local/lib/lua/5.3/core.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './core.so'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/core.so'
stack traceback:
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:597: in function 'require'
/Users/nielius/.hammerspoon/init.lua:19: in main chunk
[C]: in function 'xpcall'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:648: in function 'hs._coresetup.setup'
(...tail calls...)
I added this makefile:
SOURCES := $(shell find ./ -type f -name '*.fnl')
TARGETS := $(patsubst %.fnl, %.lua, $(SOURCES))
all: $(TARGETS)
%.lua: %.fnl
fennel --compile $< > $@
and ran make all
.
(One file actually filed to compile, but that didn't seem to matter.)
Awesome project! I look forward to exploring it more.
Repro steps:
cmd + space => Spacehammer => space => alfred
Shortcuts seem to work fine. For example, I can I can use cmd + w to close tabs in a browser.
I had also bound alfred previously to opt + spacebar per default instructions. However, if I use alfred directly without going through Spacehammer, cmd + w to close tabs stops working.
My guess is it's related to some app specific shortcuts, but I haven't had time to debug. Hammerspoon console doesn't print anything when I invoke Alfred directly and modal state remains idle.
The command should run immediately and the alert window should close immediately
Those commands take a moment to fire and the alert window lingers for a second or two.
Seeing this:
2020-01-27 10:00:14: *** ERROR: Compile error in 'local' /Users/agibragimov/.spacehammer/config.fnl:340: expected name and value
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.3/fennel.lua:484: in upvalue 'assertCompile'
/usr/local/share/lua/5.3/fennel.lua:1557: in local 'special'
/usr/local/share/lua/5.3/fennel.lua:1002: in function 'fennel.compile1'
/usr/local/share/lua/5.3/fennel.lua:2160: in function 'fennel.compileStream'
(...tail calls...)
/usr/local/share/lua/5.3/fennel.lua:2286: in function 'fennel.eval'
(...tail calls...)
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:597: in function 'require'
./core.fnl:99: in main chunk
(...tail calls...)
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:597: in function 'require'
/Users/agibragimov/.hammerspoon/init.lua:6: in main chunk
[C]: in function 'xpcall'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:648: in function 'hs._coresetup.setup'
(...tail calls...)
To Reproduce:
Switch back and forth between windows quickly
Video: https://gfycat.com/officialsnivelingemperorpenguin
Result: The yellow outline when switching focus stays, even after closing or moving the window
Workaround: Reload config in hammerspoon
My Computer:
Mac Version: 10.15.4
Hammerspoon Version: [0.9.78]
Spacehammer Version: 9c99680
Potential Duplicate: #9
First of all, great work!
I'm keen to get this working with doom
. I have the below in my config:
(defun on-spacehammer-edit-with-emacs (buffer-name pid title)
(with-current-buffer (get-buffer buffer-name)
;; (spacemacs/evil-search-clear-highlight)
;; (spacemacs/toggle-visual-line-navigation-on)
(markdown-mode)
(evil-insert 1)))
(use-package! spacehammer
:demand t
:load-path "~/git/dotfiles/keyboard/spacehammer" ; this is the spacehammer.el file is
:config
(add-hook 'edit-with-emacs-hook 'on-spacehammer-edit-with-emacs))
I'm not sure what to do about the spacemacs
related functions.
So far the ctrl+cmd+O
works to open in an emacs session, however it opens in Funamental-mode
and the C-c C-c
binding gives and error: Symbol's function definition is void: spacemacs/copy-whole-buffer-to-clipboard
.
Any help would be greatly appreciated.
how might I be able to write a toggle-app fn? specifically, I'd like cmd+k to show the kitty app if it's not the current screen, else hide it. I'm trying to reproduce something like kovidgoyal/kitty#45 (comment) but I'm using spacehammer :) I'd appreciate any pointers. Thanks!
I have
(fn toggle-app
[app-name]
(hs.application.launchOrFocus app-name)
(let [app (hs.application.find app-name)]
(when app
(if (: app :isFrontmost)
(: app :hide)
(
(: app :activate) ;; not sure if I need both
(: app :unhide))))))
(fn toggler
[app-name]
(fn toggle []
(toggle-app app-name)))
;; in common-keys
{:mods [:cmd]
:key :k
:repeatable false
:action (toggler "Kitty")}
the window flashes- seems to activate then hide immediately- when I press cmd+k.
It would be nice to be able to style the modals, including how text is displayed (e.g. cmd → ⌘).
:exit
function of a modal seems to be firing only when explicitly exiting modal. e.g.:
(local menu-items
{:key :w
:title "Window"
:enter (fn [] (print "enter"))
:exit (fn [] (print "exit"))
:items window-bindings}
When pressed Alt+SPC w
- it prints "enter", when "Esc" - prints "exit". But if instead of pressing "Esc" (while in the modal) - you press "SPC" - it would go back to previous modal, but won't fire :exit
handler, and it should.
Given an open laptop connected to an external display (or several?), I found that the modal appeared only on the laptop's screen and not the external display. I think it would be better if the modal appeared on all displays so you would always see it, no matter which screen you are looking at.
I have a small edit that does this, that's working for me locally, and I'd be glad to submit a pull request if there is interest.
(Also, many thanks for this wonderful project! I am really enjoying the ways it is improving my time spent staring at screens and pushing buttons.)
(fn scroll-to-bottom
[]
(windows.set-mouse-cursor-at :Slack)
(hs.eventtap.scrollWheel [0 -20000] {}))
...
(fn scroll-up
[]
(scroll-slack -3))
(fn scroll-down
[]
(scroll-slack 3))
We can see here that scroll-down
has a positive direction, while scroll-to-bottom
is negative. Clearly these should have the same sign, and it seems that scroll-to-bottom
works as expected.
Add Fennel REPL that sends values to Hammerspoon's IPC
'j' and 'k` don't work in search window - gotta find a workaround
Sometimes modal keeps its hotkeys activated even after leaving it. For example in some cases "windows" modal stays active, and pressing h/j/k/l keys would move windows around and there's no other way to reset it but to reload the config. Very annoying
I have installed spacehammer according to the instructions in the readme. The only changes I have made to my system were to modify line 349 of ~/.spacehammer/config.fnl to so that CMD+Space is the LEAD and to load spacehammer.el in my init.el file.
To reproduce: Focus a window and press LEAD + w
Expected Result: The window prompt appears
Actual result: The following is output to the Hammerspoon console and the Spacehammer overlay freezes until you focus the Hammerspoon app and press escape.
2020-05-13 22:16:37: 22:16:37 ERROR: LuaSkin: hs.hotkey callback: ./lib/functional.fnl:43: bad argument #1 to 'concat' (table expected, got nil) stack traceback: [C]: in function 'table.concat' ./lib/functional.fnl:43: in function 'lib.functional.join' ./lib/modal.fnl:107: in upvalue 'format_key' ./lib/modal.fnl:127: in upvalue 'f' ./lib/functional.fnl:137: in local 'f' ./lib/functional.fnl:117: in function 'lib.functional.reduce' (...tail calls...) ./lib/modal.fnl:132: in upvalue 'modal_alert' ./lib/modal.fnl:148: in upvalue 'show_modal_menu' ./lib/modal.fnl:229: in function <./lib/modal.fnl:215> (...tail calls...) ./lib/statemachine.fnl:65: in function <./lib/statemachine.fnl:47> (...tail calls...)
I'm brand new to Hammerspoon, so I suspect this is user error, but I do not see a Spacehammer community to ask this question in so I'm raising it as an issue.
Perhaps it'd be nice if a user can configure keybindings, add/remove modules from a single location, maybe a .json file, I don't know.
E.g. from the README:
(local config
{:title "Main Menu"
:items menu-items
:keys common-keys
:enter (fn [] (windows.hide-display-numbers))
:exit (fn [] (windows.hide-display-numbers))
:apps apps
:hyper {:mods [:shift :alt :cmd :ctrl]}})
Results in this error:
2021-03-25 18:22:12: *** ERROR: ...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:416: key must be a string or a number
stack traceback:
[C]: in function 'error'
...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:20: in upvalue 'getKeycode'
...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:195: in function 'hs.hotkey.new'
...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:416: in function 'hs.hotkey.bind'
(...tail calls...)
./core.fnl:98: in upvalue 'f'
./lib/functional.fnl:144: in local 'f'
./lib/functional.fnl:124: in function 'lib.functional.reduce'
(...tail calls...)
./core.fnl:100: in main chunk
(...tail calls...)
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: in function 'require'
/Users/isaachodes/.hammerspoon/init.lua:25: in main chunk
[C]: in function 'xpcall'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:702: in function 'hs._coresetup.setup'
(...tail calls...)
More a wondering than an issue, explicitly: the default bindings for spacehammer use ⌘+N for alternative app switcher. Unless I'm missing something, there is consequently no shortcut left for making new windows. Is that something that you don't need in your workflow by default or do you fallback to a different means of making new windows in, e.g., your browser?
Hi!
Thanks for making spacehammer!
I've been wondering if there's a way to eat all keys while the modal is up (after I press the LEADER key). Sometimes I press a non-mapped key, and that gets passed through to the window in focus instead of doing something in the modal; is it currently possible to make all pressed keys go to spacehammer?
Thank you!
Evan
One aspect of Spacehammer that could stand to be improved is the ability to customize the implementation behavior of current or new features. For instance in an issue like #66 is going to require enhancing some core modal functions to change how bindings are created.
One option would be to design and architect some kind of hook or event system but then extra work will need to be done to update the system to use it, and it's a whole new API.
Another option would be to support more functions in the config.fnl. However, like the previous system we'll need to write checks for it in the relevant parts, additionally it muddles the purpose of config.fnl as it's now responsible for defining your configuration of spacehammer and the implementation.
My proposal would be to create a library similar to emacs-lisp advising functions, especially the doom emacs defadvice! macro.
An example from my dotconfig at https://github.com/eccentric-j/dotfiles/blob/c457fcba768f91a9fe2b7464221c97ba4dc3ad46/client/doom.d/config.el#L200-L206:
(defadvice! j/fix-js-multi-line-indent ()
"Indent expression declarations by 2 just like the rest of the code"
:after-while #'js--multi-line-declaration-indentation
(let ((beg (match-beginning 0)))
(when beg
(goto-char beg)
(+ js-indent-level (current-column)))))
Here I'm defining a function that fires after the js--multi-line-declaration-indentation function. Depending on the keyword used to represent how we're advising the function, I'll receive the original args sent to the function or the original function as the first argument.
(fn ...)
with the name of the macro that registers the function with the advising state so (fn)
becomes either (advisable-fn ...)
or (defn ...)
to add this to existing functionality.time
macro to make sure it's not too slow. Based on previous performance tests, I doubt it will have a noticable impact beyond a fraction of a ms.add-advice!
function to advise a functionremove-advice!
function to remove an advising functiondefadvice!
macro to define a function and call add-advice!
.advisable-fn
or defn
macro to register functions as advisable and create a handler to dispatch to advising functions.Hello space travelers,
We would like to know if you have any interest in VIM mode and providing some feedback so we can deliver a strong feature set and cover the most use cases as possible. Please answer the questions below and feel free to add your own.
What would you like out a vim mode from spacehammer?
What problems could it help you solve?
What top 3 vim features would you like to see included?
We appreciate your help!
after active the widow manage dialog with CMD+SPC, press n or p not any effect.
There's quite a lot of async code in this library. Currently, it's managed with callbacks, but we all know how much fun those are, especially if you come from node.
I really like working with FRP streams such as RxJS, Highland JS, and Bacon so creating a more focused version for this project (and other people's fennel projects) could help us model complex interactions very trivially.
Intended interface
(local stream {:require stream})
(-> (stream.fromCallback fs.timer.doAfter 3)
(stream.map (fn [_] "hello"))
(stream.subscribe print))
With a few more constructors and some higher-order operations, we can do some really cool things to tie two or more otherwise unrelated async operations together.
For example:
(-> (stream.fromWatcher app-focus-watcher)
(stream.combine (stream.fromCallback ts.eventtap.new [events.keyup]))
(stream.map hs.inspect)
(stream.subscribe print))
This would give us a stream of events where a user switches app focus and presses a key which is typically very complicated to model with callbacks and typically requires a lot of mutable state.
This will likely help improving more complex features like vim mode as well as even opening up greater possibilities for animation.
I've started the research phase, learning about the Observer pattern which seems to be at the core of most stream implementations I've worked with.
If anyone can recommend an existing library or even tutorials on how to implement a library like that, it would be greatly appreciated.
Sometimes app-local-keys would not get deactivated when switching from one app to another. The only workaround is to switch back to the previous app and return to current again. This is really annoying.
how does this work?
I've tried
{:vim {:enabled true}}
(vim.enable)
in config.fnl.
Thanks!
Sometimes Tab-switcher CMD+j/k
for browser apps, gets deactivated seemingly for no apparent reason. Not sure what's causing it. For now the only workaround is to reload the Hammerspoon config.
upd: it seems App local keybindings, e.g. Slack specific keybindings stop working as well.
If I hit my keyboard shortcuts quickly enough (which I typically do), there is a <1s delay between hitting e.g. a
in the first modal and the app switcher coming up in the next modal. In practice this means I have to wait between hitting keys in the modals of Spacehammer.
Would be nice to have window layouts or workspaces that can be persisted and restored at will.
Hammerspoon should continue to work
Hammerspoon breaks, will not load Spacehammer, and displays an error
2020-09-20 12:15:28: -- Lazy extension loading enabled
2020-09-20 12:15:28: -- Loading ~/.hammerspoon/init.lua
2020-09-20 12:15:28: -- Loading extension: alert
2020-09-20 12:15:28: *** ERROR: ...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: module 'fennel' not found:
no field package.preload['fennel']
no file '/Users/davelu/.hammerspoon/fennel.lua'
no file '/Users/davelu/.hammerspoon/fennel/init.lua'
no file '/Users/davelu/.hammerspoon/Spoons/fennel.spoon/init.lua'
no file '/usr/local/share/lua/5.4/fennel.lua'
no file '/usr/local/share/lua/5.4/fennel/init.lua'
no file '/usr/local/lib/lua/5.4/fennel.lua'
no file '/usr/local/lib/lua/5.4/fennel/init.lua'
no file './fennel.lua'
no file './fennel/init.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel/init.lua'
no file '/Users/davelu/.hammerspoon/fennel.so'
no file '/usr/local/lib/lua/5.4/fennel.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './fennel.so'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel.so'
stack traceback:
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: in function 'require'
/Users/davelu/.hammerspoon/init.lua:16: in main chunk
[C]: in function 'xpcall'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:702: in function 'hs._coresetup.setup'
(...tail calls...)
Thanks to @tntmarket for reporting this issue in #67.
While exploring this repo, I was reading the init.lua
file and came across what seemed like a typo, so I figured I'd open an issue just in case.
Is package.loadeers
supposed to be package.loaders
? See line 4 of init.lua
Sorry if this is noise.
Hi! I overjoyed by finding this superb project! I love the philosophy with which this set of package made, and I’m very happy, as an Emacs and Nix user, it will complete my missing part of current environment, that is, the managing the overall dynamic behavior outside of Emacs. I think the static one is handled by Nix for good.
Currently I’m using the combination of yabai + skhd, however, which mostly covers only for the window and some quick jumps to the specific applications, not the rest. So for the rest, e.g. key remapping, etc. should be handled yet another application, in my case, karabiner.
To integrate those decentralized ones into one ecosystem, I thought Hammerspoon will do the right job for me, meanwhile, I also found this repository. I love the idea exploiting Lisp’s flexibility and willing to learn fennel for this amazing ecosystem, spacehammer, so I’m thinking about to migrate to this over other combination of applications, which lack of consistency.
My question is, as a newbie for the Lua and Hammerspoon, is it feasible or planned to incorporate other Spoons, say hhtwm? What I’m missing most is the yabai’s tiling feature and the ability to move an application to a specified space, which seems not implemented in spacehammer (please teach me if I’m wrong about it!).
Plus, I believe allowing other existing plugins to be merged into spacehammer easily, it can be a huge momentum for it.
Thanks for your awesome contribution!
Best regards,
– Hyunggyu Jang
Seems some breaking changes in 0.4.0 Fennel.
To repro simply get to "windows" modal, LEAD w
, results in this:
2020-05-13 12:45:46: 12:45:46 ERROR: LuaSkin: hs.hotkey callback: ./lib/functional.fnl:43: bad argument #1 to 'concat' (table expected, got nil)
stack traceback:
[C]: in function 'table.concat'
./lib/functional.fnl:43: in function 'lib.functional.join'
./lib/modal.fnl:107: in upvalue 'format_key'
./lib/modal.fnl:127: in upvalue 'f'
./lib/functional.fnl:137: in local 'f'
./lib/functional.fnl:117: in function 'lib.functional.reduce'
(...tail calls...)
./lib/modal.fnl:132: in upvalue 'modal_alert'
./lib/modal.fnl:148: in upvalue 'show_modal_menu'
./lib/modal.fnl:229: in function <./lib/modal.fnl:215>
(...tail calls...)
./lib/statemachine.fnl:65: in function <./lib/statemachine.fnl:47>
(...tail calls...)
Is it possible to add to the below (basically, have multiple hotkeys which launch different modals)?
(local common-keys
{:mods [:cmd :shift :alt :ctrl]
:key :space
:title "Apps"
:items app-bindings})
(local config
{:title "Main Menu"
:items menu-items
:keys common-keys})
Modals switching mechanism can be implemented as a finite state machine, that would make it easier to add new modals.
... shows some errors in the console ...
Edit-with-Emacs future could be improved further. It would be nice to be able to detect if there's a selection already, instead of emulating "Select all" all the time. That would allow editing a pre-selected chunk of text. I don't know if there's a "proper" way of detecting if there's a selection. Perhaps we can read the clipboard, copy, compare currently copied with the previous thing, and somehow decide if it has to be done with Cmd+A and Cmd+C, or doing Cmd+C (without selecting all) is enough.
I'm sure this is just a problem on my end but I can't seem to sort it out.
Here's my code
;; Select all the way left ;; {:mods [:cmd :shift] :key :h :action (key-fn [:cmd :shift] :left) :repeat true}
If i change :mods [:cmd :shift] to mods [:ctrl] the shortcut works as expected. Am I using multiple mods incorrectly?
Would be nice to be able to just brew install spacehammer
without having to separately install Hammerspoon, lua, fennel...
The docs contain an example of binding the hyper key as a combination of modifiers:
{:hyper {:mods [:cmd :ctrl :alt :shift]}
However, when I try to do this in my own config, I get an error:
2020-06-08 22:43:59: *** ERROR: ...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:408: key must be a string or a number
stack traceback:
[C]: in function 'error'
...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:20: in upvalue 'getKeycode'
...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:195: in function 'hs.hotkey.new'
...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:408: in function 'hs.hotkey.bind'
(...tail calls...)
./core.fnl:98: in upvalue 'f'
./lib/functional.fnl:144: in local 'f'
./lib/functional.fnl:124: in function 'lib.functional.reduce'
(...tail calls...)
./core.fnl:100: in main chunk
(...tail calls...)
[C]: in function 'rawrequire'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:597: in function 'require'
/Users/valrus/.hammerspoon/init.lua:19: in main chunk
[C]: in function 'xpcall'
...app/Contents/Resources/extensions/hs/_coresetup/init.lua:648: in function 'hs._coresetup.setup'
(...tail calls...)
I'm not sure as I don't really know Fennel, but it looks like hyper.fnl
requires the :hyper
table to have a :key
(in init
).
I regularly see high memory usage from Hammerspoon when running spacehammer (more than 1GB). I have seen this at two different machines (intel and m1 macbooks) running the default config or this config.
Tested on macos 11.1 and 11.2, hammerspoon 0.9.82 and spacehammer 7d9ffe1.
From what I can see the memory usage increases about 1MB when running Option-SPC a e
a single time and never decreases after. Reloading the hammerspoon config from the console releases some memory, but not all. Only solution I've found is to fully restart hammerspoon to release the memory.
I don't know if this issue is in spacehammer/fennel/hammerspoon/something else but starting here if anyone has ideas on how to proceed!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.