pogmom-desktop/sway-run
Penelope Gwen 2f483e73bb 0.4
2024-12-10 13:01:40 -08:00

29 lines
695 B
Bash
Executable file

#!/bin/sh
# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway
# D-Bus
# If the session bus is not available it is spawned and wrapper round our program
# Otherwise we spawn our program directly
drs=
if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]
then
drs=dbus-run-session
fi
# Environment
# Source environmental variable from all files in PATH_ENVIRONMENT
# file should be named *.conf and have KEY=value format use # for comment
PATH_ENVIRONMENT=$HOME/.config/environment.d
if [ -d "$PATH_ENVIRONMENT" ]; then
for i in "$PATH_ENVIRONMENT"/*.conf ; do
if [ -f "$i" ]; then
set -a; . "$i"; set +a
fi
done
fi
exec ${drs} sway "$@"