AI prompts
base on X11 window management toolkit bonk - X11 toolkit
==================
### NOTICE
I have started experimenting with Wayland with the intent of using it instead of
X11, once I have tooling written. This project is unmaintained, and I doubt I
will be returning to it.
### Overview
bonk - **B**ox's wind**O**w ma**N**ager tool**K**it. Bonk is a command-line
tool that provides subcommands to modify windows, adjust window properties,
change window decorations, and more.
Bonk is designed with X11 in mind.
### Requirements
A C compiler, CMake, and libxcb to build Bonk. Running the testing suite
requires Python 3, Xephyr, xtrace, and lcov. The following will build Bonk:
```
cmake .
make
sudo make install
```
### Examples
Bonk executes commands based on what is read from the command line. Here's a
starter example:
```
bonk get-focus lower
```
The first command, `get-focus`, places the current window into the window stack.
The second command, `lower`, moves a window to the very back of the desktop.
Commands that operate on a window **always default to the first window in the
stack**.
How about making this more interactive?
```
bonk pick lower get-title
```
The `pick` command prompts the user to select a window by left-clicking on it.
Selection can be cancelled by using any other mouse press. Like `get-focus`,
`pick` loads a window into the window stack for `lower` and `get-title` to
operate on.
What about using a specific window instead?
```
bonk raise --window 0xdeadbeef get-title
```
In this case, a window id is specified by the `--window` argument to `raise`.
The `--window` argument is accepted by all commands that operate on windows. It
is important to note that specifying a window **replaces all other windows in
the window stack**.
What about finding windows that match a certain criteria?
```
bonk select --class firefox
```
This will return all visible windows that were created by firefox. To return
minimized windows, add `--all` to the criteria.
It's possible to narrow the search further:
```
bonk select --all --class firefox --title Example
```
This returns windows created by firefox that have 'Example' in their title. The
`--all` option means to include windows that are currently minimized.
The above search may return windows that are of no use to the user. How about
limiting the search to windows that are only in the taskbar?
```
bonk select --clients
```
Most window managers provide a list of windows that they're managing. Adding
`--clients` to search criteria provides a way to only search within that list,
to prevent turning up windows that are of no interest to the user.
### Window stack
The `window-arg` property on a command allows the following:
* `%N`: N-th window (first window is `%0`)
* `%-N`: Select from the end of the stack (last window is `%-1`)
* `%@`: Select all windows.
```
%-1: Last argument
%@: All windows
```
### Testing
Execute `./run-tests.sh` to run all tests.
### Command reference
Here are all commands that Bonk supports (output of `bonk help`).
```
Usage: bonk <commands [arguments]>
window stack management
get-active Use window manager's active window
get-focus Use the window that currently has input focus
pick Left click to select a window
reject Remove windows using criteria
select Search for a window using criteria
window actions
activate Tell window manager to set active window
close Attempt to close a window
decoration Set MOTIF (titlebar + border) hints
focus Give input focus to a window
lower Push a window to the back, behind other windows
map Reveal a window a window hidden with unmap
move-resize Specify an exact size and place for a window
opacity Adjust window transparency
raise Pull a window to the front, ahead of other windows
set-window Update simple properties (class, instance, etc.)
state Minimize, maximize, fullscreen, and more
terminate Terminate program associated with a window
unmap Hide a window (does not minimize to taskbar)
information
get-title Get title of a window
miscellaneous
sleep Suspend execution for a given duration
```
", Assign "at most 3 tags" to the expected json: {"id":"9184","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"