-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
4,570 additions
and
1,031 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ artifacts/ | |
cache/ | ||
.env | ||
.DS_Store | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Oops, something went wrong.