This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
pogmom-sway-base/sway-run
2024-06-03 15:37:29 -06: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 "$@"