forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinux_desktop_environment.h
73 lines (57 loc) · 1.12 KB
/
linux_desktop_environment.h
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
69
70
71
72
73
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace Platform {
namespace DesktopEnvironment {
enum class Type {
Other,
Gnome,
KDE3,
KDE4,
KDE5,
Ubuntu,
Unity,
XFCE,
Pantheon,
Awesome,
};
Type Get();
inline bool IsGnome() {
return Get() == Type::Gnome;
}
inline bool IsKDE3() {
return Get() == Type::KDE3;
}
inline bool IsKDE4() {
return Get() == Type::KDE4;
}
inline bool IsKDE5() {
return Get() == Type::KDE5;
}
inline bool IsKDE() {
return IsKDE3() || IsKDE4() || IsKDE5();
}
inline bool IsUbuntu() {
return Get() == Type::Ubuntu;
}
inline bool IsUnity() {
return Get() == Type::Unity;
}
inline bool IsXFCE() {
return Get() == Type::XFCE;
}
inline bool IsPantheon() {
return Get() == Type::Pantheon;
}
inline bool IsAwesome() {
return Get() == Type::Awesome;
}
bool TryQtTrayIcon();
bool PreferAppIndicatorTrayIcon();
bool TryUnityCounter();
} // namespace DesktopEnvironment
} // namespace Platform