Giter Club home page Giter Club logo

zigx's Introduction

zigx

An x11 client library for Zig applications.

Currently tested with zig version 0.11.0.

What you should know about X

X is a protocol for transmitting graphics primitives and user inputs.

Components

XClient - a program that connects to an XServer to send graphics primitives and receive user inputs

XServer - a program that accepts XClients to receive graphics primitives and send user inputs

The DISPLAY environment variable

XClient libraries use the DISPLAY environment variable to know how to connect to the XServer. It uses this format:

[PROTOCOL/]HOST:DISPLAYNUM[.SCREEN]

Examples:

# connect to localhost port 6000
:0

# connect to host "foo" port 6003
foo:3

# connect to host "foo" port 6007 screen 5
foo:7.5

Here are some examples of starting XClient programs and settings the DISPLAY environment variable:

# set the XSever
export DISPLAY=:0

# start a couple XClient programs
./my-cool-x-program &
./another-cool-x-program &

# start this program and connect it to the XServer on host "mymachine" running on port 6010 screen 1
DISPLAY=mymachine:10.1 ./yet-another-x-program

How to debug an X connection

# -n means do not copy credentials
xtrace -n -- command

# i.e.
xtrace -n -- zig run example.zig

Authentication

https://en.wikipedia.org/wiki/X_Window_authorization

  • MIT-MAGIC-COOKIE: implemented for local connections
  • XDM-AUTHORIZATION-1: not implemented

For XDM-AUTHORIZATION-1, a secret key is stored in the $HOME/.Xauthority file, the client creates a string by concatenating the current time, a transport identifier and the key, then encrypts the resulting string and sends it to the server.

zigx's People

Contributors

marler8997 avatar

Watchers

 avatar

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.