{"id":24216654,"url":"https://github.com/creativecodecat/dk-wm","last_synced_at":"2026-06-12T09:31:56.891Z","repository":{"id":198069049,"uuid":"628913874","full_name":"CreativeCodeCat/dk-wm","owner":"CreativeCodeCat","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-17T08:39:01.000Z","size":3437,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T05:06:59.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/CreativeCodeCat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-17T08:38:38.000Z","updated_at":"2023-04-17T08:40:01.000Z","dependencies_parsed_at":"2023-10-04T08:30:11.711Z","dependency_job_id":null,"html_url":"https://github.com/CreativeCodeCat/dk-wm","commit_stats":null,"previous_names":["hecodes2much/dk-wm","creativecodecat/dk-wm"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeCodeCat%2Fdk-wm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeCodeCat%2Fdk-wm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeCodeCat%2Fdk-wm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreativeCodeCat%2Fdk-wm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CreativeCodeCat","download_url":"https://codeload.github.com/CreativeCodeCat/dk-wm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241721829,"owners_count":20009249,"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":[],"created_at":"2025-01-14T04:23:06.851Z","updated_at":"2026-06-12T09:31:56.848Z","avatar_url":"https://github.com/CreativeCodeCat.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](dk.png)\n\nA list based tiling window manager in the vein of dwm, bspwm, and xmonad.\n\nSome basics:\n\n- Fully scriptable.\n- Dynamic workspaces.\n- More dynamic tile layout.\n- Gaps, fancy borders, extra layouts and more.\n- Better support for mouse and floating windows.\n- Startup script for configuration and running programs.\n- Status info is output to a file for use in bars or scripts.\n- No built-in extras *(bar, font drawing, or key bindings)*.\n- Sane support for\n[icccm](https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#client_to_window_manager_communication),\n[ewmh](https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html), and\n[motif](http://www.ist.co.uk/motif/books/vol6A/ch-20.fm.html#963509).\n\n\n### Installation\n\nYou need the xcb headers\n\nArch\n```\nxcb-proto xcb-util xcb-util-wm xcb-util-cursor xcb-util-keysyms\n```\n\nVoid\n```\nlibxcb-devel xcb-proto xcb-util-devel xcb-util-wm-devel xcb-util-cursor-devel xcb-util-keysyms-devel\n```\n\nDebian/Ubuntu\n```\nlibxcb-randr0-dev libxcb-util-dev libxcb-icccm4-dev libxcb-cursor-dev libxcb-keysyms1-dev\n```\n\nOther systems should have packages with similar names.\n\nAs mentioned above dk has no keybind support so you'll need a separate  \nprogram like `sxhkd` to launch programs and control the window manager.\n\n\nTo compile run\n```\nmake\n```\n\nEdit `config.h` if needed, then run *(as root if needed)*\n```\nmake install\n```\n\nIf at any time you want to uninstall, run\n```\nmake uninstall\n```\n\n\n### Usage\n\nTo start dk you can add the following to your `~/.xinitrc`\n```\nexec dk\n```\n\nOptionally copy the example dkrc and/or sxhkdrc to `~/.config/dk/`\n```\nmkdir -p ~/.config/dk\ncp /usr/local/share/doc/dk/dkrc ~/.config/dk/\ncp /usr/local/share/doc/dk/sxhkdrc ~/.config/dk/\n```\n\n### Configuration\n\nThere are example `dkrc` and `sxhkdrc` files in `doc/` or  \n`/usr/local/share/doc/dk` after installation.\n\ndk looks for an rc file in the following order\n```\n$DKRC                     # user specified location\n$HOME/.config/dk/dkrc     # default location\n```\nand tries to run it, **it must be executable in order for this to happen**.\n\nAdvanced changes and configuration like new layouts, callbacks, or commands  \ncan be done by copying the default config header `config.def.h` to `config.h`,  \nediting it and recompiling. This file isn't tracked by git so you can keep your  \nconfiguration and avoid conflicts when pulling new updates.\n\n### dkcmd\nMost of your interaction with the window manager will be using `dkcmd`  \nwhich writes one or more commands into the socket where it is then read  \nand parsed by the window manager *(see Commands section below)*.\n\n\n### Syntax Outline\nThe commands have a very basic syntax and parsing, the input is broken  \ndown into smaller pieces *(tokens)* which are then passed to the matching  \nkeyword function, otherwise an error is returned.\n\nTokens are delimited by one or more:\n\n- whitespace *(space or tab)*\n\n- quotation mark *(`'` or `\"`)*\n\n- equal sign *(`=`)*\n\nThis means the following inputs are all equivalent.\n```\nsetting=value\nsetting value\nsetting=\"value\"\nsetting = 'value'\nsetting \"value\"\nsetting\t\t\"value\"\n```\nand result in two tokens: `setting` and `value`\n\n---\n\nQuotation exists as a way to preserve whitespace and avoid interpretation by the shell,  \notherwise we have no way of determining whether an argument is a continuation of the  \nprevious or the beginning of the next. Consider the following\n```\ntitle=\"^open files$\"\n```\n\nIf the value being matched has quotes in it, they can be escaped or strong quoted\n```\ntitle=\"^\\\"preserved quotes\\\"$\"\ntitle='^\"preserved quotes\"$'\n```\n\n---\n\nFor various commands dk will expect a certain data type or format to be given.\n\n- string: normal plain text, must be less than 256 characters.\n\n- boolean: `true`, `false`, `1`, or `0`.\n\n- hex: `(0x/#)XXXXXXXX`, used for window ids\n\n- integer: `(+/-)1`, if it is preceded by a sign it is considered relative.\n\n- float: `(+/-)0.1`, same as integer but must contain a decimal value.\n\n- colour: `(0x/#)[AA]RRGGBB`, hex value, if no alpha channel is given the colour is opaque.\n\n---\n\n### Commands\n```\ndkcmd COMMAND\n```\n#### WM\n\n- `quit` exit dk.\n- `restart` re-execute dk.\n\n#### Ws and Mon\n`mon` and `ws` operate on monitors and workspaces respectively.\n\n- `CLIENT` (hex) The window id in hex to operate on, if unspecified the active window is used.\n- `TARGET` (integer/string) Name or number of the workspace or monitor to target or strings\n    - `next` relative forward\n    - `prev` relative backward\n    - `last` last viewed\n    - `nextne` next non-empty\n    - `prevne` previous non-empty\n\n```\nws  [SUBCOMMAND] [CLIENT] TARGET\nmon [SUBCOMMAND] [CLIENT] TARGET\n```\n\n###### Subcommands\n`view` View the TARGET, default if no subcommand is given.\n```\nws view TARGET\nws TARGET\n```\n---\n\n`send` Send CLIENT to the TARGET.\n```\nmon send [CLIENT] TARGET\n```\n---\n\n`follow` Follow CLIENT to the TARGET.\n```\nws follow [CLIENT] TARGET\n```\n\n#### Rule\n`rule` operates on window rules.\n\n- `MATCH` one or more regex strings to be used when matching window properties.\n- `SETTING` one or more window setting to be applied when a matched window is encountered.\n\n```\nrule [SUBCOMMAND] MATCH SETTING\n```\n\n###### Subcommands\n\n`apply` applies RULE to all matching windows, if RULE is `*` apply all rules and MATCH is ignored.\n```\nrule apply RULE [MATCH]\n```\n---\n\n`remove` removes RULE, if RULE is `*` remove all rules and MATCH is ignored.\n\n```\nrule remove RULE [MATCH]\n```\n\n###### Settings\n\n`class` `instance` `title` `type` (string) regex to match the window class, instance, title, and  \ntype respectively *(may be prefixed with match_ for clarity)*. Regex matching is always done **case insensitive**  \nwith extended regex mode enabled.\n```\nrule [SUBCOMMAND] class=\"^firefox$\" instance=\"^navigator$\" title=\"^mozilla firefox$\" type=dialog [SETTING]\n```\n\n\n`type` currently only supports `dialog` and `splash` windows, all others are treated as normal windows.\n\n---\n\n`ws` (integer/string) determine what workspace the window should be on.\n```\nrule MATCH ws=1      # using index\nrule MATCH ws=term   # using name\n```\n---\n\n`mon` (integer/string) determine what monitor the window should be on.\n```\nrule MATCH mon=1          # using index\nrule MATCH mon=HDMI-A-0   # using name\n```\n---\n\n`x` `y` `w` `width` `h` `height` `bw` `border_width` (integer/string) determine the window location and size.\n\n- `x` change the x coordinate, can be an integer or one of the following.\n    - `center left` and `right` gravitate on the x coordinate.\n\n- `y` change the y coordinate, can be an integer or one of the following.\n    - `center top` and `bottom` gravitate on the y coordinate.\n\n- `w` `width` change the window width.\n- `h` `height` change the window height.\n- `bw` `border_width` change the window border width.\n\n```\nrule MATCH x=20 y=100 w=1280 h=720 bw=0         # using absolute values\nrule MATCH x=center y=center w=1280 h=720 bw=0  # using gravities\n```\n---\n\n`callback` (string) determine a callback function to be invoked on window open and close.\nThese are defined in the config header and compiled into the source, one example is provided.\n```\nrule MATCH callback=albumart\n```\n---\n\n`float` `stick` (boolean) determine if the window should be floating or stick respectively.\n```\nrule MATCH float=true stick=true\n```\n---\n\n`ignore` (boolean) determine if the window should ignore configure request events.\n```\nrule MATCH ignore=true\n```\n---\n\n`focus` (boolean) determine if the window should be focused and `view` it's workspace.  \nIf `mon` is also set it will be activated first before viewing the workspace.\n```\nrule MATCH focus=true\n```\n---\n\n#### Set\n`set` operates on workspace or global configuration settings.\n\n- `SETTING` one or more settings to be changed.\n- `WS` the workspace which subcommand should apply to, if unspecified the current is used.  \n`_` is a special workspace used to define default values for new workspaces which  \nhaven't been created yet.\n\n```\nset [WS] SETTING\nset ws=_ [apply] SETTING\n```\n\n###### Settings\n`numws` (integer) change the number of workspaces to allocate.\n```\nset numws=10\n```\n---\n\n`name` (string) change the WS name.\n```\nset ws=1 name=\"term\"\n```\n---\n\n`static_ws` (boolean) disable dynamic workspaces for multi-head systems.\n```\nset static_ws=false\n```\n---\n\n`mon` (integer/string) change which monitor WS should be on (requires `static_ws=true`).\n```\nset ws=1 mon=HDMI-A-0\nset ws=1 mon=1\n```\n---\n\n`master` `stack` (integer) change the number of windows to occupy the master area (tile layout).\n```\nset [WS] stack  3            # absolute values have no signs\nset [WS] master +1 stack -1  # relative change with signed integers (+/-)\n```\n---\n\n`msplit` `ssplit` (float) change the workspace master or stack split ratios respectively.\n```\nset [WS] msplit +0.1\nset [WS] ssplit 0.55\n```\n---\n\n`gap` (integer) change the workspace gap width.\n```\nset [WS] gap 10\n```\n---\n\n`tile_hints` (boolean) obey size hints in tiled layouts.\n```\nset tile_hints=true\n```\n---\n\n`tile_tohead` (boolean) place new windows at the head of the list in tiled layouts.\n```\nset tile_tohead=true\n```\n---\n\n`smart_gap` (boolean) remove gaps on workspaces with only one tiled window.\n```\nset smart_gap=true\n```\n---\n\n`smart_border` (boolean) remove borders on workspaces with only one tiled window.\n```\nset smart_border=true\n```\n---\n\n`focus_urgent` (boolean) focus windows that request it through client messages.\n```\nset focus_urgent=true\n```\n---\n\n`focus_open` (boolean) disable focus-on-open.\n```\nset focus_open=false\n```\n---\n\n`focus_mouse` (boolean) disable focus-follows-mouse.\n```\nset focus_mouse=false\n```\n---\n\n`win_minxy` (integer) amount of window (in pixels) to be kept on the screen when moving.\n```\nset win_minxy=20\n```\n---\n\n`win_minwh` (integer) minimum window size.\n```\nset win_minwh=50\n```\n---\n\n`apply` when changing the default `_` workspace apply settings to existing real workspaces.\n```\nset ws=_ apply SETTING\n```\n---\n\n`layout` (string) change the workspace window layout.\n\n- `tile` default tile layout\n- `rtile` tile layout with master area on the right\n- `mono` windows arranged maximized and stacked\n- `grid` all windows try to occupy equal space\n- `spiral` windows shrink by 1/2 towards the center of the screen\n- `dwindle` windows shrink by 1/2 towards the bottom right of the screen\n- `none` floating, no layout\n\n```\nset [WS] layout mono\n```\n---\n\n`border` change the window border sizes and colours.\n\n- `w` `width` (integer) change the overall window border width.\n- `ow` `outer` `outer_width` (integer) change the outer border width (greater than 0 makes double borders).\n- `colour` `color` (string) change the border (overall and outer) colour for various window states.\n    - `f` `focus` (colour) the active window border overall colour.\n    - `r` `urgent` (colour) urgent window border overall colour.\n    - `u` `unfocus` (colour) normal window border overall colour.\n    - `of` `outer_focus` (colour) the active window outer border colour.\n    - `or` `outer_urgent` (colour) urgent window outer border colour.\n    - `ou` `outer_unfocus` (colour) normal window outer border colour.\n\n```\nset border w=5 ow=3 colour f='#6699cc' u='#444444' r='#ee5555' of='#222222' ou='#222222' or='#222222'\n```\n---\n\n`pad` change the workspace padding.\n\n- `l` `left` (integer) change the workspace left side padding.\n- `r` `right` (integer) change the workspace right side padding.\n- `t` `top` (integer) change the workspace top padding.\n- `b` `bottom` (integer) change the workspace bottom padding.\n\n```\nset [WS] pad l=50 r=50 t=50 b=50\n```\n---\n\n`mouse` change the mouse binds for move and resize (global, does not take a workspace).\n\n- `mod` (string) change the modifier used in combination with move resize buttons.\n    - `alt` `mod1` Alt key (default).\n    - `super` `mod4` Win key.\n    - `ctrl` `control` Ctrl key.\n\n- `move` `resize` (string) change the button used for move and resize respectively.\n    - `button1` left mouse button.\n    - `button2` right mouse button.\n    - `button3` middle mouse button.\n\n```\nset mouse move=button1 resize=button2 mod=mod1\n```\n---\n\n#### Win\n`win` operates on windows.\n\n- `CLIENT` (hex) the window id, if unspecified the current window is used.\n\n```\nwin [CLIENT] ACTION\n```\n\n###### Settings\n`cycle` cycle windows in place.\n```\nwin cycle\n```\n---\n\n`float` change the window floating state.\n```\nwin [CLIENT] float\n```\n---\n\n`full` change the window fullscreen state.\n```\nwin [CLIENT] full\n```\n---\n\n`fakefull` change the window fake fullscreen state (allow moving, resizing, and tiling when fullscreen).\n```\nwin [CLIENT] fakefull\n```\n---\n\n`stick` change the window sticky state.\n```\nwin [CLIENT] stick\n```\n---\n\n`swap` change the window between it's current location and master.\n```\nwin [CLIENT] swap\n```\n---\n\n`kill` close the window.\n```\nwin [CLIENT] kill\n```\n---\n\n`focus` (integer/string) change the focused window.\n\n- `next` focus the next window.\n- `prev` focus the previous window.\n\n```\nwin CLIENT focus  # focus window by id\nwin focus next    # focus the next window\nwin focus +2      # focus two windows ahead\n```\n---\n\n`mvstack` (integer/string) move a tiled window around the stack.\n\n- `up` move the tiled window up the stack.\n- `down` move the tiled window down the stack.\n\n```\nwin [CLIENT] mvstack up\n```\n---\n\n`resize` change the window size, location, and border width.\n\n- `x` change the x coordinate, can be an integer or one of the following.\n    - `center left` and `right` gravitate on the x coordinate.\n\n- `y` change the y coordinate, can be an integer or one of the following.\n    - `center top` and `bottom` gravitate on the y coordinate.\n\n- `w` `width` change the window width.\n- `h` `height` change the window height.\n- `bw` `border_width` change the window border width.\n\n```\nwin [CLIENT] resize x=100 y=100 w=1280 h=720 bw=1\nwin [CLIENT] resize x=center y=center w=1280 h=720 bw=1\n```\n---\n#### Status\n`status` print status information to a file or stdout.\n\n```\nstatus [TYPE] [FILE] [NUM]\n```\n\n###### Subcommands\n`type` (string) the type of status info to output.\n\n- `ws` output workspace info.\n- `win` output current window title.\n- `layout` output current workspace layout name.\n- `bar` output simple info for use in bars *(win, layout, and ws combined)*.\n- `full` output the full wm and managed client state.\n\n```\nstatus type=ws [FILE] [NUM]\n```\n---\n\n`file` (string) the location of the status file.\n\n```\nstatus file=/tmp/dk.status [TYPE] [NUM]\n```\n---\n\n`num` (integer) the number of times to output, -1 is infinite and default if not specified.\n\n```\nstatus [TYPE] [FILE]        # output forever\nstatus num=1 [TYPE] [FILE]  # output once\n```\n\n\n### Todo\n\n- Simplification.\n\n\n### Contributing\n\nI'm very open to contributions or ideas.\n\n\nTo enable internal stderr debug output\n```\nmake debug\n```\n\nTe enable debug and get function calls\n```\nmake fdebug\n```\n\nTo leave debug symbols in *(for gdb, valgrind, etc.)*.\n```\nmake nostrip\n```\n\n\n### Credits\n\nSee the LICENSE file for a list of authors/contributors.\n\nHuge thanks to Kjetil Molteberg *(@badkarma)* on the Archlabs forum for the logo.\n\nNon contributors that I owe a huge thanks to:\n[dwm](https://dmw.suckless.org), [bspwm](https://github.com/baskerville/bspwm),\n[xmonad](https://xmonad.org), [evilwm](http://www.6809.org.uk/evilwm/),\n[monsterwm-xcb](https://github.com/Cloudef/monsterwm-xcb),\n[4wm](https://github.com/dct2012/4wm), and [frankenwm](https://github.com/sulami/FrankenWM).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativecodecat%2Fdk-wm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreativecodecat%2Fdk-wm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativecodecat%2Fdk-wm/lists"}