mirror of
https://github.com/tuxedocomputers/tuxedo-touchpad-switch.git
synced 2025-01-18 11:41:10 +01:00
core dump happens if environment variable XDG_CURRENT_DESKTOP is not set. fixes #7
This commit is contained in:
parent
4efc7ca3da
commit
aa96f01bf8
1 changed files with 5 additions and 1 deletions
|
@ -96,7 +96,11 @@ int main() {
|
|||
}
|
||||
|
||||
char *xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
|
||||
if (strstr(xdg_current_desktop, "GNOME")) {
|
||||
if (!xdg_current_desktop) {
|
||||
cout << "Your desktop environment could not be determined. Maybe running as root?" << endl;
|
||||
gracefull_exit(SIGTERM);
|
||||
}
|
||||
else if (strstr(xdg_current_desktop, "GNOME")) {
|
||||
setup_gnome(lockfile);
|
||||
}
|
||||
else if (strstr(xdg_current_desktop, "KDE")) {
|
||||
|
|
Loading…
Reference in a new issue