{"id":13571592,"url":"https://github.com/vidarh/rubywm","last_synced_at":"2025-04-10T01:12:17.076Z","repository":{"id":218430160,"uuid":"746375037","full_name":"vidarh/rubywm","owner":"vidarh","description":"An X11 window manager in pure Ruby","archived":false,"fork":false,"pushed_at":"2024-07-02T06:04:52.000Z","size":3605,"stargazers_count":232,"open_issues_count":1,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-10T01:12:13.579Z","etag":null,"topics":["ruby","x11","x11-wm"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vidarh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"vidarh","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2024-01-21T21:23:24.000Z","updated_at":"2025-03-17T03:12:12.000Z","dependencies_parsed_at":"2024-11-05T04:31:35.744Z","dependency_job_id":"e811090f-7fad-49dd-bb06-182fd4fb7077","html_url":"https://github.com/vidarh/rubywm","commit_stats":null,"previous_names":["vidarh/rubywm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vidarh%2Frubywm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vidarh%2Frubywm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vidarh%2Frubywm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vidarh%2Frubywm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vidarh","download_url":"https://codeload.github.com/vidarh/rubywm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137888,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby","x11","x11-wm"],"created_at":"2024-08-01T14:01:03.593Z","updated_at":"2025-04-10T01:12:17.054Z","avatar_url":"https://github.com/vidarh.png","language":"Ruby","funding_links":["https://github.com/sponsors/vidarh"],"categories":["Ruby"],"sub_categories":[],"readme":"\n# A Ruby X11 Window Manager\n\n**WARNING**:\n\nThis is experimental. It will eat your cat and burn down your house,\nformat your hard drive and post all your secrets to Facebook.\n\nAlso it *will* likely crash on you.\n\nIf you're not comfortable figuring out how to recover from an X session\nwhere your window manager is gone and lots of your windows appears to have\ndisappeared ... somewhere, and you might not be able to get focus to a\nterminal window without switching to the text console, this is not yet\nfor you.\n\n## So why should I run this?\n\nYou almost certainly shouldn't.\n\n## But what is it then, at least?\n\nIt's a minimalist (currently \u003c1K lines) pure Ruby (including the X11\ndriver) X11 window manager. It is focused on tiling, but allows you to\nchoose to assign a tiling layout to specific desktops or leave them\nfloating. Currently *whether or not you use tiling or floating layout*\nthere is *no window decoration* and windows are not draggable or\nresizable by pulling on borders (but you can do that with Windows\nkey + left/right mouse button)\n\nLike bspwm, which was an inspiration, the wm supports *no* keyboard\nhandling - all keyboard handling is deferred to separate tools like\nsxhkd. Unlike bspwm this WM has no dedicated IPC mechanism. Instead,\nso far, all communication happens via X11 ClientMessage events, which\nmeans any tool, like xdotool etc. that can produce those events can\ncontrol the WM.\n\nIt currently does *not* do anything to facilitate working on multiple\nmonitors, as in my current setup I'm only using a single monitor for\nmy Linux machine.\n\n## Screenshots\n\nNote that most of what you see here is not the wm. The wm decoration is minimalist: a 1 pixel rectangular frame. Nothing else. But people want to see screenshots anyway, so here:\n\n\u003cdiv\u003e\n\u003ca href=\"https://github.com/vidarh/rubywm/blob/8eed458c1b9f9d25372df3932ab1237149bb90c0/screenshots/2024-01-11_19-45.png?raw=true\"\u003e\u003cimg style=\"display: inline; width: 48%\" src=\"https://github.com/vidarh/rubywm/blob/8eed458c1b9f9d25372df3932ab1237149bb90c0/screenshots/2024-01-11_19-45.png?raw=true\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/vidarh/rubywm/blob/master/screenshots/2024-01-11_20-04.png?raw=true\"\u003e\u003cimg style=\"display: inline; width: 48%\" src=\"https://github.com/vidarh/rubywm/blob/master/screenshots/2024-01-11_20-04.png?raw=true\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## Why did you write this?\n\nIt started with mild frustration that bspwm handled my desire for one of\nmy virtual desktops to have floating windows by default poorly. It's\npossible, but didn't work great for me. It also frustrated me that my\nfile manager was visible on all the virtual desktops instead of just the\nfloating one. I also happened to know an X11 WM can be *really*\nminimal to start off with.\n\nSo I ditched bspwm, and translated TinyWM - a really minimal C wm - to\nRuby, made that my main wm, and gradually started adding the features\nI needed, drawing a lot of inspiration from the code of KatriaWM to\nfigure out how to make my experience gradually less painful.\n\nThis has been my only WM since that day, and I now feel that *I* have\nrough parity in term of the features *I* use with bspwm. That does\nnot mean it will have parity for you - it lacks lots of things. It\nalso does not mean there aren't plenty of bugs, because there are.\n\n## Will you add...?\n\nMaybe. As long as it can either 1) be done with little code, and/or\n2) be done by you, and/or 3) it can easily be kept as a separate gem.\n\nTalk to me. But please respect I'm primarily releasing this \"as is\", and\nI'm not committing to supporting this - I *do not care* if you decide\nit doesn't work for you and is horrible. I'll think it's great if you\nget some utility out of this code, though. But my goal is not a big user\nbase. Or *a* user base.\n\nMy goal is a functional, minimalist WM that works *for me*. And so, I'll\nhelp if it's not compromising my own goal. To the extent our goals are\nnot compatible, I'm happy to e.g. split out generic/reusable\nfunctionality so people can fork this and we can still benefit from\nsharing the bits where we do agree how things should be.\n\n\n## Pre-requisites:\n\n * sxhkd or similar is needed to handle input, as this WM does\n *not* listen to keybindings other than grabbing windows+ left/right\n mouse button for move and resize.\n\n* A recent version of Ruby. I currently use 3.2.2\n\n## How to run\n\nThis is a subset of my .xinitrc.\n\nWARNING: You probably want to try this in a vm or something first and\nsee if it works for you:\n\n```sh\n  (sxhkd 2\u003e\u00261 | logger -t sxhkd) \u0026\n  (cd ~/Desktop/Projects/wm ; ruby rubywm.rb 2\u003e\u00261 | logger -t rubywm) \u0026\n  \n  while true do\n    wait\n    sleep 5\n  done\n```\n\nFor most \"normal\" window managers, people tend to start the window\nmanager last and let it end the X session when it quits, but since\nthis is in development, I'm not going to do that because most stuff on\nmy desktop can survive my WM crashing and being restarted just fine,\nas it should be, but will obviously get killed if the X session dies.\n\n## Using with sxhkd\n\nThis is my related integration with sxhkd from my sxhkd config, but any\napp that supports sending XClientMessage events can work:\n\n```\n    # Full screen\n    super + f\n    \t/home/vidarh/bin/xclimsg -mpw focused _NET_WM_STATE 2 _NET_WM_STATE_FULLSCREEN 0 2\n    \n    # Shift Focus\n    super + {Left,Down,Up,Right}\n    \t/home/vidarh/bin/xclimsg -mpw focused _RWM_FOCUS {Left,Down,Up,Right}\n    \n    # Shift direction\n    super + shift + d\n    \t/home/vidarh/bin/xclimsg -mpw focused _RWM_SHIFT_DIRECTION 0\n    \n    # Swap node layout\n    super + shift + l\n    \t/home/vidarh/bin/xclimsg -mpw focused _RWM_SWAP_NODES 0\n    \n    # Move\n    super + shift + {Left,Down,Up,Right}\n    \t/home/vidarh/bin/xclimsg -mpw focused _RWM_MOVE {Left,Down,Up,Right}\n    \n    super + F1\n    \t/home/vidarh/bin/xclimsg -mpw focused _NET_RESTACK_WINDOW 2 0 0\n    \n    super + F2\n    \t/home/vidarh/bin/xclimsg -mpw focused _NET_RESTACK_WINDOW 2 0 1\n    \n    # Focus desktop\n    super + {1-9,0}\n    \t/home/vidarh/bin/xclimsg -mp _NET_CURRENT_DESKTOP {0-8,9}\n    \n    # Move to desktop\n    super + shift + {1-9,0}\n    \t/home/vidarh/bin/xclimsg -mpw focused _NET_WM_DESKTOP {0-8,9}\n```\n\nThe `_RWM` events are custom for this WM. The others works on other\nEWMH compatible wms.\n\nxclimsg is from https://github.com/phillbush/xclimsg\nI intend to \"build in\" the same client code in rubywm to avoid that\nexternal dependency. Alternatively you can e.g. use xdotool or similar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidarh%2Frubywm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvidarh%2Frubywm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidarh%2Frubywm/lists"}