-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsway-session
executable file
·37 lines (29 loc) · 1.02 KB
/
sway-session
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
exec </dev/null >"$HOME/.local/state/sway.log" 2>&1
# init GUI envs so that they are inherited by sway and apps directly started
# by sway (terminal, browser, and autostart)
init_gui_envs() {
export XDG_CURRENT_DESKTOP="sway"
export GDK_BACKEND="wayland,x11"
export QT_QPA_PLATFORM="wayland;xcb"
export SDL_VIDEODRIVER="wayland,x11"
# https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
export GTK_IM_MODULE="fcitx"
export QT_IM_MODULE="fcitx"
export XMODIFIERS="@im=fcitx"
}
# init SSH_AUTO_SOCK explicitly for sway, but start ssh-agent later in
# autostart because ssh-agent might depend on sway to display prompts
#
# It would be better to init WAYLAND_DISPLAY explicitly for ssh-agent and
# to start it right away, but sway does not support explicit WAYLAND_DISPLAY.
init_ssh_envs() {
# kill pre-existing ssh-agent that was started before sway
if [ -n "$SSH_AGENT_PID" ]; then
eval $(ssh-agent -k)
fi
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/sway-ssh-agent.socket"
}
init_gui_envs
init_ssh_envs
exec sway