Skip to content

Commit

Permalink
🥔
Browse files Browse the repository at this point in the history
  • Loading branch information
mikker committed Jun 26, 2023
1 parent c020517 commit b05b43d
Show file tree
Hide file tree
Showing 46 changed files with 4,570 additions and 1,031 deletions.
18 changes: 12 additions & 6 deletions bin/prep
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@

set -e

CURRENT=`git branch | grep '\*' | awk '{print $2}'`
CURRENT=$(git branch | grep '\*' | awk '{print $2}')

if [[ $CURRENT == "master" ]]; then
git rebase -i origin/master
if git branch | grep -q master; then
main_branch='master'
else
if [ $1 ]; then
git rebase -i $1
main_branch='main'
fi

if [ "$CURRENT" = "$main_branch" ]; then
git rebase -i origin/$main_branch
else
if [ "$1" ]; then
git rebase -i "$1"
else
git rebase -i master
git rebase -i $main_branch
fi
fi

Binary file removed bin/rubyfmt
Binary file not shown.
2 changes: 1 addition & 1 deletion brew/Brewfile.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ brew "zsh-syntax-highlighting"

tap "homebrew/services"

tap "federico-terzi/espanso"
tap "espanso/espanso"
brew "espanso"

cask_args appdir: "/Applications"
Expand Down
1 change: 1 addition & 0 deletions git/gitignore.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ artifacts/
cache/
.env
.DS_Store
.DS_Store
4 changes: 4 additions & 0 deletions hammerspoon/hammerspoon.symlink/.luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"diagnostics.globals": ["hs"]
}
20 changes: 10 additions & 10 deletions hammerspoon/hammerspoon.symlink/caffeine/init.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
local caffeine = hs.menubar.new()

function setCaffeineDisplay(state)
if state then
caffeine:setIcon("caffeine/awake.pdf")
else
caffeine:setIcon("caffeine/sleepy.pdf")
end
local function setCaffeineDisplay(state)
if state then
caffeine:setIcon("caffeine/awake.pdf")
else
caffeine:setIcon("caffeine/sleepy.pdf")
end
end

function caffeineClicked()
setCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
local function caffeineClicked()
setCaffeineDisplay(hs.caffeinate.toggle("displayIdle"))
end

if caffeine then
caffeine:setClickCallback(caffeineClicked)
setCaffeineDisplay(hs.caffeinate.get("displayIdle"))
caffeine:setClickCallback(caffeineClicked)
setCaffeineDisplay(hs.caffeinate.get("displayIdle"))
end

caffeineClicked() -- caffeine starts on
98 changes: 50 additions & 48 deletions hammerspoon/hammerspoon.symlink/hjkl/init.lua
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
local function pressFn(mods, key)
if key == nil then
key = mods
mods = {}
end

return function() hs.eventtap.keyStroke(mods, key, 1000) end
if key == nil then
key = mods
mods = {}
end

return function()
hs.eventtap.keyStroke(mods, key, 1000)
end
end

local function remap(mods, key, pressFn)
hs.hotkey.bind(mods, key, pressFn, nil, pressFn)
local function remap(mods, key, fn)
hs.hotkey.bind(mods, key, fn, nil, fn)
end

-- bonus!
remap({'ctrl'}, ';', pressFn('delete'))
remap({ "ctrl" }, ";", pressFn("delete"))

-- hjkl
remap({'ctrl'}, 'h', pressFn('left'))
remap({'ctrl'}, 'j', pressFn('down'))
remap({'ctrl'}, 'k', pressFn('up'))
remap({'ctrl'}, 'l', pressFn('right'))

remap({'ctrl', 'shift'}, 'h', pressFn({'shift'}, 'left'))
remap({'ctrl', 'shift'}, 'j', pressFn({'shift'}, 'down'))
remap({'ctrl', 'shift'}, 'k', pressFn({'shift'}, 'up'))
remap({'ctrl', 'shift'}, 'l', pressFn({'shift'}, 'right'))

