• Stars
    star
    434
  • Rank 100,274 (Top 2 %)
  • Language
    Lua
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 27 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tiled scrollable window manager for MacOS

PaperWM.spoon

Tiled scrollable window manager for MacOS. Inspired by PaperWM.

Spoon plugin for HammerSpoon MacOS automation app.

Demo

paperwm_spoon_demo.mp4

Installation

  1. Clone to Hammerspoon Spoons directory: git clone https://github.com/mogenson/PaperWM.spoon ~/.hammerspoon/Spoons/PaperWM.spoon.

  2. Open System Preferences -> Mission Control. Uncheck "Automatically rearrange Spaces based on most recent use" and check "Displays have separate Spaces".

Screen Shot 2022-01-07 at 14 10 11

Usage

Add the following to your ~/.hammerspoon/init.lua:

PaperWM = hs.loadSpoon("PaperWM")
PaperWM:bindHotkeys({
    -- switch to a new focused window in tiled grid
    focus_left  = {{"ctrl", "alt", "cmd"}, "left"},
    focus_right = {{"ctrl", "alt", "cmd"}, "right"},
    focus_up    = {{"ctrl", "alt", "cmd"}, "up"},
    focus_down  = {{"ctrl", "alt", "cmd"}, "down"},

    -- move windows around in tiled grid
    swap_left  = {{"ctrl", "alt", "cmd", "shift"}, "left"},
    swap_right = {{"ctrl", "alt", "cmd", "shift"}, "right"},
    swap_up    = {{"ctrl", "alt", "cmd", "shift"}, "up"},
    swap_down  = {{"ctrl", "alt", "cmd", "shift"}, "down"},

    -- position and resize focused window
    center_window = {{"ctrl", "alt", "cmd"}, "c"},
    full_width    = {{"ctrl", "alt", "cmd"}, "f"},
    cycle_width   = {{"ctrl", "alt", "cmd"}, "r"},
    cycle_height  = {{"ctrl", "alt", "cmd", "shift"}, "r"},

    -- move focused window into / out of a column
    slurp_in = {{"ctrl", "alt", "cmd"}, "i"},
    barf_out = {{"ctrl", "alt", "cmd"}, "o"},

    -- switch to a new Mission Control space
    switch_space_1 = {{"ctrl", "alt", "cmd"}, "1"},
    switch_space_2 = {{"ctrl", "alt", "cmd"}, "2"},
    switch_space_3 = {{"ctrl", "alt", "cmd"}, "3"},
    switch_space_4 = {{"ctrl", "alt", "cmd"}, "4"},
    switch_space_5 = {{"ctrl", "alt", "cmd"}, "5"},
    switch_space_6 = {{"ctrl", "alt", "cmd"}, "6"},
    switch_space_7 = {{"ctrl", "alt", "cmd"}, "7"},
    switch_space_8 = {{"ctrl", "alt", "cmd"}, "8"},
    switch_space_9 = {{"ctrl", "alt", "cmd"}, "9"},

    -- move focused window to a new space and tile
    move_window_1 = {{"ctrl", "alt", "cmd", "shift"}, "1"},
    move_window_2 = {{"ctrl", "alt", "cmd", "shift"}, "2"},
    move_window_3 = {{"ctrl", "alt", "cmd", "shift"}, "3"},
    move_window_4 = {{"ctrl", "alt", "cmd", "shift"}, "4"},
    move_window_5 = {{"ctrl", "alt", "cmd", "shift"}, "5"},
    move_window_6 = {{"ctrl", "alt", "cmd", "shift"}, "6"},
    move_window_7 = {{"ctrl", "alt", "cmd", "shift"}, "7"},
    move_window_8 = {{"ctrl", "alt", "cmd", "shift"}, "8"},
    move_window_9 = {{"ctrl", "alt", "cmd", "shift"}, "9"}
})
PaperWM:start()

Feel free to customize hotkeys or use PaperWM:bindHotkeys(PaperWM.default_hotkeys) for defaults.

PaperWM:start() will begin automatically tiling new and existing windows. PaperWM:stop() will release control over windows.

Set PaperWM.window_gap to the number of pixels to space between windows and the top and bottom screen edges.

Overwrite PaperWM.window_filter to ignore specific applications. For example:

PaperWM.window_filter = PaperWM.window_filter:setAppFilter("Finder", false)
PaperWM:start() -- restart for new window filter to take effect

