Skip to content

Commit

Permalink
before updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danwetherald committed Apr 9, 2024
1 parent 4281e9b commit 705cd22
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 45 deletions.
18 changes: 9 additions & 9 deletions hammerspoon/bindings.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
local hyper = {
'cmd',
'ctrl'
"cmd",
"ctrl",
}

local applicationHotkeys = {
s = 'Spotify',
k = 'kitty',
c = 'Google Chrome'
s = "Spotify",
k = "kitty",
c = "Google Chrome",
}

for key, app in pairs(applicationHotkeys) do
hs.hotkey.bind(hyper, key, function()
hs.application.launchOrFocus(app)
end)
hs.hotkey.bind(hyper, key, function()
hs.application.launchOrFocus(app)
end)
end

-- hs.hotkey.bind({}, "f8", function()
-- hs.spotify.playpause()
-- end)

hs.hotkey.bind(hyper, "escape", function()
hs.reload()
hs.reload()
end)
15 changes: 8 additions & 7 deletions hammerspoon/init.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
require "windows"
require "wifi"
require "brightness"
require "bindings"
require "monitors"
require("windows")
-- require "wifi"
-- require "brightness"
require("bindings")
-- require "monitors"
require("system")

-- Reload automatically on config changes
hs.pathwatcher.new(os.getenv('HOME') .. '/.hammerspoon/', hs.reload):start()
hs.alert('Hammerspoon is locked and loaded', 1)
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", hs.reload):start()
hs.alert("Hammerspoon is locked and loaded", 1)
24 changes: 24 additions & 0 deletions hammerspoon/system.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- Function to perform a POST request
function postWebhook(url, body)
hs.http.asyncPost(url, body, nil, function(status, body, headers)
-- Debug print
print(status, body)
end)
end

-- Function to execute when the system finishes waking from sleep (including login)
function systemDidWake(event)
if event == hs.caffeinate.watcher.systemDidWake then
-- Morning alarm end
-- postWebhook(
-- "https://dlbjm66xta3foy583q9fvl3nruwkujeb.ui.nabu.casa/api/webhook/dan-s-iphone-morning-alarm-ended-7NmRbLaIevl5KoisIR0jcxJw",
-- ""
-- )

-- hs.alert("Morning music has been stopped", 1)
end
end

-- Set up a watcher for system wake events
caffeinateWatcher = hs.caffeinate.watcher.new(systemDidWake)
caffeinateWatcher:start()
10 changes: 5 additions & 5 deletions nvim_custom/configs/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ local configs = require("plugins.configs.lspconfig")
local on_attach = configs.on_attach
local capabilities = configs.capabilities

local lspconfig = require "lspconfig"
local lspconfig = require("lspconfig")
local servers = { "html", "cssls", "clangd", "tailwindcss", "ruby_ls" }

for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
lspconfig[lsp].setup({
on_attach = on_attach,
capabilities = capabilities,
})
end
48 changes: 24 additions & 24 deletions nvim_custom/configs/null-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ local present, null_ls = pcall(require, "null-ls")
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})

if not present then
return
return
end

local formatting = null_ls.builtins.formatting
local diagnostics = null_ls.builtins.diagnostics

local sources = {
-- formatting
formatting.rubocop,
formatting.stylua,
formatting.prettier,
formatting.erb_format,
-- formatting
formatting.rubocop,
formatting.stylua,
formatting.prettier,
formatting.erb_format,

-- diagnostics
diagnostics.rubocop,
-- diagnostics
diagnostics.rubocop,
}

null_ls.setup {
debug = true,
sources = sources,
on_attach = function(client, bufnr)
if client.supports_method "textDocument/formatting" then
vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr }
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format { async = true, bufnr = bufnr, timeout_ms = 5000 }
end,
})
end
end,
}
null_ls.setup({
debug = true,
sources = sources,
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ async = true, bufnr = bufnr, timeout_ms = 5000 })
end,
})
end
end,
})
1 change: 1 addition & 0 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ alias rest="timer 10m && terminal-notifier -message 'Pomodoro'\
alias gtbc="cd ~/Developer/better-cart/v3/better_cart"

export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Expand Down

0 comments on commit 705cd22

Please sign in to comment.