
Show HN: Phoenix 2.6 – a macOS window and app manager scriptable with JavaScript - khirviko
https://github.com/kasper/phoenix/
======
fabiospampinato
I spent quite a bit of time writing my configuration for Phoenix, if you're
thinking about writing your own I think you might find starting from mine
useful.

It's easy to customize, there are gifs in the readme, and it comes packed with
features, I hope you'll like it:

[https://github.com/fabiospampinato/phoenix](https://github.com/fabiospampinato/phoenix)

~~~
dangson
This is fantastic! The readme with animated GIF's is really helping me learn
the shortcuts. Thanks for sharing.

~~~
fabiospampinato
I'm glad you like it! :D

------
tambourine_man
After many ours spent on several scriptable window managers I've settled on
Spectacle, which is a lot less powerful, but proved to be enough for me, while
being dead easy and hassle free.

~~~
jaaames
Ditto. It's brilliant and one of the things stopping me switching to linux at
this point.

------
xemoka
I use MacOS at home and happily use Hammerspoon to manage these interactions,
in the past using Slate—I use Windows at work and I really wish it had
something better than AutoHotKey: is this just something I'm unaware of or
does the design of windows really hamper the creation of tools like these?

------
mafredri
I've been using Phoenix for 2 years straight and it's been pretty smooth
sailings. Kasper has done an excellent job maintaining and implementing new
features every once in a while, thanks Kasper!

My personal configuration is written in TypeScript and I maintain typings for
Phoenix as well. I try to find ways to improve my every-day and implement them
in Phoenix, things like: moving/resizing windows, coffee timer, monitor
brightness, terminal hotkey, etc. In the past I've used it to track what
applications I spend my time in or to automatically switch Karabiner-Element
profiles based on which monitor is connected. If you're looking for
inspiration, feel free to have a look:

[https://github.com/mafredri/phoenix-
config](https://github.com/mafredri/phoenix-config)

[https://github.com/mafredri/phoenix-
typings](https://github.com/mafredri/phoenix-typings)

------
partycoder
I used Spectacle:
[https://www.spectacleapp.com/](https://www.spectacleapp.com/)

It is not scriptable but gets the job done.

------
acmecorps
I have a 34" 1440p screen and I use Mozaic.app
([https://www.lightpillar.com/mosaic.html](https://www.lightpillar.com/mosaic.html))
for managing my windows. Usually, i'll divide my windows as either 1:1, 1:2:1
or 1:4 sizes. It's pretty useful as I can use keyboard shortcuts to position
my windows. Is there any added benefits that I can get by using phoenix or
hammerspoon?

~~~
xemoka
As a hammerspoon user, probably not if that's all you're using it for.
Hammerspoon does add a bunch of extra features mosaic doesn't add—but if you
don't need them and you've already invested in software to solve your problem:
not likely.

~~~
acmecorps
If you don't mind, what are the use cases that makes hammerspoon very useful
for you?

~~~
xemoka
Basically the same reason you're using mosaic + the ability to change what
exactly is being done. I use it to map 'hyper'+key (where hyper is the
equivalent of ctrl+cmd+shift+option and is assigned to control, capslock is
assigned to the original control functionality) to move windows between
screens and on their own grid. Effectively I just didn't pay for mosaic-like
functionality. I have better touch tool, but I never liked having to drag to
snap and had hammerspoon implemented already.

------
asselinpaul
I've been enjoying chunkwm as a tiling WM. Hard to go back to non-tiling when
you've experienced it.

[https://github.com/koekeishiya/chunkwm](https://github.com/koekeishiya/chunkwm)

~~~
RBerenguel
I’ve tried tiling WM (well, MacOS’ Amethyst, before that used kwm for a while,
used fluxbox a long time ago on arch which can be used with tiling) but still
can’t get the “why”, they don’t help my process and mostly stand on my way.
Anything I’m missing? What do you find so changing?

~~~
asselinpaul
A few reasons: \- I know what is going to happen when I open anything and can
get things where they need to be very quickly (since it is keyboard driven).

\- The wm is working with me to use the entire screen.

\- You can always revert to making windows float if you need it.

\- You can use supporting terminal with no title bar which saves space (see
here
[https://www.dropbox.com/s/0f08qa0dbhhc6nv/Screen%20Shot%2020...](https://www.dropbox.com/s/0f08qa0dbhhc6nv/Screen%20Shot%202018-04-08%20at%2018.41.15.png?dl=0))

It is occasionally annoying when something doesn't behave as expected but its
a fun tool to use in general.

~~~
innocentoldguy
Can you configure the margins between those three terminal windows? I
currently use Tmux with one fullscreen terminal to achieve a similar effect,
but this looks interesting too. I'd like to eliminate any margins though. A
one-pixel border is all I would want.

~~~
asselinpaul
Absolutely. You can configure everything (global padding, inter-tile padding
etc...)

------
stblack
This is so well done.

I've looked at some links to examples in the wiki:
[https://github.com/kasper/phoenix/wiki#examples](https://github.com/kasper/phoenix/wiki#examples)

...and Garrow Bedrossian's config: [https://github.com/garrow/phoenix-
configurations](https://github.com/garrow/phoenix-configurations)

...is da bomb!

Others look very good too.

~~~
saagarjha
Hacker News don't do Markdown style links.

------
kemar
I used Phoenix to reimplement some features of MercuryMover
[https://github.com/kemar/phoenix-mercury-
mover](https://github.com/kemar/phoenix-mercury-mover) You can almost do what
you want with Phoenix. I'm a huge fan

------
Osiris
If you prefer a tiling window manager that is automatic, check out
[https://github.com/ianyh/Amethyst](https://github.com/ianyh/Amethyst) .

------
slowhands
Just a quick question for current Phoenix users — how is the multiple monitor
performance? By that I mean a situation where I'm going from just the MacBook
screen to three monitors on one desk to four monitors on another desk. Will it
automatically detect how many monitors are present, without having to resort
to hardware-specific configurations? This is a killer feature for me on
Hammerspoon, but I much rather script with JS than Lua, out of familiarity.

~~~
mafredri
I'm not entirely sure what you mean with performance, macOS is pretty sluggish
at reacting to new monitors anyway.

That said, Phoenix has an event for when the screens change, you can use it to
react, enumerate the new screens, etc. Something like:

Event.on('screensDidChange', () => { const sizes = Screen.all().map(s =>
s.flippedVisibleFrame()); })

Hope that helps!

------
Improvotter
I moved from MacOS to Linux for my desktop machine and still use a Macbook
with MacOS on the go. I've tried chunkwm, Spectacle, and a few odd ones on
GitHub. But none really come anywhere close to something like i3 on Linux if
you're looking for a good window manager. MacOS is just too limited if you
really want to have a predefined setup of (work)spaces and window regions.

~~~
eivarv
Have you tried Amethyst[0]? It's a dynamic, automatic tiling WM for macOS; I
enjoy it very much.

[0]: [https://ianyh.com/amethyst/](https://ianyh.com/amethyst/)

------
maksimum
Is anyone aware of configurations that mimic i3wm using Phoenix/Hammerspoon or
modifications to Amethyst?

------
kram8
That’s nice! Does anyone already have an example to just add Windows like ALT
+ Tab like behavior? Thx!

~~~
olliej
How does windows alt tab differ from cmd tab? (Mostly out of curiosity)

------
atopuzov
How does it compare to hammerspoon?

~~~
saagarjha
It looks like this just does window management, rather than the many things
that Hammerspoon supports.

~~~
khirviko
Yes! Though I’ve seen people extending the support in Phoenix cleverly by
using the Task API. Basically you can run any external processes or scripts.

------
fouc
Wow. The named spaces switcher seems promising to me.

I think it would be great to have custom names for spaces, and assign various
apps to each space, and then be able to log the time spent in each space to a
text file.

------
mi100hael
Is this related at all to Slate
([https://github.com/jigish/slate](https://github.com/jigish/slate)), which
also has a JS API?

~~~
khirviko
In many conceptual ways, such as sharing the same language for configuration,
though this is a completely different project so they don’t share the same
origin. Slate has become rather abandoned and unsupported nowadays. Phoenix
hopefully continues strong in this area.

~~~
marstall
still works nicely though, i will add (slate)

------
PowerGuido87
This is really cool. Is there anything like that for Windows?

~~~
jkcjkc82
AutoIT is similar to this.

------
azhenley
I've been shopping around for something like this. I currently just use
BetterTouchTool with Windows-like shortcuts for window management.

------
Vosporos
Hahaha lol I thought Phoenix Framework had suddenly jumped from 1.3 to 2.6

~~~
khirviko
Hah. :)

------
guzik
Is it possible to set window 'Always on Top' with Phoenix?

~~~
saagarjha
I don't think this is something you can do to windows you don't own.

