8 ms·
Show HN: Bonk, a command-line tool for X11 window management
- compressedgas 3y agoThis does not appear to do anything that xdotool doesn't already do.
- FascinatedBox 3y agoThis solves a few issues in xdotool for me: Window selection allows for multiple criteria at once, and I can also reject windows. I'm also able to use the window manager's client list as a source, which makes getting toplevel windows much easier. Window movement is done using static gravity, fixing an issue where windows were moving differently if they were a terminal window versus non-terminal window. Bonk can delete properties. I sometimes delete WM_NORMAL_HINTS if a window has size hints set where I can't resize it the way I want. xdotool can raise windows but can't lower them (bonk can do both).
- o11c 2y ago> I sometimes delete WM_NORMAL_HINTS if a window has size hints set where I can't resize it the way I want. With kwin it's easy to manually override an application/window to ignore geometry constraints or whatever. I do this for xterm to avoid having a few pixels of background showing at the edge when maximized. I also used to do this a lot to get the much-nicer "soft fullscreen" in SDL1 applications.
- jdiff 2y agoCan it send whatever signal it is that WMs do when a window is fullscreened, or block the signal sent when it's unfullscreened? If so, I'm 100% sold.
- FascinatedBox 2y agoYes, through the state option (xdotool calls it windowstate). I was confused when implementing it, because there appear to be three different fields: maximized_horz, maximized_vert, and fullscreen. If you want total fullscreen (covers taskbar and other stuff), use the last one. If you want the window maximized, use both of the maximized ones. Come to think of it, I should put in better documentation for the state option, as well as a general maximize alias.
- rendaw 2y agoGP's question seems like it might be a common question. Would it make sense to add this to the readme?
- FascinatedBox 2y agoGood point. I'll make a note to add some documentation to that effect. I didn't think of it originally because I didn't expect this much interest in my project.
- bee_rider 2y agoGood problem to have!
- anthk 2y agoGood, but wmctrl and xdotool do exactly that with far more features.
- deleted 2y ago[deleted]
- shmerl 2y agoKind of obsolete in the age of Wayland.
- o11c 2y agoWayland is still buggier than a swamp. At this point they're no longer showstopping bugs, but if you don't want to be constantly annoyed by little things not working, X11 is still the way to go.
- shmerl 2y agoBuggier or not - it's too late to think X11 is the alternative. It's not. Wayland is going to get better for whatever is needed. X11 is absolutely not the way to go.
- GuB-42 2y agoThe question is "when?". Wayland is 15 years old, it already had a lot of time to "get better". So today, in most cases, I'd say X11 is still the way to go, it just works better. When Wayland will get better and apps start supporting Wayland more than they support X11, it will be the time to switch, but at the glacial pace Wayland advances, chances are that your current system will be obsolete when it will happen. It is still a good idea to consider Wayland support for your own apps and have at least a test machine running it, but doesn't mean writing apps designed to work with X11 like this one is a wasted effort. X11 is here to stay, for a while at least.
- yjftsjthsd-h 2y agoFurther, it's not even clear that this kind of program is practically possible on Wayland. At best, that's yet another new protocol someone would need to invent that only some compositors would implement.
- shmerl 2y ago> Further, it's not even clear that this kind of program is practically possible on Wayland. It's pretty clear. But some are too stuck up to even research it or be part of shaping it. Which is common among legacy vendors who very rarely even care to communicate with Wayland developers about their needs. Those who aren't stuck up deal with it just fine (OBS Studio for example).
- TheSkyHasEyes 2y agoFYI bonk.io has been around for almost a decade.
- keepamovin 2y agofascinatedbox, bonk. this person has great names. I hope they can offer their version of a renaming of MacOS releases to avoid the blandish (tho triumphal and majestic, to be sure) Californiaisms. For instance what would this person call MacOS 12, 13, 14?
- 28304283409234 2y ago"bonk - Box's windOw maNager toolKit." Obviously.
- tupolef 2y agoNice to see an alternative, there is some old issues with xdotool or wmctrl and after some tests I will probably replace them completely with bonk. I updated my script for i3wm to toggle windows between scratchpad/active/start/stop: https://gist.github.com/tkapias/0443d4930c1d7b520f4496e1ff391625 https://gist.github.com/tkapias/0443d4930c1d7b520f4496e1ff39...
- bonki 2y agoThe name confuses me profoundly.
- defrost 2y agoYeah, I also kept thinking of the 1988 debut studio album by Big Pig and the urban dictionary usage of the word upon which the album was named.