Skip to content

Commit 6698222

Browse files
feat(dfm): wire install.sh to the in-tree stoa-dfm fork (#68)
## Summary The vendor/fork scaffolding for DFM landed in #66/#67 but nothing actually consumed it: `install.sh` skipped DFM entirely, and `setup/post-install.sh` still `git clone`d `VictorGSchneider/DFM` into `~/.local/share/dfm-app` on every run, ignoring `scripts/stoa-dfm/`. This PR makes the installers finally use the in-tree fork. ## What changed - **`install.sh`** — installs DFM editable from `scripts/stoa-dfm/` via `pipx` (preferred, PEP 668 friendly) with a user-local venv fallback. "Editable" preserves the symlink-style semantics the rest of the repo relies on: `git pull` on StoaLinux propagates DFM changes to the running binary without re-running the installer, matching the behaviour called out in the README. - **`setup/post-install.sh`** — drops the `git clone https://github.com/VictorGSchneider/DFM.git` block. `install.sh` is already invoked from post-install, so DFM gets installed once, from the fork, via the same path as every other `stoa-*` script. Runtime deps in `$DFM_PKGS` (python / python-gobject / gtk4 / libadwaita) are unchanged. - **`scripts/stoa-doctor.sh`** — adds a `_check_bin dfm` entry so a missing binary shows up in the login doctor report instead of only surfacing when the user hits `Super+G`. - **`scripts/stoa-dfm/data/dfm.desktop`** — XDG entry for the fork, so rofi drun / app grids discover DFM. `install.sh` symlinks it into `~/.local/share/applications/`. - **`scripts/vendor/dfm/data/dfm.desktop`** — mirrors the fork so the vendored upstream snapshot stays aligned with the matching commit on `VictorGSchneider/DFM@claude/integrate-dfm-stoalinux-U50VJ` (the same `data/dfm.desktop` file is added there). Next `sync-upstream.sh dfm` after upstream merges will be a no-op for this path. ## Test plan - [ ] `bash -n install.sh setup/post-install.sh scripts/stoa-doctor.sh` (done locally, passes) - [ ] On a fresh Arch box with `pipx`: `./install.sh` — verify `dfm` resolves to `~/.local/bin/dfm`, launches GTK4 window, and the `.desktop` entry shows up in rofi drun. - [ ] On a box without `pipx` (venv fallback): `./install.sh` — verify `~/.local/share/dfm-venv/bin/dfm` is created and `~/.local/bin/dfm` is the symlink target. - [ ] Re-run `./install.sh` — should be idempotent (pipx `--force` upgrades, venv re-creates without error). - [ ] `stoa-doctor` with `dfm` uninstalled — verify the `[FAIL]` entry appears in `~/.config/stoa/doctor.log` and the dunst notification fires. - [ ] `Super+G` from Hyprland and i3 sessions. ## Paired change `VictorGSchneider/DFM` on the same branch name adds the matching upstream `data/dfm.desktop` so the fork/vendor pair tracks upstream without drift. https://claude.ai/code/session_01C9MCwSGnmdcwA55X394WfA
2 parents c91b147 + cedaf2d commit 6698222

5 files changed

Lines changed: 62 additions & 30 deletions

File tree

‎install.sh‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,37 @@ _link "${STOA_DIR}/scripts/stoa-predict.py" "${HOME}/.local/bin/stoa-predic
231231
# already set, so no chmod loop is needed here. If a source ever loses +x,
232232
# fix it in the repo rather than papering over it at install time.
233233

234+
# ── DFM — Dotfile Manager (installed from the in-tree Stoa fork) ──
235+
# The Stoa fork lives at scripts/stoa-dfm/ (see scripts/vendor/README.md).
236+
# Install it editable so a `git pull` on StoaLinux propagates changes to the
237+
# running binary, matching the symlink semantics used for every other stoa-*
238+
# script. pipx is preferred (PEP 668 friendly); fall back to a user-local
239+
# venv when pipx is unavailable.
240+
DFM_SRC="${STOA_DIR}/scripts/stoa-dfm"
241+
DFM_VENV="${HOME}/.local/share/dfm-venv"
242+
DFM_BIN="${HOME}/.local/bin/dfm"
243+
244+
if [ -d "$DFM_SRC" ] && [ -f "${DFM_SRC}/setup.py" ]; then
245+
if command -v pipx &>/dev/null; then
246+
pipx install --force --editable "$DFM_SRC" >/dev/null
247+
echo -e " ${O}[+] dfm (pipx, editable from scripts/stoa-dfm)${R}"
248+
elif command -v python3 &>/dev/null; then
249+
python3 -m venv "$DFM_VENV"
250+
"$DFM_VENV/bin/pip" install --upgrade pip >/dev/null
251+
"$DFM_VENV/bin/pip" install -e "$DFM_SRC" >/dev/null
252+
ln -sf "$DFM_VENV/bin/dfm" "$DFM_BIN"
253+
echo -e " ${O}[+] dfm (venv, editable from scripts/stoa-dfm)${R}"
254+
else
255+
echo -e " ${S}[!] python3 not found — skipping dfm install${R}"
256+
fi
257+
258+
# Desktop entry so rofi drun / app grids pick it up.
259+
if [ -f "${DFM_SRC}/data/dfm.desktop" ]; then
260+
_link "${DFM_SRC}/data/dfm.desktop" \
261+
"${HOME}/.local/share/applications/dfm.desktop"
262+
fi
263+
fi
264+
234265
# ── Pacman hooks (require sudo) ──
235266
echo ""
236267
echo -e "${F}Pacman hooks:${R}"

‎scripts/stoa-dfm/data/dfm.desktop‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=DFM
4+
GenericName=Dotfile Manager
5+
Comment=Edit dotfiles in place with smart widgets, backups, and GitHub sync
6+
Exec=dfm
7+
Icon=preferences-desktop
8+
Terminal=false
9+
Categories=Utility;Settings;GTK;
10+
StartupNotify=true
11+
StartupWMClass=com.github.dfm
12+
Keywords=dotfile;dotfiles;config;configuration;settings;editor;backup;

‎scripts/stoa-doctor.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ _check_optional alacritty "Terminal (alacritty)"
134134
_check_bin curl "HTTP client (curl)"
135135
_check_bin tesseract "OCR (tesseract)"
136136

137+
# ── Dotfile Manager (Super+G) ──
138+
_check_bin dfm "Dotfile Manager (dfm)"
139+
137140
# ══════════════════════════════════════════
138141
# Service checks
139142
# ══════════════════════════════════════════
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Desktop Entry]
2+
Type=Application
3+
Name=DFM
4+
GenericName=Dotfile Manager
5+
Comment=Edit dotfiles in place with smart widgets, backups, and GitHub sync
6+
Exec=dfm
7+
Icon=preferences-desktop
8+
Terminal=false
9+
Categories=Utility;Settings;GTK;
10+
StartupNotify=true
11+
StartupWMClass=com.github.dfm
12+
Keywords=dotfile;dotfiles;config;configuration;settings;editor;backup;