remap({'ctrl', 'cmd'}, 'h', pressFn({'cmd'}, 'left'))
remap({'ctrl', 'cmd'}, 'j', pressFn({'cmd'}, 'down'))
remap({'ctrl', 'cmd'}, 'k', pressFn({'cmd'}, 'up'))
remap({'ctrl', 'cmd'}, 'l', pressFn({'cmd'}, 'right'))

remap({'ctrl', 'alt'}, 'h', pressFn({'alt'}, 'left'))
remap({'ctrl', 'alt'}, 'j', pressFn({'alt'}, 'down'))
remap({'ctrl', 'alt'}, 'k', pressFn({'alt'}, 'up'))
remap({'ctrl', 'alt'}, 'l', pressFn({'alt'}, 'right'))

remap({'ctrl', 'shift', 'cmd'}, 'h', pressFn({'shift', 'cmd'}, 'left'))
remap({'ctrl', 'shift', 'cmd'}, 'j', pressFn({'shift', 'cmd'}, 'down'))
remap({'ctrl', 'shift', 'cmd'}, 'k', pressFn({'shift', 'cmd'}, 'up'))
remap({'ctrl', 'shift', 'cmd'}, 'l', pressFn({'shift', 'cmd'}, 'right'))

remap({'ctrl', 'shift', 'alt'}, 'h', pressFn({'shift', 'alt'}, 'left'))
remap({'ctrl', 'shift', 'alt'}, 'j', pressFn({'shift', 'alt'}, 'down'))
remap({'ctrl', 'shift', 'alt'}, 'k', pressFn({'shift', 'alt'}, 'up'))
remap({'ctrl', 'shift', 'alt'}, 'l', pressFn({'shift', 'alt'}, 'right'))

remap({'ctrl', 'cmd', 'alt'}, 'h', pressFn({'cmd', 'alt'}, 'left'))
remap({'ctrl', 'cmd', 'alt'}, 'j', pressFn({'cmd', 'alt'}, 'down'))
remap({'ctrl', 'cmd', 'alt'}, 'k', pressFn({'cmd', 'alt'}, 'up'))
remap({'ctrl', 'cmd', 'alt'}, 'l', pressFn({'cmd', 'alt'}, 'right'))

remap({'ctrl', 'cmd', 'alt', 'shift'}, 'h', pressFn({'cmd', 'alt', 'shift'}, 'left'))
remap({'ctrl', 'cmd', 'alt', 'shift'}, 'j', pressFn({'cmd', 'alt', 'shift'}, 'down'))
remap({'ctrl', 'cmd', 'alt', 'shift'}, 'k', pressFn({'cmd', 'alt', 'shift'}, 'up'))
remap({'ctrl', 'cmd', 'alt', 'shift'}, 'l', pressFn({'cmd', 'alt', 'shift'}, 'right'))
remap({ "ctrl" }, "h", pressFn("left"))
remap({ "ctrl" }, "j", pressFn("down"))
remap({ "ctrl" }, "k", pressFn("up"))
remap({ "ctrl" }, "l", pressFn("right"))

remap({ "ctrl", "shift" }, "h", pressFn({ "shift" }, "left"))
remap({ "ctrl", "shift" }, "j", pressFn({ "shift" }, "down"))
remap({ "ctrl", "shift" }, "k", pressFn({ "shift" }, "up"))
remap({ "ctrl", "shift" }, "l", pressFn({ "shift" }, "right"))

remap({ "ctrl", "cmd" }, "h", pressFn({ "cmd" }, "left"))
remap({ "ctrl", "cmd" }, "j", pressFn({ "cmd" }, "down"))
remap({ "ctrl", "cmd" }, "k", pressFn({ "cmd" }, "up"))
remap({ "ctrl", "cmd" }, "l", pressFn({ "cmd" }, "right"))

remap({ "ctrl", "alt" }, "h", pressFn({ "alt" }, "left"))
remap({ "ctrl", "alt" }, "j", pressFn({ "alt" }, "down"))
remap({ "ctrl", "alt" }, "k", pressFn({ "alt" }, "up"))
remap({ "ctrl", "alt" }, "l", pressFn({ "alt" }, "right"))

