This is my personal Phoenix configuration, written in TypeScript and forked from mafredri's config.
This config provides per-monitor virtual desktops. I use it with my laptop monitor + an external monitor. It's a reimplementation of my xmonad setup at work.
- Use
modKey + Left/Rightto select a monitor - Use
modKey + 1-9to select a workspace - Use
modKeyShift + 1-9to move windows between workspaces - Extra windows on a workspace are stacked to the side. Press
modKey + rto cycle through the windows on a workspace.
This setup allows you assign your apps to workspaces, and quickly retrieve them wherever you're looking. And if you have a lot of Chrome windows like I do, you can just cycle through them to find the right one.
modKey + 1-9Select workspacemodKeyShift + 1-9Move focused window to workspacemodKey + Left/RightSelect left/right monitormodKeyShift + Left/RightMove active window to left/right monitormodKey + rSpin windows on current workspacemodKeyShift + rSpin workspaces across monitorsmodKey + h/lDecrease/increase the main area sizemodKey + up/down/j/kFocus next/previous window on current workspacemodKey + returnAdd focused window to current workspacemodKeyShift + returnAdd all stray windows of focused app to current workspace (good for collecting apps on first run)modKey + backspaceRemove focused window from workspacemodKeyShift + cClose focused windowmodKeyShift + spaceRerender current layout. Useful if you drag around windows and can't figure out what belongs where. Or if things go haywire.modKey + aEnable/disable auto-adding windows to current workspace (janky).modKey + mEnable/disable focus follow mouse (janky).
The definition of modKey and modKeyShift can be found in src/config.ts. Otherwise modify keys in phoenix.ts.
The active monitor is defined by the mouse position.
Focus follows the mouse but can be turned off temporarily by holding modKey or permanently in config.ts.
Some apps do random things on focus, like focusing all their windows. This whole thing is a bit janky. You might need custom hacks to get a good experience =( But it mostly works. Rerendering or mashing modKey + Up/Down fixes a lot of issues.
Weird interaction with holding down keys to show accented letters. Run defaults write -g ApplePressAndHoldEnabled -bool false and reboot to disable.
git clone https://github.com/nik3daz/spin2win.git
cd spin2win
ln -s `pwd`/out/phoenix.js ~/.phoenix.js
git clone https://github.com/nik3daz/spin2win.git
cd spin2win
yarn install
yarn run build
The TypeScript compiler and Webpack will produce out/phoenix.js that can be used as Phoenix configuration.
For development, yarn start will run Webpack in watch-mode. The window manager state is stored across reloads for better continuous development. Comment out the loadState() call if things get borked.
In a terminal, run:
$ log stream --process PhoenixAnything logged via logger (import log from './logger';) will show up as human friendly output in the terminal. Phoenix.log can also be used, but it only supports strings, much of the heavy lifting is already done by logger to create a similar experience to console.log in the browser.
You can also read about Attaching to Web Inspector for Debugging in the Phoenix wiki. This gives access to true console.log and ability to use debugger statements in your code.