-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxprofile
56 lines (49 loc) · 1.43 KB
/
xprofile
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
#!/bin/sh
#
# This is run by the /etc/X11/xinit/session or /etc/X11/xdm/Xsession
# scripts early in the process. Before the Desktop Environment
# is present.
#
export HK_HELPER_SAVE_SCREENSHOT_FILE=1
is_xrdp() {
[ -z "$DISPLAY" ] && return 1
local port=$(echo $DISPLAY | cut -d . -f1 | tr -d :)
local xorgpid=$(ss -lxp | awk '$5 == "/tmp/.X11-unix/X'"$port"'" {
if (match($0, /,pid=([0-9]+)/,arr)) {
print arr[1];
}
}')
[ -z "$xorgpid" ] && return 1
local sesspid=$(awk '$1 == "PPid:" { print $2 }' /proc/$xorgpid/status)
[ -z "$sesspid" ] && return 1
local name=$(awk '$1 == "Name:" { print $2 }' /proc/$sesspid/status)
if [ x"$name" = x"xrdp-sesman" ] ; then
return 0
fi
return 1
}
IS_VIRTUAL=false
if (xdpyinfo | grep -q XVNC-EXTENSION) ; then
IS_VIRTUAL=true
elif is_xrdp ; then
IS_VIRTUAL=true
fi
export IS_VIRTUAL
# Make sure this fonts are included...
[ -d /usr/share/fonts/TTF ] && xset fp+ /usr/share/fonts/TTF
[ -f $HOME/.Xdefaults ] && xrdb -merge $HOME/.Xdefaults
if ! $IS_VIRTUAL ; then
# Configure keyboard... this is more suitable for programming
setxkbmap -rules evdev -model evdev -layout us -variant altgr-intl
# Enable Shift-NumLock to toggle mouse control to the keyboard number pad
setxkbmap -option keypad:pointerkeys
# Make sure NUMLOCK is on
case "$(uname -n)" in
*) numlockx on ;;
esac
#(
# sleep 500
# xset dpms 1800 3600 7200
# xset +dpms
#) &
fi