Add additional key to the window snapping

Turns out I was overriding some macOS goodness. Also dropped the
tooltips from the slack notification since it fell apart with the
bullet.
This commit is contained in:
Josh Sherman 2022-06-03 19:48:14 -05:00
parent d527bf3f02
commit 991426901a
No known key found for this signature in database
GPG key ID: 55B058A80530EF22

View file

@ -26,28 +26,29 @@ end
-- Window Snapping
--------------------------------------------------------------------------------
local modifier = { 'cmd', 'ctrl' }
hs.window.animationDuration = 0
hs.hotkey.bind({ 'cmd' }, 'Left', function()
hs.hotkey.bind(modifier, 'Left', function()
local win = hs.window.focusedWindow()
if not win then return end
win:moveToUnit(hs.layout.left50)
end)
hs.hotkey.bind({ 'cmd' }, 'Right', function()
hs.hotkey.bind(modifier, 'Right', function()
local win = hs.window.focusedWindow()
if not win then return end
win:moveToUnit(hs.layout.right50)
end)
hs.hotkey.bind({ 'cmd' }, 'Up', function()
hs.hotkey.bind(modifier, 'Up', function()
local win = hs.window.focusedWindow()
if not win then return end
win:moveToUnit(hs.layout.maximized)
end)
-- Simulates a 'reset' of the window
hs.hotkey.bind({ 'cmd' }, 'Down', function()
hs.hotkey.bind(modifier, 'Down', function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
@ -110,6 +111,7 @@ local slackMenubar = hs.menubar.new()
slackMenubar:setIcon(slackIconWhite)
slackMenubar:setClickCallback(function()
slackMenubar:setTitle(nil)
hs.application.launchOrFocus('Slack')
end)
@ -125,10 +127,8 @@ function updateSlackMenubar()
if label == '0' then
slackMenubar:setTitle(nil)
slackMenubar:setTooltip('No unread messages')
else
slackMenubar:setTitle(string.format(' %s', label))
slackMenubar:setTooltip(string.format('%s unread message(s)', label))
end
end
end