kde-extract

star 8

Extract KDE settings and convert to plasma-manager Nix configuration

iamruinous By iamruinous schedule Updated 1/24/2026

name: kde-extract description: Extract KDE settings and convert to plasma-manager Nix configuration compatibility: Requires KDE/Plasma desktop environment metadata: author: ruinous.ai version: "1.1" parameters: config_file: type: select description: KDE config file to extract settings from required: true options: - label: "kwinrc (Recommended)" description: "Window manager - tiling, effects, desktops" - label: "kdeglobals" description: "Global KDE settings - theme, fonts, colors" - label: "kglobalshortcutsrc" description: "Keyboard shortcuts" - label: "plasmarc" description: "Plasma shell settings" - label: "kscreenlockerrc" description: "Lock screen settings" - label: "kcminputrc" description: "Input device settings" - label: "all" description: "List all available config files" - label: "Enter other..." description: "Specify a custom config file" section_filter: type: string description: Optional section to filter (e.g., "TabBox", "Desktops") required: false placeholder: "TabBox"


KDE Extract

Extract current KDE/Plasma settings from config files and convert them to declarative plasma-manager Nix configuration.

Parameter Handling

If parameters are missing from $ARGUMENTS, use mcp_question to gather them:

mcp_question({
  questions: [
    {
      question: "Which KDE config file do you want to extract?",
      header: "Config File",
      options: [
        { label: "kwinrc (Recommended)", description: "Window manager settings" },
        { label: "kdeglobals", description: "Global theme, fonts, colors" },
        { label: "kglobalshortcutsrc", description: "Keyboard shortcuts" },
        { label: "plasmarc", description: "Plasma shell settings" },
        { label: "all", description: "List all available config files" },
        { label: "Enter other...", description: "Specify custom config file" }
      ]
    }
  ]
})

Expected $ARGUMENTS format: <config_file> [section_filter]

  • Example: kwinrc (all sections)
  • Example: kwinrc TabBox (only TabBox section)
  • Example: all (list all config files)

Steps

  1. Parse arguments from $ARGUMENTS

  2. If "all" or empty, list available KDE config files:

    ls -1 ~/.config/k* ~/.config/plasma* 2>/dev/null | grep -v '.lock' | head -30
    

    Then ask user which file(s) to extract.

  3. Read the specified config file(s):

    cat ~/.config/<filename>
    
  4. Parse the INI format and convert to plasma-manager configFile format:

    KDE INI format:

    [Section]
    Key=Value
    
    [Section][Subsection]
    Key=Value
    

    Converts to Nix:

    configFile = {
      "<filename>"."Section"."Key" = <value>;
      "<filename>"."Section][Subsection"."Key" = <value>;
    };
    
  5. Handle value types:

    • true/false -> Nix booleans
    • Numbers -> Nix integers/floats
    • Everything else -> Nix strings
  6. Output the Nix configuration in a format ready to paste into programs.plasma.configFile:

    # Add to programs.plasma in your home-configuration.nix
    configFile = {
      # <filename> settings
      "<filename>"."Section"."Key" = value;
    };
    
  7. If a specific section was requested, filter output to only that section.

Common Config Files

File Contains
kwinrc Window manager (tiling, TabBox, effects, desktops)
kdeglobals Global KDE settings (theme, fonts, colors)
kglobalshortcutsrc Keyboard shortcuts
plasmarc Plasma shell settings
plasma-org.kde.plasma.desktop-appletsrc Panel and widget config
kscreenlockerrc Lock screen settings
kcminputrc Input device settings
ksmserverrc Session manager settings

Example Usage

/kde-extract kwinrc

Extracts all kwinrc settings as Nix config.

/kde-extract kwinrc TabBox

Extracts only the TabBox section from kwinrc.

/kde-extract all

Lists all KDE config files and prompts for selection.

Example Output

Input (~/.config/kwinrc):

[TabBox]
ApplicationsMode=1
HighlightWindows=false

[Windows]
FocusPolicy=FocusFollowsMouse

Output:

# Add to programs.plasma in your home-configuration.nix
configFile = {
  # kwinrc - Window Manager settings
  "kwinrc"."TabBox"."ApplicationsMode" = 1;
  "kwinrc"."TabBox"."HighlightWindows" = false;
  "kwinrc"."Windows"."FocusPolicy" = "FocusFollowsMouse";
};

Notes

  • Settings managed by plasma-manager's native options (like kwin.virtualDesktops) may conflict with configFile entries
  • Some settings require logout/login or kwin_wayland --replace to take effect
  • Use qdbus to query current runtime values if config file doesn't reflect actual state
Install via CLI
npx skills add https://github.com/iamruinous/nix-config --skill kde-extract
Repository Details
star Stars 8
call_split Forks 1
navigation Branch main
article Path SKILL.md
More from Creator