I hereby claim:
- I am philsnow on github.
- I am philsnow (https://keybase.io/philsnow) on keybase.
- I have a public key whose fingerprint is 8568 F2DD 46A3 E8EB 8731 5A6D 11E9 7527 9066 9294
To claim this, I am signing this object:
| ### Keybase proof | |
| I hereby claim: | |
| * I am philsnow on github. | |
| * I am philsnow (https://keybase.io/philsnow) on keybase. | |
| * I have a public key whose fingerprint is 8568 F2DD 46A3 E8EB 8731 5A6D 11E9 7527 9066 9294 | |
| To claim this, I am signing this object: |
| -- Modal bindings, have to resort to this because on mac there | |
| -- isn't a reserved modifier key for interacting with the OS. | |
| modal_keymap = hs.hotkey.modal.new("cmd", "escape") | |
| modal_keymap:bind('', 'escape', nil, function() modal_keymap:exit() end) | |
| -- Maximize toggling | |
| local window_table = {} | |
| function toggleFocusedWindowFullscreen() | |
| local focused_window = hs.window.focusedWindow() |
I hereby claim:
To claim this, I am signing this object:
| % /usr/bin/time ./zebra.rb | |
| [[{:country=>:norway, | |
| :drink=>:no_drink, | |
| :color=>:yellow, | |
| :pet=>:fox, | |
| :smoke=>:kool, | |
| :pos=>1}, | |
| {:country=>:ukraine, | |
| :drink=>:tea, | |
| :color=>:blue, |
| -- other stuff in hammerspoon init.lua | |
| require("pasteboardtype") |
| #!/bin/bash | |
| # brew install lz4 && \ | |
| # mkdir -p ~/dev && \ | |
| # cd ~/dev && \ | |
| # git clone https://github.com/lilydjwg/mozlz4-tool && \ | |
| # cd mozlz4-tool && \ | |
| # LIBRARY_PATH=/opt/homebrew/lib cargo build --release | |
| ~/dev/mozlz4-tool/target/release/mozlz4-tool "$(find ~/Library/Application\ Support/Firefox/Profiles/ -name recovery.jsonlz4 | head -1)" | jq '["* \(.windows | length) Firefox windows as of '$(date +%Y-%m-%dT%H:%M:%S)'", (.windows | . as $windows | length as $num_windows | keys | .[] | $windows[.] as $window | [" - window \(. + 1) out of \($num_windows), \($window.tabs | length) tabs", ($window.tabs[] | .entries[-1] as $last | " - [[\($last.url)][\($last.title)]]")])] | flatten | .[]' -r |
| # source this from your shell | |
| chrome_tabs () { | |
| for win in $(seq 1 $(osascript -e 'tell application "Chrome" to get count every window')) | |
| do | |
| for tab in $(seq 1 $(osascript -e "tell application \"Chrome\" to get count every tab of window ${win}")) | |
| do | |
| echo -n "win $win tab $tab: " | |
| osascript -e "tell application \"Chrome\" to get URL of tab $tab of window $win" | |
| done | |
| done |
Slack animations take a ton of CPU and thus battery. Wouldn't it be great if unplugging your laptop from its power source would automatically turn them off?
This is a bit of code for Hammerspoon that makes that happen.
AnimateSlack is just an Automator app that pulls my user token out of a keychain with security and curls a POST to some Slack API URL I forget the details of
Slack animations take a ton of CPU and thus battery. Wouldn't it be great if unplugging your laptop from its power source would automatically turn them off?
This is a bit of code for Hammerspoon that makes that happen.
AnimateSlack is just an Automator app that pulls my user token out of a keychain with security and curls a POST to api.slack.com, but if I were to do this again I'd just have Hammerspoon do it.
I've been using numbered Spaces a lot more lately, and it's helpful for me to only see the apps/windows that I'm currently focused on, instead of all 30 apps I happen to have open. I wanted something similar to hs.window.switcher, but I don't care about window thumbnails and I wanted to be able to see more than just a few characters of the window title.
I cribbed heavily from the window_switcher.lua source but removed a lot of configurability, logging, backwards compatibility, and other good ideas.
Screencast/demo: (I have this new switcher bound to option+tab, and can still use the regular macos cmd-tab switcher)