When working with multiple windows or applications simultaneously, it can be hugely advantageous to be able to switch between these different windows and contexts as fluidly as possible, reducing any friction or downtime.
While this can apply to many types of work, this is certainly the case in development environments. chunkwm is a tiling window manager for macOS that allows users to rapidly switch between application windows, automatically resizing each window based on user preferences or optimized defaults, and many other features that make a modern digital workflow far more seamless.
This blog post will give a walkthrough of setting up chunkwm for Mac OS X, and some of its basic uses.
The easiest way to install chunkwm is via Homebrew. In addition to
chunkwm, we will also need to install
skhd, which is the hotkey daemon for setting up the keyboard shortcuts for chunkwm. We can install both with Homebrew via the following three commands:
brew tap crisidev/homebrew-chunkwm brew install --HEAD --with-tmp-logging chunkwm brew install --HEAD --with-logging koekeishiya/formulae/skhd
Both chunkwm and skhd can also be launched via Homebrew:
brew services start chunkwm brew services start skhd
RC file configuration
Configuration for chunkwm is handled in the
.chunkwmrc file, which should be saved to the home directory (
~). It’s recommended to start with the example template it comes with, saving this as your starting
.chunkwmrc. After setting up the
.chunkwmrc file, you’ll need to add execution permissions to the file. You can do so via the following command:
chmod +x ~/.chunkwmrc
Some settings worth noting in
.chunkwmrc are the offset and gap settings:
chunkc set global_desktop_offset_top 8 chunkc set global_desktop_offset_bottom 8 chunkc set global_desktop_offset_left 8 chunkc set global_desktop_offset_right 8 chunkc set global_desktop_offset_gap 8
These will set the offset in pixels from the sides of the screen, as well as the gap between windows.
skhd, the hotkey daemon, has its own separate config file as well,
.skhdrc. This should also be saved in your home directory.
.skhdrc is where all key bindings for chunkwm will be configured. The project comes with its own starter template, although any of the keybindings can be modified and customized, provided they don’t conflict with any other bindings.
shihanng’s .skhdrc is a good starting place to learn the main functions of chunkwm. It’s recommended to start with their file as an example.
While the commands of chunkwm can be mapped to any keys, it’s very common for key bindings to be similar to those in the Vim text editor. For example in the example
l will navigate left, up right or down to the next window, giving it focus.
n can be used to give focus to the previous or next window.
Similarly window positions can be moved, using the
l keys, in conjunction with
alt. For example, let’s say we has four open windows, each taking up a quarter of the screen. If the bottom right window currently has focus, we can switch the position of this window with the one in the top right by pressing
- Using node-sass to compile Sass files in an npm script
- Some common use cases of Sass
- An introduction to the htaccess file:The Ultimate Guide (2018 Update)
- Bash vs Zsh: A comparison of two command line shells (2018 Update)
- Whats the best SEO friendly CMS?
- Our custom design process
- Using Surge for deploying static sites (2018 Update)
- Designing a simple navigation bar with Bootstrap 4
- Introducing Gutenberg, the new WordPress editor
- Using WOW.js and Animate.css for Scroll-Triggered Animations
- An overview of jQuery Event Methods
- Advanced Features of ECMAScript 6: The Ultimate Guide 2018
- College Scholarships: Offering bi-yearly $500 scholarships
- Sunlight Media wins 2018’s Top Software Developers in the US
- Using A CSS Reset For Better Cross-Browser Compatibility
- Using ImageOptim for reducing image file sizes
- Getting started with Markdown