Skip to content

Instantly share code, notes, and snippets.

View feifanzhou's full-sized avatar

Feifan Zhou feifanzhou

View GitHub Profile
@feifanzhou
feifanzhou / hammerspoon — init.lua
Last active August 28, 2021 18:10
Hammerspoon config (window moving and resizing)
-- Inspired by Linux alt-drag or Better Touch Tools move/resize functionality
-- from https://gist.github.com/kizzx2/e542fa74b80b7563045a#gistcomment-2023593
-- Command-Ctrl-move: move window under mouse
-- Command-Control-Shift-move: resize window under mouse
function get_window_under_mouse()
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition())
local my_screen = hs.mouse.getCurrentScreen()
return hs.fnutils.find(hs.window.orderedWindows(), function(w)
return my_screen == w:screen() and
w:isStandard() and
{
"global": {
"check_for_updates_on_startup": false,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
[user]
name = "Feifan Zhou"
email = "[email protected]"
# http://haacked.com/archive/2014/07/28/github-flow-aliases/
# https://gist.github.com/mwhite/6887990
# https://stackoverflow.com/a/5188364/472768
[alias]
branches = branch --sort=-committerdate
count = count-objects -vH