diff --git a/README.md b/README.md index 09d6560..c8358cf 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ It runs these steps, in this order, and every one of them is idempotent: | 1. Directories | creates the 19 directories the shell and scripts expect, before anything writes into them | | 2. `BLOB_PATH` | symlinks `~/.local/share/blob` to this checkout | | 3. Packages | installs what is missing from `packages/`, bootstrapping `yay` first on a machine that has no AUR helper | -| 4. Config | copies `hypr/`, the themed app configs, `blob/shell.json`, the uwsm environment, and the icon font into `~/.config` | +| 4. Config | copies `hypr/`, the themed app configs, `blob/shell.json`, the uwsm environment, and the icon font into `~/.config`, and writes `/etc/profile.d/blob.sh` so a login shell finds the `blob` command | | 5. First theme | links `~/wallpapers` to the checkout, applies `flats` headless, picks a background, and links the btop and Neovim theme files, so the first login is not a blank desktop | | 6. User units | installs the session services into `~/.config/systemd/user` and enables them | | 7. systemd drop-ins | writes the shutdown timeouts, oomd thresholds, plocate prune paths, and sleep hooks under `/etc` | diff --git a/docs/install.md b/docs/install.md index 2986ab6..cdc595f 100644 --- a/docs/install.md +++ b/docs/install.md @@ -13,7 +13,7 @@ with `--check`. | `install/helpers/as-root.sh` | `as_root`, a no-op when already root | | `install/steps/directories.sh` | the directories the shell and scripts expect | | `install/steps/packages.sh` | repo and AUR packages, and the yay bootstrap | -| `install/steps/config.sh` | the `BLOB_PATH` symlink and everything under `~/.config` | +| `install/steps/config.sh` | the `BLOB_PATH` symlink, everything under `~/.config`, and the login shell profile | | `install/steps/services.sh` | system services, systemd drop-ins, user units | | `install/steps/theme.sh` | the wallpaper link, the first theme, the first background | | `install/steps/login.sh` | SDDM, the session entry, and the first launch | @@ -33,6 +33,13 @@ with `--check`. built once with `makepkg`. See [packages.md](packages.md). 4. **Config** is copied into `~/.config`: `hypr/`, the themed app configs, `blob/shell.json`, the uwsm environment, and the icon font. + `session/profile.sh` also goes to `/etc/profile.d/blob.sh`, which sources + `session/env-bootstrap` and is what puts `blob` on `PATH` in a login shell. + Without it `BLOB_PATH` and `$BLOB_PATH/bin` are only set by + `~/.config/uwsm/env.d/10-blob`, which uwsm reads when the graphical session + starts, so `blob` is not found from a TTY. A shell that was already open when + the installer ran keeps its old `PATH`; open a new one, or + `source ~/.local/share/blob/session/env-bootstrap`. 5. **The first theme** is applied. `~/wallpapers` is symlinked to the checkout's `wallpapers/`, `flats` is applied with `BLOB_THEME_HEADLESS=1` (no shell or session bus exists yet), and the background symlink is pointed at the first @@ -42,7 +49,10 @@ with `--check`. `~/.config/btop/themes/current.theme` (btop's `color_theme = "current"`) and, only when `~/.config/nvim/lua/plugins` already exists, `theme.lua` there. Every step is skipped when a theme, a background, a wallpaper directory or a - theme file of your own is already in place. + theme file of your own is already in place. A theme counts as in place only + when the staged theme under `~/.local/state/blob/current/theme` is there too, + so a recorded theme name left without its palette is applied again rather + than skipped. 6. **User units** land in `~/.config/systemd/user` and are enabled, not started: they are all `WantedBy=graphical-session.target`, so they come up with the session. `blob-speaker-tuning.service` is left out, because diff --git a/install.sh b/install.sh index 4ecc985..a2b5e6f 100755 --- a/install.sh +++ b/install.sh @@ -63,6 +63,7 @@ link_blob_path install_packages install_shipped_config +install_shell_profile install_user_units install_systemd_dropins install_zen_config @@ -88,7 +89,14 @@ if [[ $check == true ]]; then (( changes == 0 )) || exit 1 else say "$changes item(s) changed." - say "Change the theme with 'blob theme set ' once the session is up." + + active_theme="$(cat "$current_state_dir/theme.name" 2>/dev/null || true)" + if [[ -n $active_theme ]]; then + say "Theme: $active_theme. Change it with 'blob theme set '." + fi + + say "New shells find the blob command through /etc/profile.d/blob.sh." + say "For this shell: source $blob_path/session/env-bootstrap" say "" launch_desktop fi diff --git a/install/steps/config.sh b/install/steps/config.sh index 4fdfbf4..23aefcd 100644 --- a/install/steps/config.sh +++ b/install/steps/config.sh @@ -63,6 +63,10 @@ install_shipped_config() { install_file "$repo_dir/fonts/omarchy.ttf" "$font_dir/omarchy.ttf" "fonts/omarchy.ttf" } +install_shell_profile() { + install_root_file "$repo_dir/session/profile.sh" /etc/profile.d/blob.sh "profile.d/blob.sh" +} + install_zen_config() { local profile profile="$(find "$config_dir/zen" -maxdepth 1 -type d -name '*.Default (release)*' 2>/dev/null | head -1)" diff --git a/install/steps/theme.sh b/install/steps/theme.sh index 24c2f8d..40e1baf 100644 --- a/install/steps/theme.sh +++ b/install/steps/theme.sh @@ -37,8 +37,11 @@ link_wallpapers() { # like a failed session. Applied headless: no shell and no session bus exist # while the installer runs. install_default_theme() { - if [[ -s $current_state_dir/theme.name ]]; then - say "ok theme ($(cat "$current_state_dir/theme.name"))" + local current_name="" + [[ -s $current_state_dir/theme.name ]] && current_name="$(cat "$current_state_dir/theme.name")" + + if [[ -n $current_name && -f $current_state_dir/theme/colors.toml ]]; then + say "ok theme ($current_name)" return 0 fi @@ -53,6 +56,7 @@ install_default_theme() { say "theme $default_theme" else say "WARN could not apply the $default_theme theme" + say " the session will come up without a palette; run 'blob theme set $default_theme'" fi } diff --git a/session/profile.sh b/session/profile.sh new file mode 100644 index 0000000..0d910e0 --- /dev/null +++ b/session/profile.sh @@ -0,0 +1,6 @@ +# Put the blob command on PATH for login shells. The graphical session gets the +# same environment from ~/.config/uwsm/env.d/10-blob. + +if [ -r "$HOME/.local/share/blob/session/env-bootstrap" ]; then + . "$HOME/.local/share/blob/session/env-bootstrap" +fi diff --git a/uninstall.sh b/uninstall.sh index 0098ca6..7862399 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -7,6 +7,7 @@ config_dir="$HOME/.config" session_entry="/usr/local/share/wayland-sessions/blob.desktop" root_files=( + /etc/profile.d/blob.sh /etc/sddm.conf.d/zz-blob.conf /etc/sddm.conf.d/zzz-blob-autologin.conf /etc/sddm/hyprland-greeter.conf