Skip to content

Add Linux folder picker support using zenity/kdialog#77

Open
RohithVangalla1 wants to merge 1 commit into
nowork-studio:mainfrom
RohithVangalla1:feat/linux-folder-picker-support
Open

Add Linux folder picker support using zenity/kdialog#77
RohithVangalla1 wants to merge 1 commit into
nowork-studio:mainfrom
RohithVangalla1:feat/linux-folder-picker-support

Conversation

@RohithVangalla1
Copy link
Copy Markdown

Summary

Implements the Linux folder picker that was marked as TODO, enabling the
Browse button to work on Linux desktops.

Implementation

  • zenity (GTK-based) as primary — most common on GNOME/Ubuntu/Fedora
  • kdialog (KDE/Plasma) as fallback — for KDE users
  • Returns clear error message if neither tool is available
  • Falls back gracefully: UI can show text input when kind: "error" is returned

Details

  • Uses ENOENT detection to distinguish "not installed" from real errors
  • Handles user cancellation (exit code 1) correctly for both tools
  • Respects the same DIALOG_TIMEOUT_MS (5 min) as the macOS implementation
  • Normalizes output (strips trailing slash) for consistency with macOS behavior
  • Extracted shared execDialog() helper to avoid duplication between zenity/kdialog paths

Addresses

TODO in pick-folder.ts:

"linux (zenity / kdialog)"

Type of change

  • New feature

Implements the Linux folder picker TODO by adding support for:
- zenity (GTK-based, common on GNOME/Ubuntu/Fedora) as primary
- kdialog (KDE/Plasma) as fallback

The implementation:
- Tries zenity first with --file-selection --directory flags
- Falls back to kdialog --getexistingdirectory if zenity is not found
- Returns a clear error message if neither tool is available
- Handles user cancellation (exit code 1) correctly for both tools
- Uses ENOENT detection to distinguish 'not installed' from real errors
- Respects the same DIALOG_TIMEOUT_MS as the macOS implementation
- Normalizes output (strips trailing slash) for consistency

Addresses the TODO:
  'linux (zenity / kdialog)'
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