Skip to content

Commit

Permalink
Use XDG Config Home on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Vodes committed Feb 7, 2024
1 parent 4f6c1c2 commit 4775235
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/kotlin/moe/styx/logic/data/DataManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ object DataManager {
dir.mkdirs()
dir
} else {
val configDir = File(System.getProperty("user.dir"), ".config")
var configDir = File(System.getProperty("user.home"), ".config")
val xdgDirEnv = System.getenv("XDG_CONFIG_HOME")
if (!xdgDirEnv.isNullOrBlank() && File(xdgDirEnv).exists())
configDir = File(xdgDirEnv)
val styxDir = File(configDir, "Styx")
val dir = File(styxDir, "App")
dir.mkdirs()
Expand Down

0 comments on commit 4775235

Please sign in to comment.