Limitations

MacOS does not allow a window to be moved fully off-screen. Windows that would be tiled off-screen are placed in a margin on the left and right edge of the screen. They are still visible and clickable.

It's difficult to detect when a window is dragged from one space or screen to another. Use the move_window_N commands to move windows between spaces and screens.

Arrange screens vertically to prevent windows from bleeding into other screens.

Screen Shot 2022-01-07 at 14 18 27

More Repositories

1

lua-macos-app

A sample GUI Lua REPL, showing how to bundle LuaJIT into a self-contained MacOS app
Lua
74
star
2

ploot

Plot streaming data from stdin to a tty terminal
Rust
60
star
3

fitbit-heart-rate-service

Fitbit OS watch app + Android app to create a mock Bluetooth heart rate monitor for fitness equipment
Kotlin
25
star
4

async.h

async/await C macros
C
20
star
5

flipperzero-waveshare-nfc

Write to a Waveshare e-Paper Tag over NFC with a Flipper Zero
Rust
16
star
6

ctrl2esc

Like caps2esc, but for Chrome OS
JavaScript
14
star
7

trinket-m0

Building an embedded Rust application on top of the ASF4 C vendor library
C
14
star
8

USBTempLogger

A two component USB temperature data logger made from a PIC16F1455
C
13
star
9

firefly-jar

KiCad sources for solar rechargeable flickering mason jar lamp
KiCad Layout
12
star
10

Swipe.spoon

Swipe gesture detection for HammerSpoon
Lua
8
star
11

atmega32u4-usb-serial

Rust USB serial driver crate for atmega32u4 based on FFI bindings for Teensy AVR-C library
C
8
star
12

ch551

example project for the ch551 microcontroller using cmake and sdcc
CMake
7
star
13

organelle-m-pi-gen

Build an rootfs image for an Critter & Guitari Organelle M using the Raspbian pi-gen tool
Shell
4
star
14

gba-game-of-life

Conway's Game of Life for Gameboy Advance in Rust
Rust
4
star
15

wiz-color

Open source Flutter app to change the color of a Philips Wiz WiFi light bulb
Makefile
3
star
16

ActiveSpace.spoon

HammerSpoon menu bar item to show active Mission Control space
Lua
2
star
17

udoo-display

Print USB serial data to an OLED display using Rust and AVR-C
Rust
2
star
18

sequencer

Rust
2
star
19

root-robot-python-web-app

A web app for programming Root Robots in Python
Python
2
star
20

semihosting.c

Semihosting _read() and _write() stubs for Cortex-M microcontrollers and libc
C
2
star
21

zsun-scripts

Set of scripts for copying files to a openwrt zsun wifi sd card reader
Shell
2
star
22

pocketchip-weather

A BASH script to display the current weather from http://wttr.in on the PocketCHIP's screen
Shell
2
star
23

samd21_freertos_demo

FreeRTOS 9.0 and FreeRTOS_CLI demo for Atmel/Microchip samd21 using ASF
C
2
star
24

embedded-graphics-gba

embedded graphics implementation for the Game Boy Advance
Rust
2
star
25

esp32c3-ble-temperature-sensor

micropython app for esp-rs board to share temperature and humidity from shtc3 sensor over bluetooth
Python
1
star
26

nuttx-lua-webserver

Async HTTP webserver for Nuttx, written in Lua and powered by libuv
Lua
1
star
27

gba-rust-apps

Collection of GBA ROMs built with Rust
Rust
1
star
28

tagbuf.kak

Tagbar.kak in a buffer
1
star
29

gba-draw

A Game Boy Advance game in Rust to draw over a bitmap image
Rust
1
star
30

alsa-latency-test

Test to measure latency time from a GPIO trigger to audio playback using alsa-lib
C
1
star
31

stm32g0-rust

Experiments with Rust on the STM32G031 Discovery Board
Rust
1
star
32

hello-nix-flakes

A minimal Nix Flake to build a trivial C program
Nix
1
star
33

cargo-make-ctrl-c

dummy project to demonstrate an issue for cargo-make
Rust
1
star
34

gba-go

A collection of ROMs for the Game Boy Advance written in Go
Go
1
star
35

next_bus

esp32 micropython application to display time until the next bus home from work
Python
1
star
36

hello-world

Print "Hello, world!" by brute force guessing characters.
Rust
1
star