Skip to content

Instantly share code, notes, and snippets.

View fhemberger's full-sized avatar

Frederic Hemberger fhemberger

View GitHub Profile
@fhemberger
fhemberger / init.lua
Created November 21, 2021 20:12
Hammerspoon: Switch layout when USB keyboard is plugged in
local usbLogger = hs.logger.new('usb', 'debug')
function configureKeyboard(data)
-- Uncomment the "usbLogger" line below, plug in the USB keyboard and update the USB vendor and product ID
local isKeyboardAffected = data.vendorID == 9610 and data.productID == 89
-- usbLogger.df("eventType %s, pname %s, vname %s, vId %s, pId %s, keyboardAffected %s", data.eventType, data.productName, data.vendorName, data.vendorID, data.productID, isKeyboardAffected)
if isKeyboardAffected and data.eventType == "added" then
hs.keycodes.setLayout("U.S.")
end
if isKeyboardAffected and data.eventType == "removed" then
@fhemberger
fhemberger / backup-uberspace.exclude
Created October 17, 2013 08:52
How to easily backup your Uberspace (http://uberspace.de) account with rsync
.gem
.npm
cgi-bin
fcgi-bin
html
lib
man
share
tmp
**/node_modules