Files
feresaria/packaging/ferese-session
aria 993bc0f88f Integrate native Rime and stabilize input, output, and rendering
- Add optional modifier-only Super binding whose tap is cancelled by
  other input, focus changes, grabs, locks, and session teardown.
- Ship the native ferese-rime user service, Rime defaults, installer
  inventory, package dependencies, session environment, and docs.
- Vendor Smithay 8a27023 with the SHM texture-cache format fix and add
  GPU regressions for format changes and resize snapshots.
- Release reused CRTC owners before staging output modes, then restore
  changed outputs before former owners when a transaction fails.
- Wait for resize-capture GPU completion, expand filtered surface
  damage, and preserve IME popup origin under fractional scaling.
- Mark weekends like holidays in both calendar layouts.
2026-10-30 03:13:43 +09:00

63 lines
2.2 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
umask 077
backend=drm
if [[ ${1:-} == --nested ]]; then
backend=nested
shift
fi
if (($#)); then
echo 'usage: ferese-session [--nested]' >&2
exit 2
fi
: "${XDG_RUNTIME_DIR:?A login session with XDG_RUNTIME_DIR is required}"
# Resolve once, so upgrading current cannot mix compositor and shell versions.
release_dir=$(dirname -- "$(readlink -f -- "$0")")
state_dir=${XDG_STATE_HOME:-$HOME/.local/state}/ferese
mkdir -p -- "$state_dir"
log_file=$state_dir/session-$(date -u +%Y%m%dT%H%M%SZ)-$$.log
echo "Ferese session log: $log_file" >&2
exec >>"$log_file" 2>&1
export XDG_CURRENT_DESKTOP=Ferese
export XDG_SESSION_DESKTOP=ferese
export XDG_SESSION_TYPE=wayland
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland
# Used by the area screenshot shortcut; explicitly set 0 to disable capture.
export FERESE_ENABLE_SCREENCOPY=${FERESE_ENABLE_SCREENCOPY:-1}
export PATH="$release_dir:$PATH"
unset WAYLAND_SOCKET
if [[ $backend == drm ]]; then
unset DISPLAY WAYLAND_DISPLAY
export FERESE_SESSION_IMPORT_ENV=1
# This fork owns its native input-method service. Keep GNOME's IBus settings
# outside this session, including apps launched later through activation.
export FERESE_ENABLE_INPUT_METHOD=${FERESE_ENABLE_INPUT_METHOD:-1}
if [[ $FERESE_ENABLE_INPUT_METHOD == 1 ]]; then
# GTK selects its IM module from the actual GDK backend. Forcing its
# Wayland module crashes GTK3 consumers that initialize an X11 display.
unset GTK_IM_MODULE
export QT_IM_MODULE=wayland QT_IM_MODULES=wayland
export IBUS_ADDRESS=
unset SDL_IM_MODULE
export FERESE_RIME_CONTROL=${FERESE_RIME_CONTROL:-$XDG_RUNTIME_DIR/ferese/rime-control.sock}
fi
else
export FERESE_SESSION_IMPORT_ENV=0
fi
if [[ $backend == drm ]] && command -v systemctl >/dev/null; then
systemctl --user stop swaync.service 2>/dev/null || true
fi
command=("$release_dir/ferese" --backend "$backend" --supervise-client --grant-effects
--grant-shell-control -- "$release_dir/ferese-session-shell")
if [[ -z ${DBUS_SESSION_BUS_ADDRESS:-} ]]; then
exec dbus-run-session -- "${command[@]}"
else
exec "${command[@]}"
fi