Debian Codegraph @

tests/include/desktop_environment

raw
1 #!/bin/bash
2
3 ## This script modified from one supplied by Bryce Harrington at OSDL
4
5 if command -v kde-config >/dev/null; then
6 # From Sutoka on FreeNode/#kde
7 kde_version=`kde-config --version | grep KDE | cut -d' ' -f2 2> /dev/null`
8 kde_running=$KDE_FULL_SESSION
9 if [ ! -z "$KDE_FULL_SESSION" ]; then
10 running="kde $running"
11 fi
12 echo "kde: $kde_version"
13 else
14 echo "kde: not present (didn't find kde-config)"
15 fi
16
17 # From kees on #osdl
18 if command -v gnome-session >/dev/null ; then
19 gnome_version=`gnome-session --version | cut -d ' ' -f3 2>/dev/null`
20 echo "gnome: $gnome_version"
21
22 if [ ! -z "$GNOME_DESKTOP_SESSION_ID" ]; then
23 running="gnome $running"
24 fi
25 else
26 echo "gnome: not present (didn't find gnome-session)"
27 fi
28
29 if command -v xfce4-session >/dev/null ; then
30 xfce_version=`xfce4-session --version | grep '(Xfce ' | cut -d '(' -f 2 | cut -d ' ' -f2 | cut -d ')' -f1`
31 # From massonnet on FreeNode/#xfce
32 #if [ `pidof xfce4-session` ]; then
33 if [ "$GDMSESSION" = 'xfce4' ] ; then
34 running="xfce $running"
35 fi
36
37 echo "xfce: $xfce_version"
38 else
39 echo "xfce: not present (didn't find xfce4-session)"
40 fi
41
42 if [ -z "$running" ] ; then
43 running='none'
44 fi
45
46
47 echo "running: $running "
48 if [ `whoami` = 'root' ] ; then
49 echo "user: root"
50 else
51 echo "user: normal"
52 fi