How the dockrc File Configures GIMP's Panels in PhotoGIMP
The dockrc file in PhotoGIMP stores the exact position, size, and grouping of GIMP's dockable panels, forcing the application to load a Photoshop-like workspace layout on every startup.
The dockrc file is one of the core configuration components that PhotoGIMP installs to transform GIMP's interface into a Photoshop-style workspace without modifying the application's source code. This plain-text configuration file tells GIMP 3.0 exactly how to arrange its panels, including which docks appear on the left, which appear on the right, and how they are grouped together. Understanding how the dockrc file configures GIMP's panels in PhotoGIMP allows you to customize or restore the workspace layout to match your specific workflow needs.
What Is the dockrc File?
The dockrc file is a GIMP-native configuration file that PhotoGIMP places in your ~/.config/GIMP/3.0/ directory during installation. Unlike generic preference files, dockrc specifically controls the dockable widgets—the panels that display Layers, Channels, Brushes, History, and Tool Options.
According to the PhotoGIMP repository's README.md (line 179), dockrc is explicitly listed as the file responsible for "Dock / panel configuration." When GIMP launches, it parses this file to recreate the exact layout defined by PhotoGIMP's maintainers, ensuring the interface mimics Adobe Photoshop's panel arrangement regardless of your previous GIMP session.
How dockrc Defines Panel Layout in PhotoGIMP
The dockrc file uses a specific Lisp-like syntax to declare three critical aspects of the user interface: which widgets exist, where they are positioned, and how they are grouped.
Declaring Dockable Widgets
Each panel begins with a dockable declaration that registers the widget with GIMP's dock system. The PhotoGIMP dockrc defines essential panels including:
gimp-tool-options— The Tool Options panelgimp-layers— The Layers panelgimp-channels— The Channels panelgimp-brushes— The Brushes panelgimp-history— The Undo History panel
The syntax follows this pattern:
(dockable "gimp-tool-options" "Tool Options" 0 0)
(dockable "gimp-layers" "Layers" 0 0)
(dockable "gimp-channels" "Channels" 0 0)
Positioning and Grouping Panels
After declaring the widgets, the dockrc file uses dockable-position directives to assign each panel to a specific side of the interface. The format (GIMP-DIALOG-DOCKED 0) places panels on the left side, while (GIMP-DIALOG-DOCKED 1) places them on the right:
(dockable-position "gimp-tool-options" (GIMP-DIALOG-DOCKED 0) 0)
(dockable-position "gimp-layers" (GIMP-DIALOG-DOCKED 0) -1)
Finally, the dockable-group command tells GIMP to combine multiple panels into a single tabbed container, reproducing the Photoshop-style stacked panels:
(dockable-group "gimp-layers" "gimp-channels" "gimp-brushes" "gimp-history")
This grouping places Layers, Channels, Brushes, and History into a single dock with tabs, while Tool Options typically remains separate on the opposite side.
Where PhotoGIMP Installs the dockrc File
During PhotoGIMP installation, the dockrc file is copied to your GIMP 3.0 configuration directory. The standard location is:
~/.config/GIMP/3.0/dockrc
This path corresponds to GIMP's native configuration structure, allowing the application to read the file naturally on startup. Because PhotoGIMP replaces or supplements this file, GIMP loads the PhotoGIMP workspace layout instead of any previously saved configuration.
Customizing Your Panel Layout
You can manually edit the dockrc file to adjust the PhotoGIMP layout. Changes take effect after restarting GIMP.
To move the History panel from the left side to the right side, modify the dock parameter from 0 to 1:
sed -i 's/(GIMP-DIALOG-DOCKED 0)/(GIMP-DIALOG-DOCKED 1)/' ~/.config/GIMP/3.0/dockrc
For more granular control, open the file in a text editor and adjust the numerical values in the dockable-position lines:
- The first number after
GIMP-DIALOG-DOCKEDindicates the side (0 for left, 1 for right) - The final number controls the vertical order within that side (0 is top, -1 is auto-ordered)
Summary
- The
dockrcfile controls the arrangement of GIMP's dockable panels in PhotoGIMP by defining widget declarations, positions, and groupings. - PhotoGIMP installs this file to
~/.config/GIMP/3.0/dockrcto enforce a Photoshop-like workspace layout on every startup. - The file uses
(dockable ...)to declare panels,(dockable-position ...)to place them on left (0) or right (1) sides, and(dockable-group ...)to create tabbed panel stacks. - You can manually edit
dockrcwith text editors or command-line tools to customize the layout, with changes applying after the next GIMP restart.
Frequently Asked Questions
What is the dockrc file in PhotoGIMP?
The dockrc file is a configuration file that stores the layout of GIMP's dockable panels (Layers, Channels, Tool Options, etc.). In PhotoGIMP, this file is pre-configured to arrange panels in a Photoshop-style layout, ensuring the interface looks familiar to users migrating from Adobe's software. It is one of several configuration files—including shortcutsrc, toolrc, and sessionrc—that work together to transform GIMP's default appearance.
Where is the dockrc file located?
PhotoGIMP installs the dockrc file in your GIMP 3.0 user configuration directory, typically found at ~/.config/GIMP/3.0/dockrc on Linux systems. This location follows GIMP's standard configuration hierarchy, allowing the application to automatically read and apply the panel layout settings when the program launches.
Can I edit the dockrc file manually?
Yes, you can edit the dockrc file with any text editor to customize your panel arrangement. The file uses a readable syntax where you can modify (dockable-position ...) parameters to move panels between sides or change their stacking order. After saving your changes, you must restart GIMP for the new layout to take effect. Always back up the original file before making modifications.
Why does PhotoGIMP use dockrc instead of modifying GIMP directly?
PhotoGIMP uses the dockrc file to avoid modifying GIMP's core source code, making the project maintainable across GIMP updates. By leveraging GIMP's native configuration system, PhotoGIMP achieves its Photoshop-like interface purely through settings files that can be easily installed, updated, or removed without compiling software. This approach allows users to benefit from the latest GIMP releases while retaining the PhotoGIMP workspace customization.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →