Prevent computer sleep lazarus / 32-Linux ---------------------------------------------------------------------- mdalacu · 2018-11-07 13:23 Hi. I need help to modify my application to prevent computer entering sleep state while the app is doing something.... On windows i achieve this like so: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF Windows}   SetThreadExecutionState(ES_CONTINUOUS OR ES_SYSTEM_REQUIRED OR ES_AWAYMODE_REQUIRED);{$ENDIF} Any ideea on how can i do this on Linux..manly Ubuntu 18.04 x64. Thank you very much. ---------------------------------------------------------------------- mdalacu · 2018-11-12 06:23 No one? Any hint is appreciated... ---------------------------------------------------------------------- Leledumbo · 2018-11-12 12:10 What I can find is this, where FPC should be capable of doing both, however I prefer the dbus way as X may not be available in the future when wayland finally takes over. See: http://wiki.freepascal.org/FPC_and_DBus ---------------------------------------------------------------------- Thaddy · 2018-11-12 12:30 Yes, I agree, but the wiki entry is not finished and a bit marginal. There is far better code however: If you are new to dbus programming maybe these articles by Michael can Canneyt can help: https://www.freepascal.org/~michael/articles/#dbus1 https://www.freepascal.org/~michael/articles/#dbus2 sources: https://www.freepascal.org/~michael/articles/dbus2/dbus- code.zip ---------------------------------------------------------------------- mdalacu · 2018-11-14 08:46 Thank you both! :-) @Thaddy The sorces posted for dbus does not compile anymore so i will try using dbus-sent in a Tprocess Thank you again. ---------------------------------------------------------------------- Thaddy · 2018-11-14 09:00 Yes i Saw that. A quick Fix is to make the property a VAR ---------------------------------------------------------------------- mdalacu · 2018-11-14 12:04 @Thaddy Please, can you be more specific? What did you changed in order to compile the 2 bundled examples? Thank you. ---------------------------------------------------------------------- mdalacu · 2018-11-16 09:12 Me again...i am unable to sort this out... :/ It is beyond my skills. Could someone provide an quick example how to call a dbus method using dbus unit from fpc? "dbuscomp" i am unable to make it to compile. Thank you very much. ---------------------------------------------------------------------- Thaddy · 2018-11-16 10:52 check if  the dbus shared libraries have the extension .so and not so.1 or something. If so, create a symlink or copy. ---------------------------------------------------------------------- mdalacu · 2018-11-16 13:51 Quote from: Thaddy on November 16, 2018, 11:52:03 amcheck if  the dbus shared libraries have the extension .so and not so.1 or something. If so, create a symlink or copy. This is not the problem. I need an working examle using dbus unit as the wiki is incomplete or an updated dbuscomp unit which i could compile. The posted one has methods which are no longer available in dbus. Thanks again. ---------------------------------------------------------------------- Thaddy · 2018-11-16 14:12 OK I will come up with something new (but these calls are still available afaik AND tested!) Not based on the wiki but based on the article. ---------------------------------------------------------------------- mdalacu · 2018-11-17 11:43 Thank you @Thaddy.  I am waiting eagerly for your example. ---------------------------------------------------------------------- mdalacu · 2018-11-22 08:46 Please, just an working example of using dbus...it's all i need... i hope... :-) ---------------------------------------------------------------------- Thaddy · 2018-11-22 10:30 I do not always have time to do it right away. ---------------------------------------------------------------------- mdalacu · 2018-11-23 06:49 Quote from: Thaddy on November 22, 2018, 11:30:12 amI do not always have time to do it right away. I am sorry for insisting to much. ---------------------------------------------------------------------- Thaddy · 2018-11-23 08:21 No problem. I have nailed down the link errors and am testing a patch. ---------------------------------------------------------------------- mdalacu · 2018-11-30 12:49 @Thaddy How is the patch? It is working or you still tesing it? Thanks agin.