s1ngs1ng / hammerspoon Goto Github PK
View Code? Open in Web Editor NEW😌HammerSpoon config file, 💻Window Management, 🎵VOX, VIM-binding #KillThe🐁
License: MIT License
😌HammerSpoon config file, 💻Window Management, 🎵VOX, VIM-binding #KillThe🐁
License: MIT License
Hi,
I was wondering would you be able to make following work as well.
snap back to original size/position ?
move the window to next desktop ?
I was wondering would it be able to get the window send to quarter of the screen, meaning if I have iTerm2 and 4 of them open i can equally send them to each corner. ( hope that make sense.)
Also I noticed that sometimes 2 different apps don't align properly see the image.
but also if you have multiple apps as well.
thanks heaps.
lx
I'll use left as an example, but the same applies to right
The idea is you keep pushing the half maximized window to the left wrapping around the screens as needed.
Imagine you have 2 monitors M1, M2. They have a L side and a R side. Graphically:
M1_L | M1_R | M2_L | M2_R
If your window is in M1_R, and you press the hotkey 6 times you'd go through this sequences
M1_R
M2_L
M2_R
M1_L
M1_R
etc
ps. This is how windows does it.
module.throwLeft = function ()
local this = windowMeta.new()
print(1); // 代码走到了这里,似乎是下一行没有生效。
this.window:moveOneScreenWest()
end
macOS: 10.15.3
Hammerspoon: 0.9.77
还带按了的快捷键,很帅。谢谢先。
I install mac qq before some days.
I like ur software but with one problem
I use shortcut to move mac qq from one display to another, there is a very long lag
may be one issue?
A Hammerspoon configurations should be there that changes my device volume to say 25 when a particular device is connected. When it gets disconnected the volume should change to 0.
HammerSpoon/window-management.lua
Line 56 in c75592e
current = {}
function init()
current.win = hs.window.focusedWindow()
current.scr = hs.window.focusedWindow():screen()
end
function current:new()
init()
o = {}
setmetatable(o, self)
o.window, o.screen = self.win, self.scr
o.screenGrid = grid.getGrid(self.scr)
o.windowGrid = grid.get(self.win)
return o
end
vs
local grid = require 'hs.grid'
local win = require 'hs.window'
local windowMeta = {}
setmetatable(windowMeta, {
__call = function (cls, ...)
return cls.new(...)
end,
})
function windowMeta.new()
local self = setmetatable({}, windowMeta)
self.window = win.focusedWindow()
self.screen = self.window:screen()
self.windowGrid = grid.get(self.window)
self.screenGrid = grid.getGrid(self.screen)
return self
end
return windowMeta
What's wrong with this? I don't have a ton of Lua under my belt, so I might be missing something. I don't see why you are creating an extra object o
in your current code?
window-management.lua:105: in function 'window-management.leftHalf'
LuaSkin: hs.hotkey callback: window-management.lua:105: field 'setShadows' is not callable (a nil value)
如果有此功能,可以花500块钱买。上下左右,4个45度方向。
Hi @S1ngS1ng
First of all, thank you very much for making this highly useful window management spoon. Wanted to report some issues that have been popping up lately. For context, I have two external monitors connected to a Macbook Pro. Both the external monitors are identical in make. I have set one of the External monitors as the main display followed by the second external as the extended display on the right, followed by the built-in retina display further to the right.
My issue is on the Main display, the wm.throwLeft
and wm.throwRight
don't work for all apps. Interestingly I am able to throw apps fine between the second and the third displays.
Moreover, on the main display, the move window to screen
feature works fine for apps like VS Code.
Hope the screencasts below are helpful:
Would appreciate any ideas on what could be wrong.
Cheers.
脚本中 ctrl + hjkl 是方向键。
还是习惯用 capslock + awsd 来代替方向键。
不知道如何修改脚本?
多谢。
#Question
There used to be an app called Afloat (and then AfloatX) that did this, but they don't work anymore. Is it possible to use Hammerspoon in this WM system to keep a window/app on top? It'd really help.
I LOVE the functionality but need to use different keybindings. An easy way for me to do this would be to require your "business logic files", but not your binding files. So for example:
window-management.lua splits into two files, something like:
window-management-logic.lua
window-management-bindings.lua
Then windows-management-logic would return the window functionality like:
return {
-- ...
leftHalf = leftHalf,
rightHalf = rightHalf,
-- ...
}
ps - awesome functionality!
感谢您的配置文件, 想请教您一下, 这个字母键不能替换为数字键是吧
I integrated your throw screen left & right super easily from your code.
Many thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.