Skip to content

fix(dfm): handle non-directory entries in ~/.config scan#95

Merged
VictorGSchneider merged 1 commit into
mainfrom
claude/dfm-installation-guide-Owb4c
May 16, 2026
Merged

fix(dfm): handle non-directory entries in ~/.config scan#95
VictorGSchneider merged 1 commit into
mainfrom
claude/dfm-installation-guide-Owb4c

Conversation

@VictorGSchneider
Copy link
Copy Markdown
Owner

scan_dotfiles called _find_config_file before verifying the path was a directory, so a regular file at ~/.config/ (e.g. mimeapps.list) caused os.listdir to raise NotADirectoryError and crash window init.

Reorder the check so _find_config_file only runs on directories, and harden _find_config_file itself against NotADirectoryError / FileNotFoundError as defense in depth.

scan_dotfiles called _find_config_file before verifying the path was a
directory, so a regular file at ~/.config/<name> (e.g. mimeapps.list)
caused os.listdir to raise NotADirectoryError and crash window init.

Reorder the check so _find_config_file only runs on directories, and
harden _find_config_file itself against NotADirectoryError /
FileNotFoundError as defense in depth.
@VictorGSchneider VictorGSchneider merged commit cdffce8 into main May 16, 2026
1 check passed
@VictorGSchneider VictorGSchneider deleted the claude/dfm-installation-guide-Owb4c branch May 16, 2026 00:39
VictorGSchneider added a commit that referenced this pull request May 16, 2026
Follow-up to #95. Two more warnings observed when launching `dfm`:

```
Adwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead.
Gtk-WARNING: Failed to set text 'Notes & Tags' from markup due to error parsing markup: Entity did not end with a semicolon...
Gtk-WARNING: Failed to set text 'Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)' from markup due to error parsing markup...
```

## Commits

### `fix(dfm): escape Pango markup in row titles from config comments`

`Adw.PreferencesRow` titles and subtitles are parsed as Pango markup, so
config keys/comments containing `&` or `<` (e.g. the oh-my-zsh `.zshrc`
comment "Caution: ... in zsh < 5.7.1") triggered repeated `Failed to set
text from markup` Gtk warnings on every row redraw.

- Run `field.key` and `field.comment` through `GLib.markup_escape_text`
before passing them to `Adw.SwitchRow` / `Adw.ActionRow` in
`window_config_page_fields.py`. Single escape point in
`create_field_row` covers every field type (toggle, slider, color,
number, path, keybind, font, text).
- Fix the literal `'Notes & Tags'` group title to `'Notes &amp; Tags'`
in `window_config_page_sections.py`.

### `fix(theme): drop deprecated prefer-dark-theme from gtk-4.0
settings`

libadwaita ignores `gtk-application-prefer-dark-theme` and prints
`Adwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme
with libadwaita is unsupported` on every GTK4 app launch.

Dark mode for GTK4 / libadwaita is already driven by the gsettings key
`org.gnome.desktop.interface color-scheme = 'prefer-dark'`, which
`theme/pacman-hooks/stoa-theme-enforce` sets (line 44). So removing the
deprecated line is a no-op for visual behaviour and silences the
warning.

Kept in `theme/gtk-3.0/settings.ini` — the key is still valid for GTK3.

## Test plan

- [x] `python3 -m py_compile` on the touched DFM modules.
- [x] Inspected the diff against current `main` (post-#95 merge).
- [ ] Manual: launch `dfm` after `git pull` — the three warnings above
should be gone. (Run `sudo /usr/local/bin/stoa-theme-enforce` once if
`gsettings get org.gnome.desktop.interface color-scheme` doesn't already
return `'prefer-dark'`.)


---
_Generated by [Claude
Code](https://claude.ai/code/session_01E7fz8T8EWW7toDHo3UmAwG)_
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.

2 participants