Coder Social home page Coder Social logo

fabiospampinato / phoenix Goto Github PK

View Code? Open in Web Editor NEW
401.0 8.0 50.0 26.49 MB

My Phoenix setup. Powerful, easy to customize, tuned for web development, adds a space switcher.

License: MIT License

JavaScript 99.68% Shell 0.32%
phoenix macos spaces switcher developer-tools productivity

phoenix's Introduction

Phoenix

My Phoenix setup. Powerful, easy to customize, tuned for web development, adds a space switcher.

Installation

This configuration uses a remap of the Caps Lock key to something more useful: the Hyper key (basically just Ctrl + Alt + Cmd combined into one key) if used in combination with other keys, otherwise it gets mapped to F18, which is used to trigger the space switcher. If you prefer you may skip these remap steps while you try the configuration, but if you usually have many spaces opened I highly recommend you not to miss out the awesome space switcher, for which this hack is a requirement.

  1. Install Phoenix
  2. Install Karabiner Elements via its dmg
  3. Replace Caps Lock with Hyper/F18 using this Karabiner Elements configuration (if the link doesn't work copy and paste this in a browser: karabiner://karabiner/assets/complex_modifications/import?url=https%3A%2F%2Fraw.githubusercontent.com%2Ffabiospampinato%2Fphoenix%2Fmaster%2Fconfig%2Fkarabiner.json)
  4. $ mkdir ~/.config
  5. $ cd ~/.config
  6. $ git clone [email protected]:fabiospampinato/phoenix.git
  7. Restart Phoenix
  8. Enjoy!

Customization

To disable specific features, just comment out their correspondent require call in phoenix.js.

To tweak some numbers, simply edit constants.js.

Changing the specific shortcut used to trigger an action is pretty trivial.

Don't forget to make a PR if you fixed something or implemented something cool :)

Shortcuts

Sides

Sides

Shortcut Description
⇪ + ↑ Move window to the top side
⇪ + → Move window to the right side
⇪ + ↓ Move window to the bottom side
⇪ + ← Move window to the left side

Corners

Corners

Shortcut Description
⇪ + Q Move window to the top-left corner
⇪ + W Move window to the top-right corner
⇪ + S Move window to the bottom-right corner
⇪ + A Move window to the bottom-left corner

Halves

Halves

Shortcut Description
⇪ + [ Move window to the 1st half
⇪ + ] Move window to the 2nd half

Thirds

Thirds

Shortcut Description
⇪ + 1 Move window to the 1st column
⇪ + 2 Move window to the 2nd column
⇪ + 3 Move window to the 3rd column

Sixths

Sixths

Shortcut Description
⇪ + Shift + Q Move window to the 1st sixth
⇪ + Shift + W Move window to the 2nd sixth
⇪ + Shift + E Move window to the 3rd sixth
⇪ + Shift + A Move window to the 4th sixth
⇪ + Shift + S Move window to the 5th sixth
⇪ + Shift + D Move window to the 6th sixth

Center

Center

Shortcut Description
⇪ + X Center the window
⇪ + Shift + X Center the window and set its dimensions to 1280x800

Grow

Grow

Shortcut Description
⇪ + Shift + ↑ Grow window from the top
⇪ + Shift + → Grow window from the right
⇪ + Shift + ↓ Grow window from the bottom
⇪ + Shift + ← Grow window from the left

Expand

Expand

Shortcut Description
⇪ + Space Toggle window expansion to fill the space
⇪ + Shift + Space Toggle window expansion to fullscreen

Focus or Open

Focus or Open

Shortcut Description
⇪ + ` Focus to or open Notable
⇪ + C Focus to or open Chrome
⇪ + D Focus to or open Chrome Developer Tools
⇪ + V Focus to or open Visual Studio Code
⇪ + F Focus to or open Finder
⇪ + T Focus to or open Terminal
⇪ + G Focus to or open GitTower

Spaces

Spaces

In order to make this work you have to open System Preferences -> Keyboard -> Shortcuts -> Mission Control and bind all Switch to Desktop [NUMBER] actions to Ctrl + Alt + Cmd + Shift + [NUMBER]. There are actions up to the 9th desktop, but they may not be shown to you if you have less then 9 desktops currently open.

Note: If you don't need wrapping support, you should just remap the Move left/right a space actions under System Preferences -> Keyboard -> Shortcuts -> Mission Control.

Shortcut Description
⇪ + Tab Switch to the next space
⇪ + Shift + Tab Switch to the previous space

Applications Icons

Applications Icons

Shortcut Description
⇪ + I For each window in the current space show an icon indicating its position
⇪ + Shift + I Display the current date and time

Reload Phoenix

Reload Phoenix

Shortcut Description
⇪ + Shift + P Reload Phoenix

Pause/Resume Application

Pause/Resume Application

This can be used for saving battery, pausing single-player games etc.

Shortcut Description
⇪ + F8 Pause or resume the current application

Quit Application

Quit Application

Did you ever close 3+ Chrome windows instead of a single tab by mistake? Fear no more! Now in order to quit an app you have to trigger ⌘Q twice in a short timeframe. Stop wasting 10$ for something so basic.

Shortcut Description
⌘Q ⌘Q Quit application

Split View

//TODO: Unfortunately there's no API available for doing this at the moment, that's a shame given that I would have finally found a use for the § key, it looks like 2 S => Side-by-Side :D

Shortcut Description
⇪ + § If there are only 2 windows in the current space put them in split view

Mouse

Snapping

Snapping

Drag a window to an edge or corner to snap it into place.

Magic

Chrome

If it gets opened, positionate it to the left side.

Chrome Developer Tools

If it gets opened, positionate it to the bottom-right corner, and shrink Visual Studio Code's height a bit, so that the console will be visible.

If it gets closed, restore Visual Studio Code's height.

Terminal/iTerm2/Finder

If one of these apps' windows gets opened, positionate it to bottom-left corner.

Visual Studio Code

If it gets opened, positionate it to the right side.

Space Switcher

Space Switcher

This is the truly great addition to what was already available on the internet.

It combines Phoenix, Alfred and alfred-spaces-workflow into the space switcher macOS deserves but never had, always just a double Hyper ( ) away.

This is how it works:

  • It uses Phoenix to compile a list of your spaces
  • It tries to guess a name for those spaces, by default that would be the name of the folder opened in the Visual Studio Code instance present in that space (get_space_name.js)
  • Refreshes the list and those guessed names when necessary
  • Listens for the double Hyper ( ) shortcut
  • Opens Alfred and triggers alfred-spaces-workflow
  • Which reads the list of spaces compiled with Phoenix and displays it to you
  • Now just select a space to switch to

In order to make this work you have to open System Preferences -> Keyboard -> Shortcuts -> Mission Control and bind all Switch to Desktop [NUMBER] actions to Ctrl + Alt + Cmd + Shift + [NUMBER]. There are actions up to the 9th desktop, but they may not be shown to you if you have less then 9 desktops currently open.

Note: There's no API available for retrieving windows from other spaces, therefor other spaces' guessed names won't be refreshed until you visit them. The very first time you load Phoenix you might want to switch the focus to all of them, one by one, to have their names updated.

License

MIT © Fabio Spampinato

phoenix's People

Contributors

fabiospampinato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phoenix's Issues

Safari 15 not working

Hey, i love your phoenix setup and i use it all the time, since updating to Safari 15 (using Safari Technology Preview) it stoped working and i can't make it to work.

is this a known issue?

Center window on multiple screens always puts the window on the first screen.

to fix change in helpers/center_window.js

line 11 and 12 from

    x: ( sFrame.width / 2 ) - ( wFrame.width / 2 ),
    y: ( sFrame.height / 2 ) - ( wFrame.height / 2 ),

to

    x: sFrame.x + ( sFrame.width / 2 ) - ( wFrame.width / 2 ),
    y: sFrame.y + ( sFrame.height / 2 ) - ( wFrame.height / 2 ),

With that fix though I have found still one issue - if the main screen is not centered relative to the peripheral screen, it is not exactly centered, but offset slightly. - But that's probably not an issue of the config, but rather phoenix itself.

Improve multi-monitor support

There are a few problems when using this configuration in a multi-monitor setup, especially if those are arranged on the Y axis. I suspect some of them come from bugs in Phoenix itself. I think some of these problems won't happen if the monitors have all the same resolution and aren't arranged weirdly:

  • Modals aren't centered properly.
  • Centering windows may not work.
  • Growing windows may not work.

Error messages upon save of configuration

As soon as I open Phoenix or save the main phoenix.js config file, I get

image

Commenting out spaces-related configs does not solve it. In fact, the only way I have found to avoid the error message is to comment out everything except the top 2 require lines.

I have not been able to find the log files, so I have not been able to get any information from them about the nature of the problem. (There are no logs related to Phoenix in ~/Library/Logs or in ~/.config/phoenix, and I'm not sure where else to look.)

🤦‍♂️ D'oh! Console.log.... okay.... looking....

Okay, with the spaces-related stuff commented out, I get this:

1/19/18 12:36:16.788 PM Phoenix[287]: SyntaxError: Unexpected identifier 'hashes' (4:8)

ag tells me that hashes is in magic/developer_tools.js. Opening it shows me:

/* DEVELOPER TOOLS */

let hashes = [];

Since let is more recent, I would expect Babel to be used as the processor for your config file, but I don't see any shebang line with babel in the main phoenix.js file (or in magic/developer_tools.js). Once I add the shebang line, and install babel globally, I get:

1/19/18 1:14:36.691 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.692 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.694 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.696 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.698 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.700 PM Phoenix[287]: SyntaxError: Unexpected token '>' (6:8)
1/19/18 1:14:36.701 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.703 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.709 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.710 PM Phoenix[287]: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (4:8)
1/19/18 1:14:36.712 PM Phoenix[287]: SyntaxError: Unexpected token ')' (4:8)
1/19/18 1:14:36.714 PM Phoenix[287]: ReferenceError: Can't find variable: setHandlers (11:12)
1/19/18 1:14:36.716 PM Phoenix[287]: SyntaxError: Unexpected token ')' (6:8)
1/19/18 1:14:36.717 PM Phoenix[287]: SyntaxError: Unexpected token '>' (17:8)
1/19/18 1:14:36.719 PM Phoenix[287]: SyntaxError: Unexpected token ')' (4:8)
1/19/18 1:14:36.721 PM Phoenix[287]: SyntaxError: Unexpected token ')' (4:8)
1/19/18 1:14:36.722 PM Phoenix[287]: ReferenceError: Can't find variable: setHandlers (11:12)
1/19/18 1:14:36.724 PM Phoenix[287]: ReferenceError: Can't find variable: setHandlers (9:12)
1/19/18 1:14:36.726 PM Phoenix[287]: ReferenceError: Can't find variable: setHandlers (11:12)
1/19/18 1:14:36.727 PM Phoenix[287]: SyntaxError: Unexpected identifier 'lastQuitTimestamp' (4:8)
1/19/18 1:14:36.729 PM Phoenix[287]: SyntaxError: Unexpected token ')' (4:8)
1/19/18 1:14:36.730 PM Phoenix[287]: SyntaxError: Unexpected token ')' (4:8)
1/19/18 1:14:36.732 PM Phoenix[287]: ReferenceError: Can't find variable: setHandlers (10:12)
1/19/18 1:14:36.734 PM Phoenix[287]: SyntaxError: Unexpected identifier 'hashes' (4:8)
1/19/18 1:14:36.740 PM Phoenix[287]: Context loaded.

Could you share your goku configuration for karabiner?

Hi,

I saw there's no dotfiles repo in your profile and i was wondering whether you could share the goku config to integrate into mine, instead of importing yours (which may collide with some of my config)

thank you!

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.