remap({ "ctrl", "shift", "cmd" }, "h", pressFn({ "shift", "cmd" }, "left"))
remap({ "ctrl", "shift", "cmd" }, "j", pressFn({ "shift", "cmd" }, "down"))
remap({ "ctrl", "shift", "cmd" }, "k", pressFn({ "shift", "cmd" }, "up"))
remap({ "ctrl", "shift", "cmd" }, "l", pressFn({ "shift", "cmd" }, "right"))

remap({ "ctrl", "shift", "alt" }, "h", pressFn({ "shift", "alt" }, "left"))
remap({ "ctrl", "shift", "alt" }, "j", pressFn({ "shift", "alt" }, "down"))
remap({ "ctrl", "shift", "alt" }, "k", pressFn({ "shift", "alt" }, "up"))
remap({ "ctrl", "shift", "alt" }, "l", pressFn({ "shift", "alt" }, "right"))

remap({ "ctrl", "cmd", "alt" }, "h", pressFn({ "cmd", "alt" }, "left"))
remap({ "ctrl", "cmd", "alt" }, "j", pressFn({ "cmd", "alt" }, "down"))
remap({ "ctrl", "cmd", "alt" }, "k", pressFn({ "cmd", "alt" }, "up"))
remap({ "ctrl", "cmd", "alt" }, "l", pressFn({ "cmd", "alt" }, "right"))

remap({ "ctrl", "cmd", "alt", "shift" }, "h", pressFn({ "cmd", "alt", "shift" }, "left"))
remap({ "ctrl", "cmd", "alt", "shift" }, "j", pressFn({ "cmd", "alt", "shift" }, "down"))
remap({ "ctrl", "cmd", "alt", "shift" }, "k", pressFn({ "cmd", "alt", "shift" }, "up"))
remap({ "ctrl", "cmd", "alt", "shift" }, "l", pressFn({ "cmd", "alt", "shift" }, "right"))
40 changes: 20 additions & 20 deletions hammerspoon/hammerspoon.symlink/init.lua
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
function reload_config(files)
hs.reload()
local function reload_config(_)
hs.reload()
end
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reload_config):start()
hs.alert.show(" ✔︎")

-- application hotkeys {{{

local hyper = {"cmd", "alt", "ctrl", "shift"}
local hyper = { "cmd", "alt", "ctrl", "shift" }

local charsToApps = {
a = "iTerm",
c = "Calendar",
d = "Dash",
e = "Mail",
f = "Finder",
i = "Music",
m = "Messages",
p = "Things3",
s = "Safari",
-- s = "Safari Technology Preview",
-- s = "Firefox",
t = "Tweetbot",
w = "VimR",
z = "Slack",
a = "WezTerm",
c = "Calendar",
d = "Dash",
e = "Mail",
f = "Finder",
i = "Music",
m = "Messages",
p = "Things3",
s = "Safari",
-- s = "Safari Technology Preview",
-- s = "Firefox",
t = "Tweetbot",
w = "VimR",
z = "Slack",
}
for key, app in pairs(charsToApps) do
hs.hotkey.bind(hyper, key, function()
hs.application.launchOrFocus(app)
end)
hs.hotkey.bind(hyper, key, function()
hs.application.launchOrFocus(app)
end)
end

require("hjkl")
Expand Down
23 changes: 11 additions & 12 deletions hammerspoon/hammerspoon.symlink/mouse_four_five.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
mouse_four_five =
hs.eventtap.new({hs.eventtap.event.types.otherMouseDown}, function(event)
if event:getButtonState(3) then
hs.eventtap.keyStroke({"cmd"}, "[")
return true
elseif event:getButtonState(4) then
hs.eventtap.keyStroke({"cmd"}, "]")
return true
else
return false
end
end)
local mouse_four_five = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(event)
if event:getButtonState(3) then
hs.eventtap.keyStroke({ "cmd" }, "[")
return true
elseif event:getButtonState(4) then
hs.eventtap.keyStroke({ "cmd" }, "]")
return true
else
return false
end
end)

mouse_four_five:start()
Loading

0 comments on commit b05b43d

Please sign in to comment.