TDE base libraries and programs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

displayconfig.cpp 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /***************************************************************************
  2. * Copyright (C) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net> *
  3. * *
  4. * This program is free software; you can redistribute it and/or modify *
  5. * it under the terms of the GNU General Public License as published by *
  6. * the Free Software Foundation; either version 2 of the License, or *
  7. * (at your option) any later version. *
  8. * *
  9. * This program is distributed in the hope that it will be useful, *
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  12. * GNU General Public License for more details. *
  13. * *
  14. * You should have received a copy of the GNU General Public License *
  15. * along with this program; if not, write to the *
  16. * Free Software Foundation, Inc., *
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
  18. ***************************************************************************/
  19. #include <config.h>
  20. #include <unistd.h>
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23. #include <tdeapplication.h>
  24. #include <tdeaboutdata.h>
  25. #include <tdecmdlineargs.h>
  26. #include <kstandarddirs.h>
  27. #include <tdelocale.h>
  28. #include <kdebug.h>
  29. #include <tdeconfig.h>
  30. #include <pwd.h>
  31. #include <signal.h>
  32. #ifdef WITH_XRANDR
  33. #include <libtderandr/libtderandr.h>
  34. #endif
  35. static const char description[] = I18N_NOOP("TDE Initialization Display Configuration");
  36. static const char version[] = "0.1";
  37. static TDECmdLineOptions options[] =
  38. {
  39. TDECmdLineLastOption
  40. };
  41. int main(int argc, char **argv)
  42. {
  43. int return_code = -1;
  44. TDEAboutData about("tdeinit_displayconfig", I18N_NOOP("tdeinit_displayconfig"), version, description,
  45. TDEAboutData::License_GPL, "(C) 2013 Timothy Pearson", 0, 0, "kb9vqf@pearsoncomputing.net");
  46. about.addAuthor( "Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net" );
  47. TDECmdLineArgs::init(argc, argv, &about);
  48. TDECmdLineArgs::addCmdLineOptions( options );
  49. TDEApplication::disableAutoDcopRegistration();
  50. TDEApplication app;
  51. #ifdef WITH_XRANDR
  52. // Load up user specific display settings
  53. KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI();
  54. randrsimple->applyStartupDisplayConfiguration(locateLocal("config", "/", true));
  55. randrsimple->applyHotplugRules(locateLocal("config", "/", true));
  56. delete randrsimple;
  57. #endif
  58. return return_code = 0;
  59. }