Skip to content

Instantly share code, notes, and snippets.

@fjarlq
fjarlq / tabswitching-hotkeys.lua
Last active January 21, 2025 09:47
Hammerspoon script that fixes Ctrl-PgUp/Ctrl-PgDn, Ctrl-Left/Ctrl-Right, and Home/End in Safari
-- Remaps macOS keyboard shortcuts as follows. I need this mainly
-- because I'm so used to these keys in Chrome, but they are not built
-- into Safari and I have not found a builtin way in macOS to add
-- these keyboard shortcuts to Safari.
--
-- Intercepted shortcut Sends instead Desired function
-- -------------------- ------------- ----------------
-- Ctrl-PageUp Ctrl-Shift-Tab Show Previous Tab
-- Ctrl-PageDown Ctrl-Tab Show Next Tab
-- Ctrl-LeftArrow Ctrl-Shift-Tab Show Previous Tab
@fjarlq
fjarlq / bindsystemkeys.lua
Created June 22, 2020 19:06
Hammerspoon script to bind hotkeys to system key events
--
-- Bind keyboard shortcuts to macOS media key actions.
-- For example, bind F11/F12 to volume down/up.
--
-- If binding to a function key doesn't work work, check:
-- System Preferences > Keyboard > Shortcuts
-- for a shortcut that is already using the function key.
-- For example, F11 is usually bound to Show Dashboard.
-- Even if that shortcut is unchecked, it can interfere.
-- Make sure the shortcut is set to some other key.
@fjarlq
fjarlq / gist:3337508
Created August 13, 2012 06:52
screen drawing bug in Panic Prompt v1.3.2
#!/usr/bin/python
#
# reproduces a screen drawing bug in Panic Prompt v1.3.2
# reported by fjarlq on August 13, 2012
#
# good v1.3.1 behavior: counts on your screen from 0 to 9, updated each second
#
# bad v1.3.2 behavior: it counts 0 and then 1 and then the counting stops
#