‎setup/post-install.sh‎

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -506,36 +506,10 @@ if [ "$INSTALL_PKGS" = "y" ]; then
506506
else
507507
echo -e " ${S}[~] ProtonVPN CLI already installed.${R}"
508508
fi
509-
# DFM — Dotfile Manager (GTK4 GUI) — "Know thyself." — Thales
510-
echo ""
511-
if ! command -v dfm &>/dev/null; then
512-
echo -e " ${F}Installing DFM — Dotfile Manager...${R}"
513-
DFM_DIR="${HOME}/.local/share/dfm-app"
514-
if [ -d "$DFM_DIR" ]; then
515-
git -C "$DFM_DIR" pull
516-
else
517-
git clone https://github.com/VictorGSchneider/DFM.git "$DFM_DIR"
518-
fi
519-
# Prefer pipx (PEP 668 friendly). Fall back to a user venv, then
520-
# last-resort --break-system-packages only if neither is available.
521-
if command -v pipx &>/dev/null; then
522-
pipx install --force "$DFM_DIR"
523-
elif command -v python3 &>/dev/null; then
524-
DFM_VENV="${HOME}/.local/share/dfm-venv"
525-
python3 -m venv "$DFM_VENV"
526-
"$DFM_VENV/bin/pip" install --upgrade pip >/dev/null
527-
"$DFM_VENV/bin/pip" install -e "$DFM_DIR"
528-
mkdir -p "${HOME}/.local/bin"
529-
ln -sf "$DFM_VENV/bin/dfm" "${HOME}/.local/bin/dfm"
530-
else
531-
pip install -e "$DFM_DIR" --break-system-packages 2>/dev/null || \
532-
pip install -e "$DFM_DIR"
533-
fi
534-
echo -e " ${O}[✓] DFM installed.${R}"
535-
echo -e " ${S} Launch: dfm or Super+G${R}"
536-
else
537-
echo -e " ${S}[~] DFM already installed.${R}"
538-
fi
509+
# DFM — Dotfile Manager is installed by install.sh from the in-tree
510+
# Stoa fork at scripts/stoa-dfm/ (see scripts/vendor/README.md). The
511+
# Python runtime deps are already in $DFM_PKGS above; no separate clone
512+
# is needed.
539513
else
540514
echo -e " ${S}[~] Packages skipped.${R}"
541515
fi

0 commit comments

Comments
 (0)