Spotify Volume Control with Hammerspoon

One of Spotify’s best features is its ability for a client to become a remote to another version of itself running on a different device. A few months ago I started using the Mac app on my laptop to control the speakers connected to a PC in my office.

Everything works pretty well, except for the volume. Out of habit, I would use the volume keys on my Mac to adjust the volume only to change the system volume and not affect Spotify at all. After probably 600 times of doing this I decided to fix it.

Hammerspoon to the rescue! (For those not in the know, Hammerspoon allows you to write Lua scripts to control your Mac with a really great “standard library” of functions to control things like window positions, volume, running AppleScript, etc.)

With this little bit of code in my ~/.hammerspoon/init.lua file I can use:

  • F7 to goto the previous song
  • F8 to play/pause Spotify only (sometimes iTunes or something would randomly launch before)
  • F9 to skip to the next song
  • F11/F12 to adjust the volume of Spotify if playing, otherwise adjust the system volume
-- Remap media keys to Spotify-priority equivalents
hs.hotkey.bind({}, "f7", function()

hs.hotkey.bind({}, "f8", function()

hs.hotkey.bind({}, "f9", function()

hs.hotkey.bind({}, "f11", function()
  playing = hs.spotify.isPlaying()

  if playing then
    output = hs.audiodevice.defaultOutputDevice()
    output:setVolume(output:volume() - 10)

hs.hotkey.bind({}, "f12", function()
  playing = hs.spotify.isPlaying()

  if playing then
    output = hs.audiodevice.defaultOutputDevice()
    output:setVolume(output:volume() + 10)

You have to change the Keyboard System Preferences to intrepret the top row as F1, F2, etc. instead of Brightness, Volume, etc.) I picked F7 through F12 so the markings on the keys matched the functionality.

Of course, this may all be irrelevant with the Magic Toolbar

The New

The Toledo Blade just launched a new version of their website. It’s… not very good.

Of course, it’s very easy to be dismissive and make fun of the old guard trying something, especially at the local level. It’s easy to make fun and point at all the things that are wrong. But, who makes Is it one person? A small team? Is the project just outsourced somewhere? I have no inside knowledge of or connections to web at The Blade. But I’d wager they aren’t given the resources, attention, and/or respect they deserve. I bet their largest and loudest demographic fears change and is very vocal about the paper’s slow drift away from newsprint to pixels. Great for morale.

Instead I’d like to offer some constructive criticism for how The Blade specifically, and maybe local news outlets in general, can be more relevant. I get it: local news is hard. I don’t have the Holy Grail for how to fix the dying organization that is printed news. I’m just a web developer who started making things for the web in Toledo, has gone on to make more things for the web at a global news organization in New York City, and came back to make some more things for the internet (which I guess we’re not capitalizing any more).

Is it Local?

The largest and first two stories (about 43% of the real estate in the “above the fold” homepage) is dedicated to the 2016 Presidential Election with stories sourced from the Associated Press, content also syndicated in hundreds of other media outlets. Only 30% is local content written by Blade staff.

The Blade hires a lot of really great reporters that spend a lot of their time out in my community (perhaps even in my neighborhood!) gathering information that is most likely relevant to my life as a Toledoian. But where is it?

I think there is an opportunity to geotag articles by location and use that data to provide hyper-local content down to my street. Or use what it knows about me and my social graph and interests to surface more relevant content in other ways.

Poor Implementation

It took 688 HTTP(S) requests over a whopping 18 seconds to deliver a single article (over Buckeye Broadband!) Only a tiny fraction of this bandwidth was for the content I requested, the rest is in service of advertising and tracking. (This isn’t just a problem with The Blade, but practically every news organization and website that depends on advertising revenue.)

Only a handful of The Blade’s readers will see this view, but everyone feels the sluggishness and is affected by the ever shrinking notion of privacy online. If you’re going to track my movements around the site, use it for other useful purposes other than just re-marketing.

Content Advertising is King

Advertising isn’t just the majority of bandwidth, it’s often the majority of the page as well. Huge banner ads that obscure content are commonplace, and are constantly vying for your attention as you scroll down the page.

I should probably mention I am a digital subscriber to The Blade, but I’m not sure what that means on the new site. I don’t see anywhere to log in, and even if I did it’s not clear how that would change my experience, if at all.

Words and Images

Throughout their history, newspapers have only produced words and images: first printed on a page then uploaded to a server. They haven’t transitioned to other forms of storytelling like video and data-driven interactives.

I’m sure part of the reason is lack of a work force to generate said content. Web designers, developers, UX specialists, iOS and Android developers, data journalists, video producers, system administrators, etc. are expensive and hard to find in Toledo. But I’m not even sure newspapers think they need them.

It’s clear the dead tree-based newspaper is still king and at the center of the organization. Rich media has no place there and therefore is most likely of little value to the organization overall. But you need more than just words to properly explain what is happening in our ever complicating community.

I hope either The Blade or someone else starts telling that story.

TIL: Image Cells in Google Sheets

Today I learned you can insert image cells into a Google Sheets document. All you need is a URL to an image:


The documentation lists a few other options, like how the image should be sized and fit the cell.

Screenshot of image cells in a Google Sheets document

For certain things, like planning a kitchen remodel, having a small thumbnail makes it really easy to skim through a document and even helps in the design process.