Till devs do not find a real solution I made a BLOODY BRUTAL workaround which helps me.
PLEASE understand what my program is doing and decide if it is suits you or not.
I found "cpulimit" (can be installed from software center - at least in Ubuntu 15.10) which slows down a particular thread.
No, "nice" does not do the work, because "nice" just gives priorities and here we want that CPUs do not do "anything".
I wrote a small python script which
- checks if screen lock OR screensaver became active, if yes, it limits that thread with "cpulimit"
- checks if screen lock OR screensaver became inactive, if yes, ir removes all limitation
Again, it slows down compiz so violently as possible.
With my system the keyboard lock (Alt-Ctrl-L) fades out for 5-10 secs...
when I enter my password dots has 1 sec lag...
Screensaver part is added to eliminate this lock-screen delay.
Under "normal use" screensaver deactivates earlier, so compiz became much more responsive.
If your programs use compiz during screen lock, it is VERY LIKELY that this script will slow down or somehow affect those programs as well, so use it wisely!
For the script running you have to install python-dbus if you did not do it so far:
sudo apt-get install python-dbus
The python script itself:
#!/usr/bin/env python
import gobject
import dbus
import os
from dbus.mainloop.glib import DBusGMainLoop
Till devs do not find a real solution I made a BLOODY BRUTAL workaround which helps me.
PLEASE understand what my program is doing and decide if it is suits you or not.
I found "cpulimit" (can be installed from software center - at least in Ubuntu 15.10) which slows down a particular thread.
No, "nice" does not do the work, because "nice" just gives priorities and here we want that CPUs do not do "anything".
I wrote a small python script which
- checks if screen lock OR screensaver became active, if yes, it limits that thread with "cpulimit"
- checks if screen lock OR screensaver became inactive, if yes, ir removes all limitation
Again, it slows down compiz so violently as possible.
With my system the keyboard lock (Alt-Ctrl-L) fades out for 5-10 secs...
when I enter my password dots has 1 sec lag...
Screensaver part is added to eliminate this lock-screen delay.
Under "normal use" screensaver deactivates earlier, so compiz became much more responsive.
If your programs use compiz during screen lock, it is VERY LIKELY that this script will slow down or somehow affect those programs as well, so use it wisely!
For the script running you have to install python-dbus if you did not do it so far:
sudo apt-get install python-dbus
The python script itself:
#!/usr/bin/env python
import gobject
import dbus
import os
from dbus.mainloop.glib import DBusGMainLoop
def lock_and_ screensaver_ filter( bus, message): get_member( ) get_args_ list() system( "cpulimit -b -P /usr/bin/compiz -l 1") system( "pkill cpulimit") get_args_ list() system( "cpulimit -b -P /usr/bin/compiz -l 1") system( "pkill cpulimit")
EventMember =message.
if EventMember == "EventEmitted":
args = message.
if args[0] == "desktop-lock":
os.
elif args[0] == "desktop-unlock":
os.
elif EventMember == "ActiveChanged":
args = message.
if args[0] == True:
os.
else:
os.
DBusGMainLoop( set_as_ default= True) match_string( "type=' signal' ,interface= 'com.ubuntu. Upstart0_ 6'") match_string( "type=' signal' ,interface= 'org.gnome. ScreenSaver' ") message_ filter( lock_and_ screensaver_ filter)
bus = dbus.SessionBus()
bus.add_
bus.add_
bus.add_
mainloop = gobject.MainLoop()
mainloop.run()