You could use System.getProperty("os.name") to detect the os and use ~/.IntelliJIdeaXX/system on linux and ~\.IntelliJIdeaXX\system, where XX is the idea.paths.selector property.