mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-08-14 00:47:51 +00:00
cachyos build
This commit is contained in:
@@ -88,6 +88,21 @@ export PATH="$HOME/.cargo/bin:$PATH"
|
|||||||
# Add to ~/.bashrc or ~/.zshrc to persist
|
# Add to ~/.bashrc or ~/.zshrc to persist
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Black screen on login after install (Arch / CachyOS / fish users)
|
||||||
|
|
||||||
|
**Cause**: Older OpenFang installers (`<v0.6.4`) appended a PATH line directly to `~/.config/fish/config.fish`. On Arch derivatives like CachyOS, the desktop session can source fish on login — a malformed or invalid PATH line then prevents the session from finishing, leaving you on a black screen.
|
||||||
|
|
||||||
|
**Fix**: Boot to a TTY (`Ctrl+Alt+F2`) and remove any OpenFang PATH lines from `config.fish`:
|
||||||
|
```bash
|
||||||
|
sed -i '/openfang/d' ~/.config/fish/config.fish
|
||||||
|
```
|
||||||
|
Then re-run the installer — current versions write to `~/.config/fish/conf.d/openfang.fish` (a drop-in directory) instead, and guard the path with `test -d` so a missing install dir can never wedge fish startup.
|
||||||
|
|
||||||
|
To remove OpenFang's PATH entry cleanly:
|
||||||
|
```bash
|
||||||
|
rm ~/.config/fish/conf.d/openfang.fish
|
||||||
|
```
|
||||||
|
|
||||||
### Docker container won't start
|
### Docker container won't start
|
||||||
|
|
||||||
**Common causes**:
|
**Common causes**:
|
||||||
|
|||||||
+58
-28
@@ -149,39 +149,69 @@ install() {
|
|||||||
USER_SHELL=$(grep "^$(id -un):" /etc/passwd 2>/dev/null | cut -d: -f7)
|
USER_SHELL=$(grep "^$(id -un):" /etc/passwd 2>/dev/null | cut -d: -f7)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHELL_RC=""
|
# Fish shell: write to ~/.config/fish/conf.d/openfang.fish (drop-in dir).
|
||||||
|
# This keeps the user's config.fish completely untouched, so a broken
|
||||||
|
# PATH entry can never wedge the user's main shell config — critical
|
||||||
|
# on Arch/CachyOS where the desktop session sources fish on login.
|
||||||
|
USE_FISH_DROPIN=0
|
||||||
case "$USER_SHELL" in
|
case "$USER_SHELL" in
|
||||||
*/zsh) SHELL_RC="$HOME/.zshrc" ;;
|
*/fish) USE_FISH_DROPIN=1 ;;
|
||||||
*/bash) SHELL_RC="$HOME/.bashrc" ;;
|
|
||||||
*/fish) SHELL_RC="$HOME/.config/fish/config.fish" ;;
|
|
||||||
esac
|
esac
|
||||||
# Also check for config files if shell detection failed.
|
# If $USER_SHELL didn't match fish but config.fish exists AND no other
|
||||||
# Check bash/zsh first (more common defaults), fish last — avoids
|
# rc files exist, the user is likely a fish user — use the drop-in too.
|
||||||
# writing to config.fish for users who merely have Fish installed.
|
if [ "$USE_FISH_DROPIN" -eq 0 ] \
|
||||||
if [ -z "$SHELL_RC" ]; then
|
&& [ -f "$HOME/.config/fish/config.fish" ] \
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
&& [ ! -f "$HOME/.bashrc" ] \
|
||||||
SHELL_RC="$HOME/.bashrc"
|
&& [ ! -f "$HOME/.zshrc" ]; then
|
||||||
elif [ -f "$HOME/.zshrc" ]; then
|
USE_FISH_DROPIN=1
|
||||||
SHELL_RC="$HOME/.zshrc"
|
|
||||||
elif [ -f "$HOME/.config/fish/config.fish" ]; then
|
|
||||||
SHELL_RC="$HOME/.config/fish/config.fish"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$SHELL_RC" ] && ! grep -q "openfang" "$SHELL_RC" 2>/dev/null; then
|
if [ "$USE_FISH_DROPIN" -eq 1 ]; then
|
||||||
# Determine syntax from the TARGET FILE, not $USER_SHELL — this
|
FISH_CONF_DIR="$HOME/.config/fish/conf.d"
|
||||||
# prevents Bash syntax from ever being written to config.fish even
|
FISH_DROPIN="$FISH_CONF_DIR/openfang.fish"
|
||||||
# when shell detection mis-identifies the user's shell.
|
mkdir -p "$FISH_CONF_DIR"
|
||||||
case "$SHELL_RC" in
|
if [ ! -f "$FISH_DROPIN" ]; then
|
||||||
*/config.fish)
|
# Guarded with `test -d` so a missing/broken install dir never
|
||||||
mkdir -p "$(dirname "$SHELL_RC")"
|
# breaks fish startup (which would black-screen Arch/CachyOS
|
||||||
echo "fish_add_path \"$INSTALL_DIR\"" >> "$SHELL_RC"
|
# desktop sessions that source fish at login).
|
||||||
;;
|
cat > "$FISH_DROPIN" <<EOF
|
||||||
*)
|
# OpenFang PATH — auto-generated by installer
|
||||||
echo "export PATH=\"$INSTALL_DIR:\$PATH\"" >> "$SHELL_RC"
|
if test -d "$INSTALL_DIR"
|
||||||
;;
|
fish_add_path -g "$INSTALL_DIR"
|
||||||
|
end
|
||||||
|
EOF
|
||||||
|
echo " Added $INSTALL_DIR to PATH via $FISH_DROPIN"
|
||||||
|
fi
|
||||||
|
# Best-effort: clean up legacy bash-syntax export from config.fish
|
||||||
|
# written by older OpenFang installers (<v0.5.0). Harmless if absent.
|
||||||
|
OLD_FISH_RC="$HOME/.config/fish/config.fish"
|
||||||
|
if [ -f "$OLD_FISH_RC" ] && grep -q "openfang/bin" "$OLD_FISH_RC" 2>/dev/null; then
|
||||||
|
# Remove any line containing .openfang/bin (covers both bash
|
||||||
|
# `export PATH=` syntax and old fish `set -gx PATH` lines).
|
||||||
|
TMPFILE=$(mktemp)
|
||||||
|
grep -v "openfang/bin" "$OLD_FISH_RC" > "$TMPFILE" || true
|
||||||
|
mv "$TMPFILE" "$OLD_FISH_RC"
|
||||||
|
echo " Cleaned legacy openfang PATH entry from $OLD_FISH_RC"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
SHELL_RC=""
|
||||||
|
case "$USER_SHELL" in
|
||||||
|
*/zsh) SHELL_RC="$HOME/.zshrc" ;;
|
||||||
|
*/bash) SHELL_RC="$HOME/.bashrc" ;;
|
||||||
esac
|
esac
|
||||||
echo " Added $INSTALL_DIR to PATH in $SHELL_RC"
|
# Fall back to existing rc files when shell detection failed.
|
||||||
|
if [ -z "$SHELL_RC" ]; then
|
||||||
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
|
SHELL_RC="$HOME/.bashrc"
|
||||||
|
elif [ -f "$HOME/.zshrc" ]; then
|
||||||
|
SHELL_RC="$HOME/.zshrc"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$SHELL_RC" ] && ! grep -q "openfang" "$SHELL_RC" 2>/dev/null; then
|
||||||
|
echo "export PATH=\"$INSTALL_DIR:\$PATH\"" >> "$SHELL_RC"
|
||||||
|
echo " Added $INSTALL_DIR to PATH in $SHELL_RC"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify installation
|
# Verify installation
|
||||||
|
|||||||
Reference in New Issue
Block a user