Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make alert function advisable + fix advice lib #118

Merged
merged 1 commit into from
Sep 12, 2021

Conversation

jaidetree
Copy link
Collaborator

@jaidetree jaidetree commented Sep 12, 2021

Fixes a small inconsistency in the advice defadvice macro + makes the modal function advisable. Includes updates to the tests to catch issues like this in the future.

Fixes #74
Closes #75
Closes #95

Then you can add the following to your config.fnl:

(require-macros :lib.advice.macros)

(defadvice alert-all-screens
           [str style seconds]
           :override alert
           "Displays an alert across all screens"
           (pprint {:str str
                    :style style
                    :seconds seconds})
           (each [key screen (ipairs (hs.screen.allScreens))]
             (hs.alert.show str
                            style
                            screen
                            seconds)))

Then the spacehammer modal will display on all screens. @Grazfather may create a follow up PR to add it to the docs as an official, practical example.

The exact cause was due to use the metatables to make the advisable functions callable while storing references to their advice entry and key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: show modal on all displays not just one
2 participants