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)'
TheophilusChinomona added a commit to TheophilusChinomona/NotFair that referenced this pull request Jun 29, 2026
…er picker, --no-open precedence

Apply fixes from open upstream PRs that apply cleanly to our fork:

- AbortSignal (nowork-studio#80, ErnestHysa): wire signal? parameter through pickFolder
  and pickFolderMac to execFile, enabling clean cancellation of osascript.
  Also extend to the new Linux execDialog helper.

- Linux folder picker (nowork-studio#77, RohithVangalla1): implement pickFolderLinux using
  zenity (GTK) with kdialog (KDE) fallback, replacing the TODO stub.
  Linux users can now use the Browse button in the NotFair UI.

- --no-open precedence (nowork-studio#92, Osamaali313): extract the auto-open guard in
  bin/notfair-content-calendar into a _should_auto_open helper that checks
  --no-open before platform. Fixes macOS/Windows ignoring the flag.

Co-authored-by: Claude
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