DK(1)

πŸ“¦ version 2.3, in alpine 3.24, nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay so dk(1) β€” yes, from the General Commands Manual β€” is a tiling window manager in the vein of dwm, bspwm, and xmonad, and it’s lowkey iconic. Windows are managed in various layouts, and are grouped by workspaces. Each window can be assigned to a single workspace and will have a small border to indicate the focus state. Changes to one workspace will not impact others. Workspaces can be dynamically or statically assigned and viewed on any monitor; by default only one workspace per monitor is created.

✨ SYNOPSIS ✨

dk [-vh]

dkcmd [-vh] [-p [FILE]] [COMMAND]

πŸ¦‹ DESCRIPTION πŸ¦‹

Monitors can be assigned one workspace at a time, all workspaces are available from all monitors in dynamic mode, and floating windows will retain their relative location within each monitor area. If you’re viewing an already visible workspace on another monitor, the two workspaces will swap monitors when dynamic; otherwise the mouse will be warped to the assigned monitor.

Tiled layout: windows are organized in a master and two stack areas. The number of masters and first stack windows can be adjusted from 0-n with the second stack containing all remaining windows.

Monocle layout: windows are maximized and stacked on top of each other with only one visible at a time.

Grid layout: windows attempt to occupy equal space with all being visible.

Spiral and dwindle layout: windows occupy 1/2 the space of the previous, moving inwards to the center of the screen or outwards to the bottom right respectively.

Floating layout: windows are not organized or placed in any particular way and can be moved or resized freely.

πŸ’… OPTIONS πŸ’…

  • -h β€” prints usage information to stdout and exits.
  • -v β€” prints version information to stdout and exits.
  • -p β€” pretty format JSON input from FILE or STDIN and print on STDOUT.

🌸 CUSTOMIZATION 🌸

For basic changes, dk can be customized by running commands through the dkcmd program.

On startup dk looks for a dkrc file in:

  • $DKRC
  • $XDG_CONFIG_HOME/dk/dkrc
  • $HOME/.config/dk/dkrc

and runs the first one it can. This file must be executable. It can be used to initialize settings, customization, and running programs.

Further configuration such as adding layouts or callbacks can be done by copying config.def.h to config.h, editing it, and recompiling.

🧚 DKCMD 🧚

Most of your interaction with the window manager will be using dkcmd, which writes one or more commands into the socket where it is then read and parsed by the window manager.

✨ Syntax Outline ✨

The commands have a very basic syntax and parsing. The input is broken down into smaller pieces (tokens) which are then passed to the matching keyword function; otherwise an error is returned.

