mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
Major update to Hammerspoon config
- Use Spoons (installed via Makefile targets): - RoundedCorners - HeadphoneAutoPause (with AutoResume patch) - Move windows management into separate file
This commit is contained in:
@@ -1,15 +1,51 @@
|
||||
.SILENT:
|
||||
|
||||
install: ext/grid.lua installSpoons
|
||||
update: update_ext/grid.lua updateSpoons
|
||||
|
||||
#
|
||||
# Spoons
|
||||
#
|
||||
|
||||
SPOONS = RoundedCorners \
|
||||
HeadphoneAutoPause
|
||||
SPOONS_DIR = Spoons
|
||||
SPOON_PATHS = $(foreach s,$(SPOONS),$(shell echo $(SPOONS_DIR)/$(s).spoon))
|
||||
|
||||
.PHONY: installSpoons
|
||||
installSpoons: $(SPOON_PATHS)
|
||||
|
||||
.PHONY: removeSpoons
|
||||
removeSpoons:
|
||||
$(foreach dir,$(SPOON_PATHS),(test -d "$(dir)" && echo "removing $(dir)" && rm -rf "$(dir)") || exit 0;)
|
||||
# $(foreach dir,$(SPOON_PATHS),echo "removing $(dir)";)
|
||||
|
||||
.PHONY: updateSpoons
|
||||
updateSpoons: removeSpoons installSpoons
|
||||
|
||||
$(SPOONS_DIR)/%.spoon:
|
||||
echo "fetching $@..." && \
|
||||
curl -s -L -o "$@.zip" \
|
||||
"https://github.com/Hammerspoon/Spoons/raw/master/$@.zip" && \
|
||||
unzip -d $(SPOONS_DIR) "$@.zip" && \
|
||||
rm "$@.zip" && \
|
||||
( test -f "$@.patch" && patch -p0 < "$@.patch" ) || exit 0
|
||||
|
||||
|
||||
#
|
||||
# Core extentions and patching
|
||||
#
|
||||
|
||||
ext/grid.lua:
|
||||
echo "fetching ext/grid.lua..." && \
|
||||
curl -s -L -o ext/grid.lua \
|
||||
https://raw.githubusercontent.com/Hammerspoon/hammerspoon/master/extensions/grid/init.lua && \
|
||||
make patch_ext/grid.lua
|
||||
echo "fetching $@..." && \
|
||||
curl -s -L -o $@ \
|
||||
https://raw.githubusercontent.com/Hammerspoon/hammerspoon/master/extensions/grid/init.lua && \
|
||||
make patch_$@
|
||||
|
||||
.PHONY: patch_ext/grid.lua
|
||||
patch_ext/grid.lua:
|
||||
echo "patching ext/grid.lua..." && \
|
||||
patch -p0 < ext/grid.patch
|
||||
patch -p0 < ext/grid.lua.patch
|
||||
|
||||
.PHONY: remove_ext/grid.lua
|
||||
remove_ext/grid.lua:
|
||||
|
||||
Reference in New Issue
Block a user