Back to the Dir Colors project
Original project · User guide

DirColors 1.4.1

User guide for creating and editing a .dircolors file on Linux Mint.

Version 1.4.1 For Linux Mint

1. Purpose of the program

DirColors is a graphical interface for editing the ~/.dircolors file. This file defines the colours used for directories, executable files, links, archives, images and other file types in colour-capable terminal output.

Important: These settings mainly affect terminal programs such as ls. They normally do not change icon or text colours in the Nemo file manager.

2. Program interface

The upper part of the main window contains the most important functions:

ElementFunction
OpenLoad an existing .dircolors file.
SaveSave the current settings to a file.
ApplyApply the generated configuration.
DefaultsRestore the program's built-in starting values.
File typesColours for directories, files, links, programs and device files.
File extensionsColours for file patterns such as *.py, *.pdf or *.zip.
PreviewCheck the selected colours before saving.
SettingsManage the file path, language, system defaults and shell command.

The status bar at the bottom shows the loaded file. On the right, the interface theme detected by the application is displayed, for example Mint-Y-Aqua.

3. Editing file types

The File types tab contains general entries that do not depend on a particular file extension.

DirColors File types tab
General file types such as directories, regular files, programs, links and devices.
EntryMeaning
DIRDirectory
FILERegular file
EXECExecutable file
LINKSymbolic link
ORPHANBroken symbolic link
MISSINGMissing link target
FIFONamed pipe
SOCKSocket
BLKBlock device
CHRCharacter device
  1. Select the required entry in the table.
  2. Click Edit.
  3. Set the foreground, background and text attributes.
  4. Confirm the change with Apply.

4. Managing file extensions

The File extensions tab defines colours for specific file extensions or file patterns.

DirColors File extensions tab
Examples for Python, shell, text, PDF, image and archive files.

Adding a new entry

  1. Click Add.
  2. Enter a pattern in the Entry field, for example *.py.
  3. Enter a clear description.
  4. Select colours and text attributes.
  5. Save with Apply.

Changing or deleting an existing entry

Select the entry and then choose Edit or Delete. Before deleting it, check whether the entry may still be required later.

File patterns: File extensions should normally use the pattern *.extension, for example *.jpg. This makes the rule apply to every file with that extension.

5. Editing an entry

Edit file extension dialog
Editing dialog for the *.py entry.
FieldDescription
EntryFile pattern, for example *.py.
DescriptionReadable name, for example “Python files”.
ForegroundText colour from the standard or 256 terminal colours.
Custom RGB foregroundSelect an individual true colour.
BackgroundBackground colour or “None”.
Custom RGB backgroundIndividual background colour.
BoldMakes the file name stand out more strongly.
UnderlinedUnderlines the file name.
ANSI codeThe colour code generated from the settings.
PreviewImmediately shows how the entry should appear in the terminal.

Apply saves the change in the program's current state. Cancel closes the dialog without changing the entry.

6. Using the preview

The Preview tab displays the colours together. Pay particular attention to sufficient readability.

  • Avoid light text on a light background.
  • Avoid dark text on a dark background.
  • Do not use very similar colours for different important file types.
  • Also test the result in a real terminal because terminal profiles may reproduce colours differently.

7. Settings

DirColors Settings tab
File path, colour range, language and helper functions.
Setting or buttonFunction
Current fileShows the configuration file that is currently loaded.
Default pathUsual location of the personal file, for example /home/josef/.dircolors.
Colour rangeSupport for 16 standard colours, the XTerm-256 palette and custom RGB colours.
LanguageSelects the program language.
Language filesFolder from which the available translations are loaded.
Import system defaultsLoads the starting configuration supplied by the system.
Copy shell commandCopies the shell command required for activation to the clipboard.
Show generated fileOpens a view of the file generated by DirColors.

8. Recommended workflow

  1. Load a starting point: Open an existing file with Open, or create a new basis with Import system defaults.
  2. Adjust file types: Set colours for directories, programs, links and device files.
  3. Add file extensions: Add custom rules such as *.py, *.sh or *.pdf.
  4. Check the preview: Verify readability and contrast.
  5. Save: Save the file in the required location, usually as ~/.dircolors.
  6. Apply: Apply the configuration in DirColors.
  7. Configure the shell: Use Copy shell command and add the command to the configuration of the shell as described by the program.
  8. Reopen the terminal: Open a new terminal window and test the colour output.

9. Notes and troubleshooting

Colours do not change in the terminal

  1. Check that the correct file was loaded and saved.
  2. Click Apply after saving.
  3. Check the command produced by Copy shell command.
  4. Open a new terminal or reload the shell configuration.
  5. Check that coloured terminal output is enabled.

A file pattern is not recognised

Check the pattern for typing errors. A file extension normally uses *.extension. Separate entries may be necessary for different spellings, for example *.jpg and *.JPG.

The preview looks different from the terminal

Terminal profiles can alter colours or display only a limited colour range. The final check should therefore always be performed in the terminal that will actually be used.

Backup before major changes

Before making extensive changes, create a copy of the existing file, for example with a name such as .dircolors.backup.

Documentation based on the interface of DirColors version 1.4.1.