Tokens are delimited by one or more:

  • whitespace (space or tab)
  • quotation mark (' or ")
  • equal sign (=)

This means the following inputs are all equivalent.

setting=value
setting value
setting="value"
setting = 'value'
setting "value"
setting     "value"

and result in two tokens: setting and value. Quotation exists as a way to preserve whitespace and avoid interpretation by the shell; otherwise we have no way of determining whether an argument is a continuation of the previous or the beginning of the next. If the value being matched has quotes in it, they can be escaped or strong quoted.

title="^\"preserved quotes\"$"
title='^"preserved quotes"$'

For various commands dk will expect a certain data type or format to be given.

  • string β€” normal plain text, must be less than 256 characters.
  • boolean β€” true, false, 1, or 0.
  • hex β€” (0x/#)XXXXXXXX, used for window ids.
  • integer β€” (+/-)1; if it is preceded by a sign it is considered relative.
  • float β€” (+/-)0.1; same as integer but must contain a decimal value.
  • colour β€” (0x/#)[AA]RRGGBB, hex value; if no alpha channel is given the colour is opaque.

πŸ”₯ COMMANDS πŸ”₯

dkcmd COMMAND

πŸ‘‘ WM πŸ‘‘

  • exit β€” exit dk.
  • restart β€” re-execute dk.

🌈 Ws and Mon 🌈

mon and ws operate on monitors and workspaces respectively.

  • CLIENT (hex/string) β€” the window id in hex or class string; if unspecified the active window is used.
  • TARGET (integer/string) β€” name or number of the workspace or monitor to target, or one of these strings:
    • next β€” relative forward
    • prev β€” relative backward
    • last β€” last viewed
    • nextne β€” next non-empty
    • prevne β€” previous non-empty
ws  [SUBCOMMAND] [CLIENT] TARGET
mon [SUBCOMMAND] [CLIENT] TARGET

πŸ’« Subcommands πŸ’«

  • view β€” view the TARGET, default if no subcommand is given.
ws view TARGET
ws TARGET
  • send β€” send CLIENT to the TARGET.
mon send [CLIENT] TARGET
  • follow β€” follow CLIENT to the TARGET.
ws follow [CLIENT] TARGET

πŸ¦‹ Rule πŸ¦‹

rule operates on window rules.

  • MATCH β€” one or more regex strings to be used when matching window properties.
  • SETTING β€” one or more window setting to be applied when a matched window is encountered.
rule [SUBCOMMAND] MATCH SETTING

πŸ’œ Subcommands πŸ’œ

  • apply β€” applies RULE to all matching windows; if RULE is * apply all rules and MATCH is ignored.
rule apply RULE [MATCH]
  • remove β€” removes RULE; if RULE is * remove all rules and MATCH is ignored.
rule remove RULE [MATCH]

🌟 Settings 🌟

  • class instance title type (string) β€” regex to match the window class, instance, title, and type respectively (may be prefixed with match_ for clarity). Regex matching is always done case insensitive with extended regex mode enabled.
rule [SUBCOMMAND] class="^firefox$" instance="^navigator$" title="^mozilla firefox$" type=dialog [SETTING]
type currently only supports dialog and splash windows; all others are treated as normal windows.
  • ws (integer/string) β€” determine what workspace the window should be on.
rule MATCH ws=1
rule MATCH ws=term
  • mon (integer/string) β€” determine what monitor the window should be on.
rule MATCH mon=1
rule MATCH mon=HDMI-A-0
  • x y w width h height bw border_width (integer/string) β€” determine the window location and size.
    • x β€” change the x coordinate; can be an integer or one of the following.
      • center β€” left and right gravitate on the x coordinate.
    • y β€” change the y coordinate; can be an integer or one of the following.
      • center β€” top and bottom gravitate on the y coordinate.
    • w width β€” change the window width.
    • h height β€” change the window height.
    • bw border_width β€” change the window border width.
rule MATCH x=20 y=100 w=1280 h=720 bw=0
rule MATCH x=center y=center w=1280 h=720 bw=0
  • callback (string) β€” determine a callback function to be invoked on window open and close. These are defined in the config header and compiled into the source; one example is provided.
rule MATCH callback=albumart
  • float stick (boolean) β€” determine if the window should be floating or stick respectively.
rule MATCH float=true stick=true
  • ignore_cfg (boolean) β€” determine if the window should ignore configure request events (size or location changes).
rule MATCH ignore_cfg=true
  • ignore_msg (boolean) β€” determine if the window should ignore client message window activation events (grabbing focus).
rule MATCH ignore_msg=true
  • focus (boolean) β€” determine if the window should be focused and view its workspace. If mon is also set it will be activated first before viewing the workspace.
rule MATCH focus=true
  • terminal (boolean) β€” determine if the window should be considered a terminal for absorbing other windows and not being absorbed itself.
rule MATCH terminal=true
  • no_absorb (boolean) β€” determine if the window should never absorb other windows.
rule MATCH no_absorb=true
  • scratch (boolean) β€” determine if the window should be in the scratchpad.
rule MATCH scratch=true

πŸ’– Set πŸ’–

set operates on workspace or global configuration settings.

  • SETTING β€” one or more settings to be changed.
  • WS β€” the workspace which subcommand should apply to; if unspecified the current is used. _ is a special workspace used to define default values for new workspaces which haven’t been created yet.
set [WS] SETTING
set ws=_ [apply] SETTING

πŸŽ€ Set Options πŸŽ€

  • numws (integer) β€” change the number of workspaces to allocate.
set numws=10
  • name (string) β€” change the WS name.
set ws=1 name="term"
  • static_ws (boolean) β€” disable dynamic workspaces for multi-head systems.
set static_ws=false
  • mon (integer/string) β€” change which monitor WS should be on (requires static_ws=true).
set ws=1 mon=HDMI-A-0
set ws=1 mon=1
  • master stack (integer) β€” change the number of windows to occupy the master area (tile layout).
set [WS] stack  3
set [WS] master +1 stack -1
  • msplit ssplit (float) β€” change the workspace master or stack split ratios respectively.
set [WS] msplit +0.1
set [WS] ssplit 0.55
  • gap (integer) β€” change the workspace gap width.
set [WS] gap 10
  • tile_hints (boolean) β€” whether to respect size hints in tiled layouts.
set tile_hints=true
  • tile_tohead (boolean) β€” whether to place new windows at the head or the tail of the list in tiled layouts.
set tile_tohead=true
  • smart_gap (boolean) β€” whether gaps are disabled on workspaces with only one tiled window.
set smart_gap=true
  • smart_border (boolean) β€” whether borders are disabled on workspaces with only one tiled window.
set smart_border=true
  • focus_urgent (boolean) β€” whether to focus windows that request it.
set focus_urgent=true
  • focus_open (boolean) β€” whether windows are focused when opened.
set focus_open=false
  • focus_mouse (boolean) β€” whether window focus follows the mouse.
set focus_mouse=false
  • obey_motif (boolean) β€” whether to obey motif hints for borders.
set obey_motif=false
  • win_minxy (integer) β€” amount of window (in pixels) to be kept on the screen when moving.
set win_minxy=20
  • win_minwh (integer) β€” minimum window size.
set win_minwh=50
  • apply β€” when changing the default _ workspace apply settings to existing real workspaces.
set ws=_ apply SETTING
  • layout (string) β€” change the workspace window layout.
    • tile β€” windows are grouped into master and stack areas.
    • rtile β€” tile layout with master area on the right.

okay so the layout list is lowkey a whole menu of vibes, bestie:

  • mono β€” windows arranged maximized and stacked on top of one another.
  • grid β€” all windows try to occupy equal space.
  • spiral β€” windows shrink by 1/2 towards the center of the screen.
  • dwindle β€” windows shrink by 1/2 towards the bottom right of the screen.
  • tstack β€” windows are grouped into a master area on the bottom and one horizontal stack area on top.
  • none β€” floating layout, windows can be freely moved and resized.
  • cycle β€” switch between available layouts.
set [WS] layout mono

border β€” change the window border sizes and colours. It’s giving window makeup πŸ’…

  • w / width (integer) β€” change the overall window border width.
  • ow / outer / outer_width (integer) β€” change the outer border width (greater than 0 makes double borders).
  • colour / color (string) β€” change the border (overall and outer) colour for various window states.
    • f / focus (colour) β€” the active window border overall colour.
    • r / urgent (colour) β€” urgent window border overall colour.
    • u / unfocus (colour) β€” normal window border overall colour.
    • of / outer_focus (colour) β€” the active window outer border colour.
    • or / outer_urgent (colour) β€” urgent window outer border colour.
    • ou / outer_unfocus (colour) β€” normal window outer border colour.
set border w=5 ow=3 colour f='#6699cc' u='#444444' r='#ee5555' of='#222222' ou='#222222' or='#222222'

pad β€” change the workspace padding. Personal space but for windows ✨

  • l / left (integer) β€” change the workspace left side padding.
  • r / right (integer) β€” change the workspace right side padding.
  • t / top (integer) β€” change the workspace top padding.
  • b / bottom (integer) β€” change the workspace bottom padding.
set [WS] pad l=50 r=50 t=50 b=50

mouse β€” change the mouse binds for move and resize (global, does not take a workspace). mouse girlies rise πŸ–±οΈ

  • mod (string) β€” change the modifier used in combination with move resize buttons.
    • alt / mod1 β€” Alt key (default).
    • super / mod4 β€” Win key.
    • ctrl / control β€” Ctrl key.
  • move, resize (string) β€” change the button used for move and resize respectively.
    • button1 β€” left mouse button.
    • button2 β€” right mouse button.
    • button3 β€” middle mouse button.
set mouse move=button1 resize=button2 mod=mod1

πŸͺŸ Win

win operates on windows. window whisperer energy fr fr 🫢

  • CLIENT (hex/string) β€” the window id in hex or class string, if unspecified the current window is used.
win [CLIENT] ACTION

⚑ Actions

  • cycle β€” cycle windows in place.
win cycle
  • float β€” change the window floating state.
win [CLIENT] float
win [CLIENT] float=false
  • full β€” change the window fullscreen state.
win [CLIENT] full
  • fakefull β€” change the window fake fullscreen state (allow moving, resizing, and tiling when fullscreen).
win [CLIENT] fakefull
  • stick β€” change the window sticky state.
win [CLIENT] stick
  • swap β€” change the window between its current location and master.
win [CLIENT] swap
  • kill β€” close the window.
win [CLIENT] kill
  • focus (integer/string) β€” change the focused window.
    • next β€” focus the next window.
    • prev β€” focus the previous window.
win CLIENT focus
win focus next
win focus +2
  • scratch (integer/string) β€” show or hide a scratchpad window.
    • pop β€” show a window in the scratch.
    • push β€” hide a window in the scratch.

With no arguments scratch will do the following:

  • If there are window(s) in the scratch it will continue to pop them out until empty.
  • If there is a window on any workspace (other than the current workspace) that has been recently popped, it will be brought to the current workspace. If it's on the current workspace it is instead pushed.
  • If there are no window(s) in the scratch and no windows that have been there previously it will push the active window into the scratch.
win scratch
win [CLIENT] scratch # same toggle behaviour but on the passed window
win [CLIENT] scratch push # push the given window or the active window.
  • mvstack (integer/string) β€” move a tiled window around the stack.
    • up β€” move the tiled window up the stack.
    • down β€” move the tiled window down the stack.
win CLIENT mvstack up
  • resize β€” change the window size, location, and border width.
    • x β€” change the x coordinate, can be an integer or one of the following.
      • center β€” left and right gravitate on the x coordinate.
    • y β€” change the y coordinate, can be an integer or one of the following.
      • center β€” top and bottom gravitate on the y coordinate.
    • w / width β€” change the window width.
    • h / height β€” change the window height.
    • bw / border_width β€” change the window border width.
win [CLIENT] resize x=100 y=100 w=1280 h=720 bw=1
win [CLIENT] resize x=center y=center w=1280 h=720 bw=1

πŸ“Š Status

status β€” print status information as JSON to a file or stdout. data slay πŸ’–

status [TYPE] [FILE] [NUM]

βš™οΈ Settings

type β€” the type of status to output and when to trigger.

  • ws β€” output full workspace info - triggers on workspace change.
  • win β€” output current window title - triggers on window or title change.
  • layout β€” output current layout name - triggers on layout change.
  • bar β€” identical output to ws except - triggers on all changes.
  • full β€” output full wm and client state - triggers on all changes.
status type=ws [FILE] [NUM]

file β€” the location of the status file (if not passed stdout is used).

status file=/tmp/dk.status [TYPE] [NUM]

num β€” the number of times to output, -1 is infinite and default if not passed.

status [TYPE] [FILE]
status num=1 [TYPE] [FILE]

πŸ› BUGS

Please submit a bug report with as much detail as possible to https://bitbucket.org/natemaia/dk/issues/new β€” they wanna know the whole tea β˜•οΈπŸ‘€

πŸ‘‘ AUTHORS/CONTRIBUTORS

Nathaniel Maia (natemaia10@gmail.com), Dmitry Belitsky (dmitry.belitsky@gmail.com)


that’s the whole source/version dk-2.2 and DK(1) man page moment, bestie β€” stay slay, stay iconic πŸ’–βœ¨πŸŒˆ

πŸ“¦ where this page comes from