Skip to content

Commit

Permalink
First Draft of a workspace chooser
Browse files Browse the repository at this point in the history
I am... _really_ in love with this idea.

There's much to refactor, but I can define predefined workspaces that I
want to enter. Other things I could do...

- close apps that don't need to be part of that kind of work...(like
  closing distractions before entering a meeting)
- start time tracking for certain activities

I know that I'm going to do more here, and I'm super excited about it.
  • Loading branch information
evantravers committed May 8, 2020
1 parent 551c992 commit 5119ec7
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions init.lua
Expand Up @@ -114,3 +114,57 @@ hyper:bind({}, 'v', nil, function()
tabjump("lucidchart.com|figma.com")
end
end)

hyper:bind({}, 'q', nil, function()
local choices = {
{
["text"] = "Review",
["subText"] = "Setup a Things 3 Review Session",
["func"] = "review",
},
{
["text"] = "Plan a Focus Budget",
["subText"] = "Setup Things 3 and Fantastical",
["func"] = "focus_budget",
},
}
local chooser = hs.chooser.new(function(choice)
if choice["func"] == "review" then
hs.application.launchOrFocusByBundleID('com.culturedcode.ThingsMac')
local things = hs.application.find('com.culturedcode.ThingsMac')

local today = things:focusedWindow()
today:moveToUnit(hs.layout.right30)
today:application():selectMenuItem("Hide Sidebar")
today:application():selectMenuItem("Today")
today:application():selectMenuItem("New Things Window")

local workspace = things:focusedWindow()
workspace:moveToUnit(hs.layout.left70)
workspace:application():selectMenuItem("Show Sidebar")
workspace:application():selectMenuItem("Anytime")
end

if choice["func"] == "focus_budget" then
hs.application.launchOrFocusByBundleID('com.culturedcode.ThingsMac')
hs.application.launchOrFocusByBundleID('com.flexibits.fantastical2.mac')

local things = hs.application.find('com.culturedcode.ThingsMac')
local fantastical = hs.application.find('com.flexibits.fantastical2.mac')

local today = things:focusedWindow()
today:moveToUnit(hs.layout.right30)
today:application():selectMenuItem("Hide Sidebar")
today:application():selectMenuItem("Today")

local cal = fantastical:focusedWindow()
cal:moveToUnit(hs.layout.left70)
cal:application():selectMenuItem("Hide Sidebar")
cal:application():selectMenuItem("By Week")
end
end)

chooser:choices(choices)
chooser:show()
end)

0 comments on commit 5119ec7

Please sign in to comment.