Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions configs/hammerspoon/Spoons/Annotation/docs.json

This file was deleted.

255 changes: 0 additions & 255 deletions configs/hammerspoon/Spoons/Annotation/init.lua

This file was deleted.

4 changes: 0 additions & 4 deletions configs/hammerspoon/Spoons/hotkey-window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@ local function create_hot_key_window(app_name, command_key, key)
else
local win = app:mainWindow()

local activeSpaces = spaces.activeSpaces()

spaces.moveWindowToSpace(win:id(), spaces.activeSpaceOnScreen())
win:focus()
end
end)
end

-- create_hot_key_window("net.ankiweb.dtop", { "cmd", "shift" }, "m")
create_hot_key_window("md.obsidian", { "cmd", "shift" }, "z")
create_hot_key_window("net.kovidgoyal.kitty", { "cmd", "shift" }, "s")
create_hot_key_window("com.hnc.Discord", { "cmd", "shift" }, "d")
-- create_hot_key_window("com.mitchellh.ghostty", { "cmd", "shift" }, "g")
create_hot_key_window("com.google.Chrome", { "cmd", "shift" }, "a")
create_hot_key_window("abnerworks.Typora", { "cmd", "shift" }, "m")
30 changes: 25 additions & 5 deletions configs/hammerspoon/Spoons/tiling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ local windowChooser = function(active_win_id, callback)
end)
-- format for chooser
win_list = hs.fnutils.map(win_list, function(win)
local app = win:application()
local app_name = app and app:name() or ""
local bundle_id = app and app:bundleID() or ""
return {
text = win:title() .. " - " .. win:application():name() .. " - " .. win:application():bundleID(),
subText = win:application():name(),
image = hs.image.imageFromAppBundle(win:application():bundleID()),
text = (win:title() or "") .. " - " .. app_name .. " - " .. bundle_id,
subText = app_name,
image = bundle_id ~= "" and hs.image.imageFromAppBundle(bundle_id) or nil,
value = win:id(),
}
end)
Expand Down Expand Up @@ -45,6 +48,10 @@ hs.hotkey.bind({ "cmd", "shift" }, "h", function()
active_win:setFrame(active_frame)

windowChooser(active_win:id(), function(choice)
if choice == nil then
return
end

local other_frame = {}
other_frame.x = active_frame.x + active_frame.w
other_frame.y = active_frame.y
Expand Down Expand Up @@ -97,6 +104,10 @@ hs.hotkey.bind({ "cmd", "shift" }, "l", function()
active_win:setFrame(active_frame)

windowChooser(active_win:id(), function(choice)
if choice == nil then
return
end

local other_frame = {}
other_frame.x = active_frame.x - active_frame.w
other_frame.y = active_frame.y
Expand All @@ -116,7 +127,16 @@ end)
-- find & focus
hs.hotkey.bind({ "cmd", "shift" }, "f", function()
local activeWindow = hs.window.focusedWindow()
windowChooser(activeWindow:id(), function(choice)
hs.window(choice.value):focus()
local active_win_id = activeWindow and activeWindow:id()
windowChooser(active_win_id, function(choice)
if choice == nil then
return
end

local win = hs.window(choice.value)
if win == nil then
return
end
win:focus()
end)
end)
1 change: 0 additions & 1 deletion configs/hammerspoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ require("hs.ipc")

-- reload config
hs.hotkey.bind({ "cmd", "alt", "ctrl" }, "R", function()
require("Spoons.Annotation").init()
hs.reload()
end)

Expand Down
3 changes: 0 additions & 3 deletions configs/hammerspoon/sketchybar/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
local manager = require("sketchybar.manager")

manager.add_widget(require("sketchybar.widgets.active-app"), { only_init = true })
-- manager.add_widget(require("sketchybar.widgets.battery"), { time = 120 })
-- manager.add_widget(require("sketchybar.widgets.memory"), { time = 120 })
-- manager.add_widget(require("sketchybar.widgets.storage"), { time = 120 })
manager.add_widget(require("sketchybar.widgets.wifi"), { only_init = true })
2 changes: 1 addition & 1 deletion configs/hammerspoon/sketchybar/manager/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ M.add_widget = function(widget, opts)
end

M.remove_widget = function(widget_id)
if not _widgets[widget_id].timer then
if _widgets[widget_id].timer then
_widgets[widget_id].timer:stop()
end
_widgets[widget_id] = nil
Expand Down
Loading
Loading