npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

basedwm

v0.1.2

Published

X window manager with infinite panning desktop

Downloads

8

Readme

basedwm

Minimalistic X window manager in LiveScript, with an infinite panning desktop. Controlled by named pipe. Emits focus events and window positions on a socket.

Install

You only need Node.js (or io.js) to run the basic WM.

  sudo npm i -g basedwm

Then add exec basedwm to your ~/.xinitrc, commenting out any existing WM.

However, note that basedwm alone doesn't provide any keyboard or pointer controls or window decorations. Instead, it takes control input from a named pipe and logs focus events and window positions out to another named pipe. This way you can easily switch out what programs you use to control it or to render window decorations.

Keyboard controls

Recommendations

To bind commands to keyboard controls, I recommend sxhkd. A suitable example config is in example/basedwm.sxhkdrc.

Details

Basedwm is controlled through a named pipe, by default at /tmp/basedwm:0-cmd.fifo (where the :0 is the contents of the $DISPLAY env variable). The program basedc is provided for convenience; it just echoes its arguments into that pipe.

Some commands are stateless and run immediately:

| name | description | | ------------- | -------------------------------------------------------- | | exit | terminates the program | | raise | raises the currently focused window | | pointer-raise | raises window under pointer | | move x y | moves the currently focused window by the given amount | | move-all x y | moves all windows, effectively panning the desktop | | resize x y | resizes the currently focused window by the given amount | | destroy | closes the currently focused window (polite suggestion) | | kill | kills the currently focused window (force close) |

So basedc move-all 50 -50 to move all windows 50px right and 50px up.

The stateful ones are intended for pointer interaction:

| name | description | | -------------------- | --------------------------------------- | | pointer-move x y | moves focused window with pointer | | pointer-resize x y | resizes focused window with the pointer | | pointer-move-all x y | pans desktop with pointer | | reset | resets pointer drag state |

Remember to send a reset once each drag is done! This tells basedwm that the next pointer command will be a separate action.

Window decorations

Recommendations

Hudkit was written for this. I'll get around to uploading my setup eventually, but the basic idea is to create a Node server that net.connects to the WM state socket, dumps the events into a websocket and serves up a page that uses D3 to render borders and a minimap. Screenshot here.

Details

Basedwm outputs window positions on a socket in /tmp/wmstate.sock, as newline-delimited JSON objects. Every object has a property id with the window's ID, and a property action representing the event type.

The possible actions and their additional properties are:

| action | description | additional properties | | ------------ | ----------------------- | --------------------------- | | focus | window gained focus | none | | destroy | window was destroyed | none | | existing-add | initial window position | x, y, width, height | | add | window was added | x, y, width, height | | move | window was moved | x, y | | resize | window was resized | width, height |

existing-add-events are only sent immediately after connecting. This lets any consuming program initialise its copy of the window positions.

The x and y properties indicate the absolute coordinates of the window's top-left corner, relative to the screen's top-left corner. The width and height properties indicate the absolute dimensions of the window.

You can easily survey the output using socat UNIX:/tmp/wmstate.sock -.

Bugs

Yes.

Inspirations & thankyous

Intended as a modern reinterpretation of swm, with the big virtual desktop taken to the extreme. Exposing controls on a pipe/socket interface and outsourcing controls to sxhkd are ideas from bspwm.

License

ISC.