Hacker News new | past | comments | ask | show | jobs | submit | SyncOnGreen's comments login

Same can be achieved in a few lines of Lua using Hammerspoon and hs.audiodevice API.

    local builtinMicName = "MacBook Pro Microphone"
    hs.audiodevice.watcher.setCallback(function(e) 
        defaultMic = hs.audiodevice.defaultInputDevice():name()
        if (e == "dIn " and defaultMic ~= builtinMic) then
          local builtinMic = hs.audiodevice.findInputByName(builtinMicName)
          builtinMic:setDefaultInputDevice()
        end
    end)
    hs.audiodevice.watcher.start()
It doesn't seem fair to pay $20 per year for this. I'd be fine with one time payment.

Cool solution! But have you actually tried it?

Once you try it you may find out that for some reason sometimes it will revert back to AirPods mic. I filed a bug report for that, check it out: https://developer.apple.com/forums/thread/763583

Therefore you will have to iron out the edge cases. Are the AirPods considered connected when you switch to your iPhone when using your Mac? Yes the continuity stuff.

Also, you will have to actually maintain that script. That is, you will need to find a place for it where it lives and it’s not lost when upgrading the system etc.

My app is for all the people who don’t want to deal with this and rather pay $2 a month to have it maintained and have someone they can report the issues they have and get them fixed.

Anyway, I made the app for myself and decided to put it on the market to see what happens, so it’s alright to have a competition:) if it happens that this is the better solution I may just drop mine and use it.


Yes, I have used a similar Hammerspoon script for nearly 10 years.

Sorry if you felt attacked, it wasn't my point.

Congratulations on developing and shipping a fully-fledged product, I hope I'll help people in need of a "it just works" solution for this particular problem. Paying for it is of course justified, as you poured your time and knowledge to provide a fully working fix.

Since this is Hackernews, I shared how I approached this problem on my devices - I use Hammerspoon to script little parts of the system I don't like in macOS and audio device handling is one of them.

I use a more complex version that handles additional pain points, but the default input source changing has worked just fine for me for the last few years (with AirPods, Bose QC35 and regular wired headphones).


Oh you don’t have to be sorry, I genuinely liked your solution. I haven’t tried lua, looks much simpler than what I got with Automator for example!

I was expecting a backslash for not giving away for free, kind of enjoying it. Like the good old days when I was making free apps for the likes but this time I’m on the “dark side”


Is there any chance you could share the more complex version?

The script can be extended with additional features like:

- fixing macOS balance bug (outputDevice:setBalance(0.5) on output device change)

- muting built-in speakers on headphones disconnect event

- pausing Spotify when external headphones are disconnected


You could charge $10/year for this to compete with OP.

I love Hammerspoon so much and love seeing snippets like this come up.

https://airflow.app/ is worth mentioning - paid software (sadly Windows/macOS only) but works with everything you throw at it, transcodes unsupported codecs seamlessly and has great UI with remote control via an app.


Neat project - I was looking for something similar for powering various bits of electronics and stumbled upon WEB PDC001 (can be found on Aliexpress) cable which is basically programmable USB-C cable with DC barrel jack. Works great with TS-100 soldering iron powered using generic PD phone charger. The only issue with it - software for programming it is Windows only and it isn't translated to English.


If you figured the sw out, care to publish a blog post about it?


I tried reverse-engineering the USB protocol but quickly moved onto another project. Project is on GitHub https://github.com/JaCzekanski/pdc-control

Small correction: the software itself is in English but the documentation (and firmware files) is in Chinese.


I had the same idea few months ago, I've even coded simple POC in Java which mapped submissions in subreddit to files. You could use FUSE to create virtual device and map files in mounted folder to comments. For Java I was using fuse-jna - there should be binding for Python.


Someone made a reddit FUSE filesystem (I don't know if it still works though)

https://github.com/ianpreston/redditfs


I've coded a NES emulator for my C++ programming course (https://github.com/JaCzekanski/AnotherNES) and one of the features is live view of RAM and PPU registers (check out Screenshots at bottom of Readme). As for now only RAM can be changed during game play but I plan to carry on with development and create emulator with ability to change every register of console in realtime (like ICU64 here: https://www.youtube.com/watch?v=tjcvR5McmSg)


Awesome!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: