Skip to content

Commit 3d3f70b

Browse files
committed
discord: install natively in $HOME instead of the flatpak
The com.discordapp.Discord flatpak's zypak sandbox breaks the Wayland splash->main-window handoff under niri: the web app loads but the main window never maps (stuck "Discord Updater / Starting" splash; the renderer also segfaulted on a corrupt GPU/shader cache). Remove it from the recipe and drop its seeded flatpak override + tmpfiles line, and have kb3lyb-bootstrap install the official tarball into ~/.local/share/Discord (self-updating, runs directly on host Wayland/GPU). Verified on the machine: main window maps, zero crashes. Also remove TODO-var-mnt-data.md — /var/mnt/data is set up and confirmed auto-unlocking after reboot.
1 parent bd62403 commit 3d3f70b

6 files changed

Lines changed: 57 additions & 92 deletions

File tree

SETUP.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ bluetooth audio, and suspend/resume. Only then wipe the internal drive (§9.10).
123123
## 6. First-boot / post-install
124124

125125
- [ ] `kb3lyb-bootstrap` — clones dotfiles (prompts for a token), stows them, installs
126-
brew + Brewfile, SDKMAN, JetBrains Toolbox into `$HOME` (§6).
126+
brew + Brewfile, SDKMAN, JetBrains Toolbox, and native Discord into `$HOME` (§6).
127127
- [ ] `fprintd-enroll` — re-enroll fingerprints (not portable, §10).
128128
- [ ] **Make the login keyring passwordless** (needed once fingerprint login is set
129129
up). `pam_fprintd` is `sufficient` and first in `system-auth`, so a fingerprint
@@ -230,6 +230,13 @@ Done since the first cut (kept for history):
230230
one is confirmed working (it staged an image update in normal use).
231231
- **Electron Wayland overrides (§4):** confirmed on the real install — Slack renders
232232
sharp and dark.
233+
- **Discord — native, not flatpak:** the `com.discordapp.Discord` flatpak's zypak
234+
sandbox breaks the Wayland splash→main-window handoff under niri (web app loads, main
235+
window never maps; stuck "Discord Updater / Starting" splash — the renderer also
236+
segfaulted on a corrupt GPU/shader cache). Removed from the recipe + its flatpak
237+
override; `kb3lyb-bootstrap` now installs the official tarball into `$HOME`
238+
(`~/.local/share/Discord`, self-updating, launches on host Wayland/GPU). Verified: main
239+
window maps, zero crashes.
233240
- **Mail:** Evolution + evolution-ews baked (M365/Graph + personal; mako notifications).
234241
- **Portal FileChooser fix (open/save dialogs):** the stock niri portal config
235242
(`/usr/share/xdg-desktop-portal/niri-portals.conf`) has `default=gnome;gtk`, routing

TODO-var-mnt-data.md

Lines changed: 0 additions & 80 deletions
This file was deleted.

files/system/usr/bin/kb3lyb-bootstrap

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,48 @@ if [[ ! -x "$TBX_HOME/bin/jetbrains-toolbox" ]]; then
100100
rm -rf "$tmp"
101101
fi
102102

103+
# Discord (native, in $HOME — deliberately NOT the flatpak). The flatpak's zypak
104+
# sandbox breaks the Wayland splash->main-window handoff under niri: the client
105+
# downloads and loads the web app but the main window never maps (you get a stuck
106+
# "Discord Updater / Starting" splash). The official tarball is a tiny bootstrap;
107+
# on first GUI launch its updater_bootstrap fetches the real client into
108+
# ~/.config/discord and execs it directly on host Wayland/GPU, self-updating after.
109+
DISCORD_DIR="$HOME/.local/share/Discord"
110+
if [[ ! -x "$DISCORD_DIR/discord" ]]; then
111+
say "installing Discord (native tarball, in \$HOME)"
112+
tmp="$(mktemp -d)"
113+
if curl -fsSL "https://discord.com/api/download?platform=linux&format=tar.gz" -o "$tmp/discord.tar.gz"; then
114+
mkdir -p "$HOME/.local/share"
115+
tar -xzf "$tmp/discord.tar.gz" -C "$HOME/.local/share" # tarball top dir is "Discord"
116+
if [[ -x "$DISCORD_DIR/discord" ]]; then
117+
mkdir -p "$HOME/.local/bin" "$HOME/.local/share/applications" \
118+
"$HOME/.local/share/icons/hicolor/256x256/apps"
119+
ln -sf "$DISCORD_DIR/discord" "$HOME/.local/bin/discord"
120+
cp -f "$DISCORD_DIR/discord.png" "$HOME/.local/share/icons/hicolor/256x256/apps/discord.png"
121+
cat > "$HOME/.local/share/applications/discord.desktop" <<EOF
122+
[Desktop Entry]
123+
Name=Discord
124+
GenericName=Internet Messenger
125+
Comment=All-in-one voice and text chat
126+
Exec=$DISCORD_DIR/discord --url -- %u
127+
Icon=discord
128+
Type=Application
129+
Categories=Network;InstantMessaging;
130+
MimeType=x-scheme-handler/discord;
131+
StartupWMClass=discord
132+
Terminal=false
133+
EOF
134+
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
135+
say "Discord installed; launch from fuzzel (Super+D -> Discord) — first run downloads the client."
136+
else
137+
warn "Discord launcher not found after extract"
138+
fi
139+
else
140+
warn "Discord download failed"
141+
fi
142+
rm -rf "$tmp"
143+
fi
144+
103145
# --- 4. login shell ------------------------------------------------------------
104146
# The dotfiles target zsh (.zshrc). Make it the login shell so a fresh user lands
105147
# in zsh — and thus brew + plugins — without a manual chsh. `sudo chsh` lets root

files/system/usr/lib/tmpfiles.d/kb3lyb-flatpak-overrides.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
# leaving any later `flatpak override` edits by the user untouched.
66
d /var/lib/flatpak/overrides 0755 root root - -
77
C /var/lib/flatpak/overrides/com.slack.Slack 0644 root root - -
8-
C /var/lib/flatpak/overrides/com.discordapp.Discord 0644 root root - -
98
C /var/lib/flatpak/overrides/com.bitwarden.desktop 0644 root root - -

files/system/usr/share/factory/var/lib/flatpak/overrides/com.discordapp.Discord

Lines changed: 0 additions & 5 deletions
This file was deleted.

recipes/recipe.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,13 @@ modules:
151151
- evolution-ews
152152

153153
# GUI apps as flatpaks (DESIGN §8.5: prefer $HOME/flatpak over layering/overrides).
154-
# Electron apps (slack/discord/bitwarden) are forced onto native Wayland for
155-
# sharp HiDPI via seeded flatpak overrides — see files/.../factory + the
156-
# tmpfiles.d C rules (DESIGN §4). Bazaar is the app store (no GNOME Software on
157-
# this minimal image); flatpak ID verified as io.github.kolunmi.Bazaar on Flathub.
154+
# Electron apps (slack/bitwarden) are forced onto native Wayland for sharp HiDPI
155+
# via seeded flatpak overrides — see files/.../factory + the tmpfiles.d C rules
156+
# (DESIGN §4). Discord is NOT a flatpak: its zypak sandbox breaks the Wayland
157+
# splash->main-window handoff under niri (the client loads but never maps a
158+
# window), so it's installed natively into $HOME by kb3lyb-bootstrap instead.
159+
# Bazaar is the app store (no GNOME Software on this minimal image); flatpak ID
160+
# verified as io.github.kolunmi.Bazaar on Flathub.
158161
- type: default-flatpaks
159162
configurations:
160163
- notify: true
@@ -165,7 +168,6 @@ modules:
165168
- com.bitwarden.desktop
166169
- com.nextcloud.desktopclient.nextcloud
167170
- com.slack.Slack
168-
- com.discordapp.Discord
169171
- org.libreoffice.LibreOffice
170172
- com.valvesoftware.Steam
171173
- io.github.kolunmi.Bazaar # app store (Flathub)

0 commit comments

Comments
 (0)