News for hackers. Stuff that matters.
Re:AnyBar: OS X menubar status indicator by NickBusey on Sunday November 27, 2016 @11:43AM (#13050018)
I'll be that guy on this thread that points out Hammerspoon. It's an OS X automation tool that replaces pretty much every OS X 'tweak' style application out there. http://www.hammerspoon.org/go/#simplemenubar

I think it's the best of these type of projects, and would love to see more people using it / developing and sharing scripts.

Re:AnyBar: OS X menubar status indicator by jsjohnst on Sunday November 27, 2016 @03:11PM (#13051209)
I hadn't heard of Hammerspoon before your reply, but man I'm glad you posted. This nails a need of mine and looks very useful overall. Thanks!
Re:AnyBar: OS X menubar status indicator by bosie on Sunday November 27, 2016 @04:58PM (#13051803)
And I will be that guy on this thread pointing out Keyboard Maestro ; https://www.keyboardmaestro.com/main/

One thing i couldn't replicate yet in hammerspoon (among other things) is clicking: https://wiki.keyboardmaestro.com/action/Find_Image_on_Screen incredibly useful

Re:AnyBar: OS X menubar status indicator by NickBusey on Sunday November 27, 2016 @05:16PM (#13051921)
What is an example of something you would use that feature for?
Re:AnyBar: OS X menubar status indicator by bosie on Sunday November 27, 2016 @05:41PM (#13052053)
I use it to (random incomplete list):

  - switch recipients in Franz.app
  - click on menubar items
  - import current page into devonthink (requires a click on  a toolbar item to start the automation)
  - toggle flux (click on menubar item and go down etc)
  - adding tags in delibar (click on the Nth suggested tag)
  - click on toolbar items  in all possible apps when there is no keyboard shortcut/menu item available
Re:AnyBar: OS X menubar status indicator by sooheon on Sunday November 27, 2016 @02:08PM (#13050775)
Care to share your implementation of your favorite feature? I'm finding it hard to picture what the workflow/result will be like.
Re:AnyBar: OS X menubar status indicator by NickBusey on Sunday November 27, 2016 @02:20PM (#13050853)
Well for one I do use the Caffeine feature that is shown in the section of the Getting Started guide I linked to. That replaced the actual Caffeine app. I have a timer running reminding me to take breaks every so often, that replaced Time Out. I have it auto-detect when I plug into my keyboard at home, and when I do it turns on my bluetooth to pair with my mouse, when I unplug, it turns off the bluetooth. This prevents the annoying issue of my mouse constantly connecting/disconnecting when I'm using my computer in a different room. I have it watching wifi events and automatically setting my volume to 0 when I leave my home wifi network, to prevent any accidental sound blares when I open my laptop in a meeting. Finally I have it bound to some custom hot keys to move/resize my windows around my external monitors. That function replaces the zillion window management apps out there.
Re:AnyBar: OS X menubar status indicator by prashnts on Sunday November 27, 2016 @02:32PM (#13050933)
> bound to some custom hot keys to move/resize my windows around my external monitors

iTerm2's hotkey is pretty terrible in my opinion. I've bound this function to make it work for me:

    function iTermHotkeyHandler()
      local iterm = hs.application.get('iTerm2')
      if (iterm) then
        local window = iterm:mainWindow()
        if not window then
          if iterm:selectMenuItem('New Window') then
            window = iterm:mainWindow()
          end
          return
        end
        if iterm:isFrontmost() then
          iterm:hide()
        else
          window:focus()
        end
      end
    end
    hs.hotkey.bind('cmd', 'space', iTermHotkeyHandler)
*me: I really should put these in some gist somewhere.
Re:AnyBar: OS X menubar status indicator by paublyrne on Sunday November 27, 2016 @03:00PM (#13051108)
What don't you like about iTerm's show/hide function?
Re:AnyBar: OS X menubar status indicator by prashnts on Sunday November 27, 2016 @03:25PM (#13051296)
Hotkey windows do not show up in cmd+tab switcher. It's annoying if you activate the hotkey with cmd+space, press cmd+tab to go to previous window, and instinctively press cmd+tab hoping to get back to the terminal window. But that doesn't happen.
Re:AnyBar: OS X menubar status indicator by paublyrne on Sunday November 27, 2016 @03:42PM (#13051404)
OK I understand what you mean. I've never found that to be a problem for me but I'm glad you were able to come up with a solution.
Re:AnyBar: OS X menubar status indicator by gnachman on Tuesday November 29, 2016 @11:41PM (#13068537)
Would you mind filing a bug? The next version is focused on hotkey window improvements and this is very easy to fix. I'm away from my machine now or I'd do it myself. Thanks! ITerm2.com/bugs
Re:AnyBar: OS X menubar status indicator by prashnts on Sunday November 27, 2016 @02:28PM (#13050910)
If one likes being cheap, it's fun to mute Spotify if there's an Ad. Yeah...

    function muteSpotifyOnAd()
      if (hs.spotify.isRunning()) then
        if (hs.spotify.getCurrentTrack():lower() == 'spotify') then
          hs.spotify.setVolume(0)
        else
          hs.spotify.setVolume(100)
        end
      end
    end
    hs.timer.doEvery(10, muteSpotifyOnAd)
Re:AnyBar: OS X menubar status indicator by mastax on Sunday November 27, 2016 @07:36PM (#13052592)
Doesn't spotify pause the ad if the volume is zero? It does for me.
Re:AnyBar: OS X menubar status indicator by Griffinsauce on Sunday November 27, 2016 @06:16PM (#13052221)
No thanks, one likes earning a few cents from their published music.
Re:AnyBar: OS X menubar status indicator by kuschku on Sunday November 27, 2016 @06:46PM (#13052351)
Spotify still gets paid by the advertiser, and so does the artist.

It’s like switching TV channels when the ad plays.

In analog media, close to no one ever listened to / watched ads, due to exactly that – many VHS recorders would even automatically skip them.

Re:AnyBar: OS X menubar status indicator by mypalmike on Sunday November 27, 2016 @06:58PM (#13052417)
> close to no one ever listened to / watched ads

I can still sing jingles I learned from watching TV ads in the 70s.

Re:AnyBar: OS X menubar status indicator by maxwelljoslyn on Sunday November 27, 2016 @03:12PM (#13051214)
Nice one!
Re:AnyBar: OS X menubar status indicator by tra3 on Sunday November 27, 2016 @08:24PM (#13052780)
- A scratch pad window that appears on Hyper-S. It appends stuff to my scratch.txt.

- Hyper-1 through 5 to defer tasks in OmniFocus (calls out to an external script).

- Hyper-W to lock my screen.

- Hyper-M to mute skype microphone.

- Hyper-[C,T,X,F] to focus Chrome, TaskPaper, nvAlt and iTerm.

Re:AnyBar: OS X menubar status indicator by notyourwork on Sunday November 27, 2016 @01:17PM (#13050460)
This looks really flexible, thanks for sharing.
Re:AnyBar: OS X menubar status indicator by semi-extrinsic on Sunday November 27, 2016 @02:15PM (#13050822)
Huh, it's like someone wrote an app that's the non-WM part of Awesome WM for OSX. Never thought I'd see that.
Re:AnyBar: OS X menubar status indicator by dcgoss on Sunday November 27, 2016 @04:26PM (#13051633)
Looks really interesting, thanks. Does anyone know if there is anything similar to Hammerspoon out there?
Re:AnyBar: OS X menubar status indicator by JadeNB on Sunday November 27, 2016 @05:21PM (#13051952)
> Does anyone know if there is anything similar to Hammerspoon out there?

Did you forget to include some extra constraint? As written, it looks like the answer to your question is "Yes, Hammerspoon."

Re:AnyBar: OS X menubar status indicator by dcgoss on Sunday November 27, 2016 @05:32PM (#13052004)
Sorry, I realize that is unclear. What I was getting at is just if there are any other similar scripting/automation apps out there, perhaps with a different scripting language or other application integrations. I am a newbie in the automation space so I was wondering what other types of apps people may be using.
Re:AnyBar: OS X menubar status indicator by mastax on Sunday November 27, 2016 @07:37PM (#13052596)
You may be interested in AppleScript or AutoHotKey.
Re:AnyBar: OS X menubar status indicator by tarp on Sunday November 27, 2016 @09:47PM (#13053059)
Hammerspoon is forked from mjolnir

https://github.com/sdegutis/mjolnir