New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

i3wm

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i3wm

Talk with i3 window manager

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

i3 window manager + Node.js

This Node.js package allows to talk with i3 window manager using IPC interface.

No dependencies, no unecessary abstractions. Just simple, modern API.

Source code is only one file with clear comments and references to excellent i3wm docs.

Install

npm install i3wm

Examples

Connect to i3

const i3wm = require('i3wm')

i3wm.Client.connect().then(client => {
  console.log('Conneceted')
})

// or

const client = await i3wm.Client.connect()

You can also use custom binary by passing additional options to connect. For example: connect({ bin: 'sway' }).

Subscribe to events

client.subscribe('window', 'workspace')

client.on('window', msg => {
  if (msg.change === 'focus') {
    console.log('Jumping around')
  }
})

Messages

// Subscribe, payload is serialized
await client.message('subscribe', ['window'])

// Get tree of all windows and workspaces
const tree = await client.message('get_tree')

// send multiple commands in one go
const [r1, r2] = await client.message('run_command', 'workspace 0; mark m')

Possible messages can be found in source code and man i3-msg.

Commands

Use command() to send a command and get unwraped reply.

// Mark current window with 'm'
await client.command('mark m')

// command() throws on incorrect input
client.command('BLAH')
  .catch(err => console.log('Incorrect: ': err.input))

Disconnect

i3wm.Client.disconnect(client)

Keywords

FAQs

Package last updated on 05 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc