Code Monkey home page Code Monkey logo

gallium's Introduction

Gallium

For a second Kassad thought it was another person
Wearing the chromium forcefields he and Moneta were
draped in─but only for a second. There was nothing human
about this particular quicksilver-over-chrome construct.
Kassad dreamily noted the four arms, retractable
fingerblades, the profusion of thornspikes on throat,
forehead, wrists, knees, and body, but not once did his gaze
leave the two thousand-faceted eyes which burned with a red
flame that paled sunlight and dimmed the day to blood
shadows.
                                          - Hyperion Cantos

A WM written in Rust, inspired and based loosely off of Kintaro's wtftw project. This is a toy project.

(I've actually been using it as my WM in an Arch VM for a few years now. It's workable, but feature-lite, and probably has bugs that I just never run into since my setup doesn't change. Also it crashes from some dialog boxes since it doesn't do ewmh hints - you'll want export GPG_AGENT_INFO="" at the least so it prompts from the console instead of popup.)

Currently supports:

  • Customizable keybindings
  • Tall tiling mode and fullscreen mode
  • Gaps and padding for windows
  • Workspaces
  • ???

Still to do:

  • More keybinds (sending windows across workspaces, etc.)
  • Hot-reloading of WM without losing all your windows
  • More layout options (BSP?)
  • Per-window tweaks
  • EWMH exporting

There should probably be core 5 Layouts - Tall, Wide, Grid, Focused, and Floating. Tall tiles vertically, Wide horizontally, Grid will have a resizable number of rows and columns with an overflow square in the bottom-right, Focused will full-screen the currently selected window and hide the rest, and Floating will remap all existing windows and any new ones to floating, but switch them back when switched to another layout.

gallium's People

Contributors

chc4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gallium's Issues

Use PrettyEncoder

Currently, serializing the config struct uses the default json encoder. It's supposed to be human-consumable, so use the PrettyEncoder instead.
Make sure that the normal json decoder ignores whitespace though.

Figure out multi-monitor support

Eventually(tm)

Store the screen id in the Workspace struct instead of in a Deck under WindowManager. Probably also wrap Screen in a struct that provides width+height, since I assume those two Xlib calls for every single Layout.apply is expensive.

Add all the events

XServer::get_event should handle most(if not all) of the event types.
It should also wrap the important/relevant members of the event into an enum it returns. Also, fix your naming - match on a ButtonPress, cast to XButtonPressedEvent, and return a ButtonPressed? That's terrible.

Add hot reloading

Currently, you can only reload the config. This is actually pretty sweet. Unfortunately, that's pretty much useless during dev since you still have to cold reload for code changes.

Make the entire WindowManager struct derive Encodable/Decodable, serialize it to a swapfile, execvp the new binary, load in the old WindowManager.

Alternatively, we could just scan the XOrg window heirarchy on boot to see what to add. It's a lot less work, but would put all windows in the same workspace and forget about lots of other important info.

Rename XServer::parse_key to parse_keybind

Current, Config::setup is confusing to read. It looks like the loop that creates the workspace jump hotkeys forgets to initialize the None value, while in reality it never touches a KeyBind, only Key. Making parse_keybind explicit would show that the workspace loop onlys touches Keys, and the Config fields are KeyBinds instead.

Yes, I'm aware these are terrible names.

Make bitfields safer

KeyMod is a bitfield. I parse C-S-k into (CONTROL | SHIFT).bits() with a lookup and shifting 1<<k, which 1) would trigger undefined behavior if the lookup table is too long 2) would break with a different endianness.

Change the lookup table into [("C-",CONTROL),("S-",SHIFT)] and add in the tuple's bits() value instead.

Add per-window tweaks

Specific rules that are automagically applied depending on the window's name. Like how spectrwm does it, except serialized to a proper data structure.

Add key handling

I copied over the key.rs file I wrote from the wtftw fork, but need to add a callback queue. The queue should probably be a member of the WindowManager class - its constructor already is passed the ConfigLock

Make WindowManager use less Rc and support Pos

WindowManager currently spams the hell out of Rc. That's bad and expensive - use &-references and unsafe set_lifetime to avoid that.
Also, make WindowManager's windows member be Vec<(Window,Pos)> instead of just Window (or maybe wrap it in a struct with that info?), needed in order to also store information about the pos and size...and if it's in master or not, and hidden?

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.