CK Core Apps
CK Core Apps

Screen Capture (ck-grab)

ck-grab (CkGrab X application class, window title Grab) is a compact Motif screenshot tool for capturing either the full desktop or the currently active window, with optional capture delay, window manager frame inclusion, and pointer cursor compositing across both X11/XLibre (XGetImage + XFixesGetCursorImage) and Wayland (zwlr_screencopy_manager_v1 under dtwm-wayland when WAYLAND_DISPLAY is set).

Capture options

Control / Menu itemDefaultDescription
Target (Full Screen / Active Window)Full ScreenCaptures either the root window or the focused client window (_NET_ACTIVE_WINDOW, falling back to XGetInputFocus).
Delay (s) (0–10)0Countdown in seconds before reading screen pixels, allowing menus or transient UI states to be staged.
Settings → Include Window FrameEnabledWalks XQueryTree up to the top-level window-manager frame when Target is Active Window. Disabled when capturing Full Screen.
Settings → Include Mouse CursorEnabledComposites the live pointer image (XFixesGetCursorImage) onto the captured screenshot.
Settings → Hide Grab WindowEnabledWithdraws ck-grab before capturing so the tool does not appear in its own screenshot, then restores it afterward.

Saving screenshots

Clicking Create Screenshot (or pressing Return) captures the target image and opens Save Screenshot As... (XmFileSelectionDialog):

  • Output formats: Choose PNG (8-bit RGBA via libpng) or XPM (XpmWriteFileFromImage) from the dialog's Format selector.
  • Automatic extension & overwrite check: Changing the format updates the file filter (*.png or *.xpm) and appends the matching extension when omitted. Existing files prompt a modal Overwrite File? confirmation before writing.

Keyboard shortcuts

ActionShortcut
Create ScreenshotReturn
CloseEscape
File → ExitAlt+F4

Command-line options and persistence

ck-grab [--capture <file> | -o <file>] [--window | --full-screen]
        [--include-frame | --no-frame] [--include-cursor | --no-cursor]
        [--delay <0..10>] [--format png|xpm] [-session <session_id>] [Xt options...]
  • Direct CLI capture (--capture <file> / -o <file>): Captures the requested target immediately (after any --delay) and writes the PNG or XPM file without opening the interactive window. Under Wayland (WAYLAND_DISPLAY), Full Screen composites all active outputs via zwlr_screencopy_manager_v1 and Active Window (--window) crops to dtwm-wayland's _DT_ACTIVE_WINDOW_BOX (with or without its server-side CDE 3D bevel frame), capturing both native Wayland and XWayland windows cleanly.
  • User configuration:
    • $XDG_CONFIG_HOME/ck-core/ck-grab.view (default ~/.config/ck-core/ck-grab.view): persists target, delay, include_frame, include_cursor, hide_window, and format.
    • $XDG_CONFIG_HOME/ck-core/ck-grab.paths (default ~/.config/ck-core/ck-grab.paths): persists last_dir (the last directory visited in the save dialog, defaulting to $HOME).
  • CDE session state: Saves and restores window position (x, y, w, h) alongside target, delay, include_frame, include_cursor, hide_window, and format.

Current limitations

  • ck-grab captures either the full screen or the active window; interactive drag-rectangle region selection is not currently implemented.
  • Capture delay runs synchronously on the UI thread before taking the X11 snapshot.