GithubHelp home page GithubHelp logo

vitaly-z / spin2win Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nik3daz/spin2win

0.0 0.0 0.0 518 KB

My personal Phoenix (kasper/phoenix) configuration, written in TypeScript

License: MIT License

JavaScript 4.61% TypeScript 95.39%

spin2win's Introduction

Phoenix configuration

This is my personal Phoenix configuration, written in TypeScript and forked from mafredri's config.

Overview

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.

Intended Usage

  1. Use modKey + Left/Right to select a monitor
  2. Use modKey + 1-9 to select a workspace
  3. Use modKeyShift + 1-9 to move windows between workspaces
  4. Extra windows on a workspace are stacked to the side. Press modKey + r to 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.

Bindings

  • modKey + 1-9 Select workspace
  • modKeyShift + 1-9 Move focused window to workspace
  • modKey + Left/Right Select left/right monitor
  • modKeyShift + Left/Right Move active window to left/right monitor
  • modKey + r Spin windows on current workspace
  • modKeyShift + r Spin workspaces across monitors
  • modKey + h/l Decrease/increase the main area size
  • modKey + up/down/j/k Focus next/previous window on current workspace
  • modKey + return Add focused window to current workspace
  • modKeyShift + return Add all stray windows of focused app to current workspace (good for collecting apps on first run)
  • modKey + backspace Remove focused window from workspace
  • modKeyShift + c Close focused window
  • modKeyShift + space Rerender current layout. Useful if you drag around windows and can't figure out what belongs where. Or if things go haywire.
  • modKey + a Enable/disable auto-adding windows to current workspace (janky).
  • modKey + m Enable/disable focus follow mouse (janky).

Key bindings

The definition of modKey and modKeyShift can be found in src/config.ts. Otherwise modify keys in phoenix.ts.

Notes

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.

Quick install

git clone https://github.com/nik3daz/spin2win.git
cd spin2win
ln -s `pwd`/out/phoenix.js ~/.phoenix.js 

Building

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.

Debugging

In a terminal, run:

$ log stream --process Phoenix

Anything 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.

spin2win's People

Contributors

mafredri avatar nik3daz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.