Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Deeb-Swihart committed Apr 18, 2020
1 parent 651265c commit 3d6bcf6
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 52 deletions.
28 changes: 10 additions & 18 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,32 @@
"global",
"gnu-sed",
"httpie",
"imagemagick",
"jam",
"jq",
"leiningen",
"libnotify",
"librsvg",
"libssh2",
"libxml2",
"neovim",
"osquery",
"parallel",
"pkg-config",
"ripgrep",
"stubby",
"tag",
"terminal-notifier",
"texinfo",
"the_silver_searcher",
"tmux",
"unbound",
"vim",
"watchman",
"wget",
"xsv",
"yarn",
"youtube-dl",
"z3",
"zsh"
],
"casks": [
"alfred",
{"name": "arq", "when": "home"},
"bettertouchtool",
"brave-browser",
"dash",
{"name": "epic-games", "when": "home"},
"fantastical",
"firefox",
"font-fira-code",
"font-fira-mono",
{"name": "franz", "when": "home"},
Expand All @@ -71,9 +60,13 @@
"osxfuse",
"racket",
{"name": "signal", "when": "home"},
"skim",
{"name": "steam", "when": "home"},
"tla-plus-toolbox",
"hammerspoon",
"iina",
"java",
"java8",
"keka",
"lunchy",
"osxfuse",
{"name": "transmission", "when": "home"},
"virtualbox",
{"name": "vmware-fusion", "when": "home"},
Expand All @@ -91,6 +84,7 @@
],
"sources": {
"https://github.com/larkery/zsh-histdb.git": "~/.zsh-histdb/",
"https://github.com/zsh-users/zsh-autosuggestions", "~/.zsh/zsh-autosuggestions",
"https://github.com/asdf-vm/asdf.git": {
"destination": "~/.asdf",
"post-install": "cd ~/.asdf && git checkout \"$(git describe --abbrev=0 --tags)\""
Expand All @@ -113,9 +107,7 @@
"bin/*": "~/.local/bin/",
"config/*": "~/.config/",
"launchagents/*.plist":"~/Library/LaunchAgents/",
"hammerspoon/*": "~/.hammerspoon/",
"etc/unbound/*": "~/homebrew/opt/unbound/etc/unbound/",
"etc/stubby/*": "~/homebrew/etc/stubby/"
"hammerspoon/*": "~/.hammerspoon/"
},
"post-install": [
"brew cleanup",
Expand Down
24 changes: 12 additions & 12 deletions config/karabiner/karabiner.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,16 @@
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": []
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
}
]
}
],
"fn_function_keys": [
Expand Down Expand Up @@ -244,20 +253,11 @@
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
}
],
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"mouse_key_xy_scale": 100
}
}
]
}
}
2 changes: 2 additions & 0 deletions dots/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ if [ -d "$HOME/.bash_it" ]; then
source $BASH_IT/bash_it.sh
fi
export ORGHOME='/Users/timods/Library/Mobile Documents/iCloud~com~appsonthemove~beorg/Documents/org'

complete -C /usr/local/bin/nomad nomad
29 changes: 7 additions & 22 deletions hammerspoon/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,10 @@ hs.hotkey.bind(module.prefix, "b", launcher("org.mozilla.firefox"))
hs.hotkey.bind(module.prefix, "i", launcher("com.googlecode.iterm2"))
hs.hotkey.bind(module.prefix, "e", launcher("org.gnu.Emacs"))

if os.getenv("AT_WORK") == 1 then
hs.hotkey.bind(module.prefix, "m", launcher("com.microsoft.teams"))
hs.hotkey.bind(module.prefix, "n", launcher("com.microsoft.OneNote"))
hs.hotkey.bind(module.prefix, "c", launcher("com.microsoft.Outlook"))
hs.hotkey.bind(module.prefix, "p",
function() -- P for Post. It's stupid, I know, but M and E were taken
hs.application.launchOrFocusByBundleID('com.microsoft.Outlook')
end)
else
hs.hotkey.bind(module.prefix, "k", launcher("com.reinvented.KeepIt"))
hs.hotkey.bind(module.prefix, "d", launcher("com.devon-technologies.think3"))
hs.hotkey.bind(module.prefix, "m", launcher("com.apple.iChat"))
hs.hotkey.bind(module.prefix, "s", launcher("org.whispersystems.signal-desktop"))
hs.hotkey.bind(module.prefix, "c", launcher("com.flexibits.fantastical2.mac"))
hs.hotkey.bind(module.prefix, "p",
function() -- P for Post. It's stupid, I know, but M and E were taken
hs.application.launchOrFocusByBundleID('com.apple.mail')
hs.osascript.applescript('tell application "Mail" to check for new mail')
end )
hs.hotkey.bind(module.prefix, "a", collectFromFrontmostApp) -- a for Archive
hs.hotkey.bind(module.prefix, "r", todoFromFrontmostApp) -- r for Remember
end
hs.hotkey.bind(module.prefix, "m", launcher("com.microsoft.teams"))
hs.hotkey.bind(module.prefix, "n", launcher("com.microsoft.OneNote"))
hs.hotkey.bind(module.prefix, "c", launcher("com.microsoft.Outlook"))
hs.hotkey.bind(module.prefix, "p",
function() -- P for Post. It's stupid, I know, but M and E were taken
hs.application.launchOrFocusByBundleID('com.microsoft.Outlook')
end)
5 changes: 5 additions & 0 deletions hammerspoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ hs.dockicon.hide()
local global = require 'global'
local keepit = require 'keepit'
local mail = require 'mail'

local usb = require 'usb'
local wifi = require 'wifi'

local reload = require 'reload'
13 changes: 13 additions & 0 deletions hammerspoon/reload.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function reloadConfig(files)
doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
if doReload then
hs.reload()
end
end
myWatcher = hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start()
hs.alert.show("Config loaded")
27 changes: 27 additions & 0 deletions hammerspoon/usb.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- ~/.hammerspoon/usb.lua
local module = {}
module.watcher = nil

function usbDeviceCallback(data)
pn = data["productName"]
evt = data["eventType"]
if (pn == "Schiit Modi 3") then
if evt == "added" then
dac = hs.audiodevice.findOutputByName(pn)
if dac ~= nil then
dac:setDefaultOutputDevice()
end
end
elseif (pn == "Blue Snowball ") then
if evt == "added" then
mic = hs.audiodevice.findAudioDeviceByName(pn)
if mic ~= nil then
mic:setDefaultInputDevice()
end
end
end
end

module.watcher = hs.usb.watcher.new(usbDeviceCallback)
module.watcher:start()
return module
22 changes: 22 additions & 0 deletions hammerspoon/wifi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local module = {}
module.watcher = nil
local homeSSID = "chrowireless"
local lastSSID = hs.wifi.currentNetwork()

function ssidChangedCallback()
newSSID = hs.wifi.currentNetwork()

if newSSID == homeSSID and lastSSID ~= homeSSID then
-- We just joined our home WiFi network
hs.audiodevice.defaultOutputDevice():setVolume(25)
elseif newSSID ~= homeSSID and lastSSID == homeSSID then
-- We just departed our home WiFi network
hs.audiodevice.defaultOutputDevice():setVolume(0)
end

lastSSID = newSSID
end

module.watcher = hs.wifi.watcher.new(ssidChangedCallback)
module.watcher:start()
return module

0 comments on commit 3d6bcf6

Please sign in to comment.