Skip to content

Fix desktop file path on Linux (#95)#101

Open
mrrpmeowfurry wants to merge 2 commits into
Pryzmm:masterfrom
mrrpmeowfurry:master
Open

Fix desktop file path on Linux (#95)#101
mrrpmeowfurry wants to merge 2 commits into
Pryzmm:masterfrom
mrrpmeowfurry:master

Conversation

@mrrpmeowfurry

@mrrpmeowfurry mrrpmeowfurry commented Jun 11, 2026

Copy link
Copy Markdown

This pull request fixes an issue mentioned in #95 where files created by SplitSelf were written to user's home directory instead of the Desktop on Linux systems.

Problem

FileSystemView.getFileSystemView().getHomeDirectory() does not resolve to the Desktop folder in Linux.

This result in begin.txt being created at ~/ instead of ~/Desktop

Reference: https://stackoverflow.com/questions/570401/in-java-under-windows-how-do-i-find-a-redirected-desktop-folder#comment10308923_570536

Solution

Added a simple helper method to resolve the Desktop directory. On Windows it keeps the current behavior. and on Linux/macOS it points to ~/Desktop

Changes

  • Added getDesktopDirectory() helper method
  • Fix file creation path in createFileOnDesktop
  • Fix file copy destination path in cloneFileToDesktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant