aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-04-23keyboard_layout: Add Kyria checkHEADmasterTeddy Wing
Include the Kyria keyboard in the keyboard layout switcher.
2023-11-08keyboard_layout_select: Add shortcuts to select keyboard layoutTeddy Wing
I had to upgrade to Mac OS 14 Sonoma, which in addition to adding a useless software Caps Lock indicator, also royally screwed up the way that changing keyboard layouts used to work (it worked perfectly fine). I decided to make a unique keyboard shortcut to switch to each keyboard layout to put some order to the madness.
2023-11-08window_layout: Add debug logTeddy Wing
After changing machines, I was having a problem with window layout restoration. I had added this debug log, but then it magically started working again. Committing this change anyway, maybe it actually did something.
2023-01-31keyboard_layout: Add Keychron checkTeddy Wing
Add a check for another keyboard I'm using to have it switch keyboard layouts on connection and disconnection.
2022-09-20keyboard_layout: Fix USB keyboard detectionTeddy Wing
The way I had written it before broke automatic switching support for the iMate USB device. Rewrite the device check so that both the iMate and generic keyboards automatically switch keyboard layouts.
2022-09-19keyboard_layout: Update copyrightTeddy Wing
2022-09-19keyboard_layout: Try to change keyboard layout on keyboard device changeTeddy Wing
Try to detect when any keyboard is plugged in by looking at its "productName" and checking to see if it contains the word "keyboard". If so, change the keyboard layout between the preferred for internal and external keyboards.
2022-09-05README: Add submodule command to install instructionsTeddy Wing
Otherwise the WindowMode spoon isn't initialised.
2021-11-30meet: Move the CSRF to a query string argumentTeddy Wing
Move the CSRF check to a query string parameter instead of a request header. Doing this because I need to make the request from a Greasemonkey script, and it gets CORS-blocked if I add a non-whitelisted header to the request. Also rename the CSRF variable to "csrf-ish" since it's a hard-coded random string.
2021-11-29Add a way to set output volume from a Google Meet videoconferenceTeddy Wing
I'm planning to make a Greasemonkey script that loads on Google Meet videoconference pages and make an HTTP request to this Hammerspoon server to set the output volume to a predetermined level.
2021-09-14keyboard_layout: Fix keyboard condition boolean operatorsTeddy Wing
Made a mistake: the boolean expression wasn't saying what I wanted it to say. All parts should match the USB device in order to continue.
2021-09-13Add keyboard_layout.luaTeddy Wing
Change the keyboard layout depending on whether my external keyboard is connected or not.
2021-09-13Add screen_lock.luaTeddy Wing
Old ideas for locking the screen when the ambient brightness goes outside a range. The brightness measurements were inconsistent, so this trigger didn't end up working out too well. Committing it for reference anyway.
2021-03-07init: Update copyright yearTeddy Wing
2021-03-07init: Remove F8 key bindingTeddy Wing
This binding is no longer needed because I've replaced screen colour inversion with https://github.com/teddywing/Re-Good-Catalina-Invert-Colours, which includes built-in support for the shortcut. Not sure about the monitor check as I haven't been able to test it. If I still need to correct for that, I can add it back in later.
2021-03-07Revert "Try correcting Catalina invert screen colours"Teddy Wing
This reverts commit 3135531426cfc2abc057ad085e39022617cd8689. Didn't work.
2021-03-07Try correcting Catalina invert screen coloursTeddy Wing
Tried setting up a correction for Mac OS X 10.15 Catalina's invert screen colours bug on February 7, 2020. I never committed it because I never got it working. Committing the work here for reference. It's supposed to reactivate inverted colours using the Accessibility Options panel.
2021-03-03ufo: Reload UFO extension with Extreload on F12Teddy Wing
Easily reload the extension by pressing F12.
2019-11-15init: Fix condition in F8 mappingTeddy Wing
We want to restore the brightness when the external monitor is connected. Probably wrote the inverse condition in order to test it without the monitor connected and forgot to inverse it.
2019-11-13catalina_brightness_bullshit: Don't restore brightness on wakeTeddy Wing
Don't bother running on wake because we always unlock the screen right after waking. There's no need to restore twice.
2019-11-07window_layout: Fix error when saved window not foundTeddy Wing
Saw this error when a saved window ID doesn't exist: 2019-11-07 16:25:03: 16:25:03 ERROR: LuaSkin: hs.screen.watcher callback: $HOME/.hammerspoon/window_layout.lua:39: attempt to index a nil value stack traceback: $HOME/.hammerspoon/window_layout.lua:39: in upvalue 'window_positions_restore' $HOME/.hammerspoon/window_layout.lua:52: in function </$HOME/.hammerspoon/window_layout.lua:51> This could be when a saved window was closed, in which case we don't care that its position can't be restored.
2019-10-31init: Reset brightness in F8 invert screen colours bindingTeddy Wing
Mac OS X 10.15 Catalina sometimes (but not always) causes the internal display's brightness to change to the maximum when connected to an external monitor after inverting screen colours. In our F8 shortcut which inverts screen colours, reset the screen brightness to correct this idiocy.
2019-10-20window_layout: Set default `window_positions` table value to `{}`Teddy Wing
Make the default table value of `window_positions` keys an empty table (`{}`) to fix nil access errors on line 31: window_positions[screen][window:id()] = window:frame()
2019-10-20catalina_brightness_bullshit: Get current brightness on initTeddy Wing
Instead of setting the arbitrary 50% brightness default, get the actual current brightness on initialisation so we can restore the real value in case the computer is locked/slept before the timer can store it.
2019-10-20catalina_brightness_bullshit: Save brightness on a timerTeddy Wing
Doesn't seem to be working reliably by saving on lock and sleep, as the brightness is getting saved & restored to the maximum of 100. Save the brightness level on a half-hour timer instead.
2019-10-16Add brightness correction for OS X 10.15 CatalinaTeddy Wing
Since upgrading to 10.15 Catalina, when my external monitor is plugged in and I wake up my machine, for some unexplained reason the internal display resets to maximum brightness. Fix Catalina's nonsense on wake by resetting to the brightness from before sleep.
2019-10-14window_layout: Restore all window positions when monitors changeTeddy Wing
Save all window positions when windows are moved, resized, created, deleted. When the primary monitor changes, restore previously saved window positions for that monitor. This ensures that our windows stay in the same position even after connecting and disconnecting an external monitor.
2019-08-12Add missing license headersTeddy Wing
2019-08-12ufo: Add a mode binding to edit, save, and close a text fileTeddy Wing
2019-08-06Remove F5 Chrome extension reloader, replace with iTerm app switchTeddy Wing
Remove the Chrome extension reload binding on F5. I'm not using it currently and it was just messing me up when I pressed it accidentally. Move the iTerm application switching binding from F6 to F5 now that it's free, as F5 is easier to find without looking.
2019-07-26application_switch: Add a binding on F6 to activate iTermTeddy Wing
Easier and less error-prone than the F13_f mapping I also have. Need a shorter shortcut that isn't F1 while I work on trying to move from Terminal to iTerm.
2019-07-26window_layout: Fix iTerm window #2 targetingTeddy Wing
Using an index of 2 didn't guarantee that the window accessed would be window #2. Turns out the order of windows in the list is not consistent. In order to target window #2, look for the "2. " prefix in the window title.
2019-07-25Automatically reposition iTerm window 2 when external monitor connectedTeddy Wing
When my external monitor is connected, ensure that iTerm's window #2 is in the proper position. iTerm has a habit of getting its window layout screwed up when switching monitors (or just not remembering window layouts between monitors).
2019-07-25init: New F5 mapping to reload UFO Chrome extensionTeddy Wing
Reloads the UFO Chrome extension and opens a file in a single one-button mapping.
2019-07-25mouse: Add non-functioning Option-ClickTeddy Wing
Was trying to get this to work a while ago and it's been sitting uncommitted in my local repo. Commit it just to have it, and try to figure out how to get it to work later.
2019-07-11init: Add temporary F5 binding to reload a browser extensionTeddy Wing
Working on a Chrome extension that displays an HTML interface through an extension-scoped URL. When I reload the extension, the page gets closed automatically. This mapping clicks the extension's button in the Chrome toolbar (the rightmost extension icon) to reopen the page.
2019-07-06init.lua: Remove Ctrl-Option-z shortcutTeddy Wing
Now that WindowMode has the `c` shortcut which does the same thing, we no longer need this shortcut. It was also shadowing a Ctrl-Option-Shift-z shortcut I have attached to the "Zoom" menu item in iTerm2. Now the Zoom shortcut works there.
2019-07-06Spoons/WindowMode.spoon: Upgrade to latest HEADTeddy Wing
Provides `c` shortcut increase window height to the bottom of the screen.
2019-07-06application_switch: Add shortcut for TextEditTeddy Wing
2019-07-03Spoons/WindowMode.spoon: Upgrade to latest HEADTeddy Wing
2019-06-28Add hotkey to reload AODocs UFO browser extensionTeddy Wing
Until live reloading is implemented, this compacts a bunch of repetitive key presses into a modal shortcut.
2019-06-22gdrive_mouseover_item: Add a short description of the scriptTeddy Wing
2019-06-22gdrive_mouseover_item_open: Ensure Chrome is activeTeddy Wing
Before doing anything, activate Chrome. Normally it should be active anyway, but I just tried this with Finder active and no windows open, not realising that Chrome wasn't the frontmost application.
2019-06-22gdrive_mouseover_item: Open the selected fileTeddy Wing
Press a keyboard shortcut defined in a separate user script to open the file using AODocs UFO.
2019-06-22Add gdrive_mouseover_item modeTeddy Wing
A mode that selects a file row in Google Drive by its ID using keyboard shortcuts 1–0 and q–p. Makes it possible to select a file without using the mouse.
2019-06-22application_switch: Allow deactivating mode with Escape keyTeddy Wing
2019-06-22application_switch: Add shortcut for PreviewTeddy Wing
2019-06-22application_switch: Add shortcut for ExcelTeddy Wing
2019-06-20application_switch: Provide access to F1–F4 keysTeddy Wing
Since I overrode the F1 through F4 keys globally, there was no way to access press a non-custom variant of these keys. Realised this when trying to access the manual in Mutt, which is bound to F1. Add Shift-F1–F4 bindings that map to F1–F4, in case we need access to the original set of keys. Needed to add a `doAfter` delay after disabling the binding because the delay seems to take a bit to go through. Thanks to 'knu' (https://github.com/knu) for the tip: https://github.com/Hammerspoon/hammerspoon/issues/1252#issuecomment-290411701 Also gleaned it from: https://stackoverflow.com/questions/40986242/key-repeats-are-delayed-in-my-hammerspoon-script
2019-06-19terminal_tab_hotkeys: Fix errors in enable/disable loopsTeddy Wing
Since the `terminal_tab_hotkeys` table had both hotkey objects and methods in it, the loops that enable and disable the hotkeys were also looping over the functions, resulting in errors like this: 2019-06-19 23:30:09: ******** 2019-06-19 23:30:09: 23:30:09 ERROR: LuaSkin: hs.application.watcher callback: $HOME/.hammerspoon/terminal_tab_hotkeys.lua:42: attempt to index a function value (local 'v') stack traceback: $HOME/.hammerspoon/terminal_tab_hotkeys.lua:42: in method 'enable' $HOME/.hammerspoon/terminal_tab_hotkeys.lua:55: in function <$HOME/.hammerspoon/terminal_tab_hotkeys.lua:52> 2019-06-19 23:30:09: ******** Go the easy route and just change the methods into functions so that we only put hotkeys in the tables.