Files
feresaria/packaging/ferese-session
T
Samuel Onoja ab6bf8b961 Refine notification center and configure native notifications
Keep notification actions and dismiss controls visible, compact and animate history, and add themed icon controls and grouping.

Include notification settings, session integration and documentation, on-demand workspaces, and performance baseline notes.
2026-09-27 08:35:38 +01:00

48 lines
1.4 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
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" --grant-effects
--grant-shell-control -- "$release_dir/ferese-shell")
if [[ -z ${DBUS_SESSION_BUS_ADDRESS:-} ]]; then
exec dbus-run-session -- "${command[@]}"
else
exec "${command[@]}"
fi