Comments (5)
hs.wifi.watcher often fails, the wifi toggle callback function does not execute correctly, and the only way to make it work is to repeatedly reload the configuration file, which executes correctly.
from hammerspoon.
Are you capturing your watcher in a global variable? I haven't dug too deep into this, but could it be a garbage collection issue?
from hammerspoon.
![截屏2023-11-02 12 11 18](https://private-user-images.githubusercontent.com/49114841/279864040-48fa10b9-0145-4eb7-bd49-e6accce66121.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTEiLCJleHAiOjE3MDM0ODUwMDMsIm5iZiI6MTcwMzQ4NDcwMywicGF0aCI6Ii80OTExNDg0MS8yNzk4NjQwNDAtNDhmYTEwYjktMDE0NS00ZWI3LWJkNDktZTZhY2NjZTY2MTIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFJV05KWUFYNENTVkVINTNBJTJGMjAyMzEyMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjMxMjI1VDA2MTE0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4ZDVkNGM1ZDk2ODcyZTI5Yjk4NTQyMTM0YTc3NzMxMjY3ZTM4NzY5MjA0OWY0MDRlMGQ0Yjk0NjRiNWRkNGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PVeUtHa4vvJ368NOgYdZblV21expqwjQ66bw5rcOwd0)
from hammerspoon.
Try capturing it in a global:
watcher = hs.wifi.watcher.new(...)
from hammerspoon.
Thank you very much for solving this problem. Maybe I should re-read the documentation, it was a really low-level mistake.
I have two more questions for ---->
- hs.wifi.watcher.new() only monitors "SSIDChange" by default, but when I change wifi, it executes the callback function 3 times, what usually causes this?
-
There are many duplicate networks in the list of available WiFi networks obtained by hs.wifi.availableNetworks(). Only one of them can be used with hs.chooser and hs.wifi.associate to change the network, how to solve this problem?
from hammerspoon.
Related Issues (20)
- Modifiers not working on Remote desktop HOT 4
- How can I run shortcuts via the terminal instead of using keys? HOT 1
- Any way to swap caps to ctrl? HOT 7
- Test hs.ipc.cliInstall on macOS Sonoma HOT 4
- suspected memory leak HOT 8
- New revision of Stream Deck XL with a new PID not supported HOT 1
- Hammerspoon hangs spradically when entering hyper mode and displaying a modal window HOT 16
- Subject: Difficulty Keeping Notifications Persistent and Moving Them to Notification Center
- hs.network.ping.ping blocks callback function of timer HOT 3
- hs.audiodevice state is particular to Hammerspoon object, not audio device (Documation clarification needed) HOT 1
- MacOS killing Hammerspoon due to high CPU usage? HOT 7
- Print statements hanging Hammerspoon and triggering memory leak HOT 7
- HIDAPI module wrapper / Surface Dial support
- No arrows in submenus HOT 2
- hs.grid alphanumeric keys ignored on Sonoma 14.1.2 HOT 2
- Feature request: allow multiple key bindings for a single function in `hs.spoons.bindHotkeysToSpec` HOT 3
- Tucking Apps HOT 1
- switcher.ui.highlight rounded corners? HOT 2
- windowfilter.focusWindow* methods hang for ~10s HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hammerspoon.