Move env variables to start-sway
This commit is contained in:
parent
e5038a23c5
commit
ccf9d50f29
2 changed files with 21 additions and 3 deletions
3
etc/profile.d/sway.sh → etc/sway/environment
Executable file → Normal file
3
etc/profile.d/sway.sh → etc/sway/environment
Executable file → Normal file
|
@ -1,6 +1,3 @@
|
|||
# Set XDG_CURRENT_DESKTOP to Sway (for screencasting and screensharing capabilities)
|
||||
export XDG_CURRENT_DESKTOP=sway
|
||||
|
||||
# TileOS specific config dir
|
||||
export XDG_CONFIG_DIRS=/etc/xdg/xdg-tileos:/etc/xdg
|
||||
|
|
@ -1,5 +1,10 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
## General exports
|
||||
export XDG_CURRENT_DESKTOP=sway
|
||||
export XDG_SESSION_DESKTOP=sway
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
|
||||
# Check if system is running in virtual machine
|
||||
case "$(systemd-detect-virt)" in
|
||||
qemu)
|
||||
|
@ -22,6 +27,22 @@ if [ -d /sys/module/nvidia ]; then
|
|||
export LIBVA_DRIVER_NAME=nvidia
|
||||
fi
|
||||
|
||||
## Load system environment customizations
|
||||
if [ -f /etc/sway/environment ]; then
|
||||
set -o allexport
|
||||
# shellcheck source=/dev/null
|
||||
. /etc/sway/environment
|
||||
set +o allexport
|
||||
fi
|
||||
|
||||
## Load user environment customizations
|
||||
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/sway/environment" ]; then
|
||||
set -o allexport
|
||||
# shellcheck source=/dev/null
|
||||
. "${XDG_CONFIG_HOME:-$HOME/.config}/sway/environment"
|
||||
set +o allexport
|
||||
fi
|
||||
|
||||
# Check if Nvidia driver installed, start Sway and send output to the journal
|
||||
if [ -d /sys/module/nvidia ]; then
|
||||
exec systemd-cat -- /usr/bin/sway --unsupported-gpu $@
|
||||
|
|
Loading…
Add table
Reference in a new issue