-
Notifications
You must be signed in to change notification settings - Fork 50
/
startlxqt.in
executable file
·68 lines (54 loc) · 1.78 KB
/
startlxqt.in
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
contains()
{
local str="$1" substr="$2"
[ "$str" = "$substr" -o -z "${str##$substr:*}" -o -z "${str##*:$substr:*}" -o -z "${str%%*:$substr}" ]
}
if [ -z "$XDG_DATA_HOME" ]; then
export XDG_DATA_HOME="$HOME/.local/share"
fi
if [ -z "$XDG_CONFIG_HOME" ]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi
if [ -z "$XDG_DATA_DIRS" ]; then
XDG_DATA_DIRS="@PREDEF_XDG_DATA_DIRS@"
else
if ! contains "$XDG_DATA_DIRS" "@LXQT_DATA_DIR@"; then
XDG_DATA_DIRS="$XDG_DATA_DIRS:@LXQT_DATA_DIR@"
fi
fi
export XDG_DATA_DIRS
if [ -z "$XDG_CONFIG_DIRS" ]; then
export XDG_CONFIG_DIRS="@PREDEF_XDG_CONFIG_DIRS@"
else
if ! contains "$XDG_CONFIG_DIRS" '@LXQT_ETC_XDG_DIR@'; then
XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:@LXQT_ETC_XDG_DIR@"
fi
fi
if [ -z "$XDG_CACHE_HOME" ]; then
export XDG_CACHE_HOME="$HOME/.cache"
fi
# Ensure the existence of the 'Desktop' folder
if [ -e "$XDG_CONFIG_HOME/user-dirs.dirs" ]; then
. "$XDG_CONFIG_HOME/user-dirs.dirs"
else
XDG_DESKTOP_DIR="$HOME/Desktop"
fi
mkdir -p "$XDG_DESKTOP_DIR"
# Clean up after GDM (GDM sets the number of desktops to one)
xprop -root -remove _NET_NUMBER_OF_DESKTOPS -remove _NET_DESKTOP_NAMES -remove _NET_CURRENT_DESKTOP 2> /dev/null
# Launch DBus if needed
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
if [ -z "$XDG_RUNTIME_DIR" ] || ! [ -S "$XDG_RUNTIME_DIR/bus" ] || ! [ -O "$XDG_RUNTIME_DIR/bus" ]; then
eval "$(dbus-launch --sh-syntax --exit-with-session)" || echo "startlxqt: error executing dbus-launch" >&2
fi
fi
# Qt4 platform plugin
export QT_PLATFORM_PLUGIN=lxqt
# Qt5 platform plugin
export QT_QPA_PLATFORMTHEME=lxqt
# use lxqt-applications.menu for main app menu
export XDG_MENU_PREFIX="lxqt-"
export XDG_CURRENT_DESKTOP="LXQt"
# Start the LXQt session
exec lxqt-session