2019-04-04 22:36:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
import-gsettings() {
|
|
|
|
# usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...
|
|
|
|
expression=""
|
|
|
|
for pair in "$@"; do
|
|
|
|
IFS=:; set -- $pair
|
|
|
|
expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \1:e'"
|
|
|
|
done
|
|
|
|
IFS=
|
|
|
|
eval sed -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini >/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
export XDG_SESSION_TYPE=wayland
|
|
|
|
|
2019-04-13 18:28:44 +00:00
|
|
|
# Qt
|
2019-07-17 04:09:35 +00:00
|
|
|
export DESKTOP_SESSION=gnome
|
|
|
|
export QT_STYLE_OVERRIDE=gtk
|
|
|
|
export QT_QPA_PLATFORMTHEME=gtk2
|
|
|
|
export QT_AUTO_SCREEN_SCALE_FACTOR=0
|
2019-04-13 18:28:44 +00:00
|
|
|
export QT_QPA_PLATFORM=wayland
|
|
|
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
|
|
|
|
2019-04-04 22:36:19 +00:00
|
|
|
# GTK
|
|
|
|
export CLUTTER_BACKEND=wayland
|
|
|
|
export GTK_CSD=0
|
|
|
|
if [[ -f /usr/lib/libgtk3-nocsd.so.0 ]]; then
|
|
|
|
export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0
|
|
|
|
fi
|
|
|
|
import-gsettings \
|
|
|
|
gtk-theme:gtk-theme-name \
|
|
|
|
icon-theme:gtk-icon-theme-name \
|
|
|
|
cursor-theme:gtk-cursor-theme-name
|
|
|
|
|
|
|
|
# Elementary/EFL
|
|
|
|
export ECORE_EVAS_ENGINE=wayland_egl
|
|
|
|
export ELM_ENGINE=wayland_egl
|
|
|
|
|
|
|
|
# SDL
|
|
|
|
export SDL_VIDEODRIVER=wayland
|
|
|
|
|
2019-04-05 00:07:01 +00:00
|
|
|
# Java
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
|
2019-07-17 04:09:35 +00:00
|
|
|
# wlroot rdp
|
|
|
|
wlroot_rdp_cache="$HOME/.cache/wlr-rdp"
|
|
|
|
wlroot_rdp_cert="$wlroot_rdp_cache/tls.crt"
|
|
|
|
wlroot_rdp_key="$wlroot_rdp_cache/tls.key"
|
|
|
|
wlroot_rdp_csr="$wlroot_rdp_cache/tls.csr"
|
|
|
|
mkdir "$wlroot_rdp_cache" 2>/dev/null
|
|
|
|
if [[ ! -e "$wlroot_rdp_cert" ]] || [[ ! -e "$wlroot_rdp_key" ]]; then
|
|
|
|
openssl genrsa -out "$wlroot_rdp_key" 2048
|
|
|
|
openssl req -new -key "$wlroot_rdp_key" -out "$wlroot_rdp_csr"
|
|
|
|
openssl x509 -req -days 365 -signkey "$wlroot_rdp_key" -in "$wlroot_rdp_csr" -out "$wlroot_rdp_cert"
|
|
|
|
fi
|
|
|
|
|
|
|
|
WLR_RDP_TLS_CERT_PATH="$wlroot_rdp_cert" \
|
|
|
|
WLR_RDP_TLS_KEY_PATH="$wlroot_rdp_key" \
|
2019-04-04 22:36:19 +00:00
|
|
|
exec /usr/bin/sway $@
|