This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Enabling / disabling desktop effects in KDE4

Tags: None
(comma "," separated)
User avatar
beermad
Registered Member
Posts
104
Karma
0
OS
Is there a way to enable and disable KDE4 desktop effects from the command-line rather than through the control centre?

The reason I ask is that with them enabled, applications that us GLX rendering (like Google Earth, video players, etc.) suffer from flickering when effects are enabled (a known problem according to the Ubuntu documentation). So rather than have to manually make the change, it would be useful to be able to do it within a wrapper-script and so make life easier.

I'm sure it's simple enough if I can only find the right command. :-P


User avatar
google01103
Manager
Posts
6668
Karma
25

Last edited by google01103 on Sun Dec 14, 2008 6:00 pm, edited 1 time in total.


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
SeaJey
Registered Member
Posts
166
Karma
0
OS
Toggle-Compositing:

A simple Plasmoid used for toggling KWin compositing effects on and off.


kubuntu 10.04 AMD64 - KDE 4.4
AMD - radeonHD - M-Audio revolution 5.1
User avatar
beermad
Registered Member
Posts
104
Karma
0
OS
Thanks both for the suggestions.

google01103's link helped by showing the right config file. And that helped me work out that it's kwin that I need to work on.

So changing compositing's "enabled" parameter and running kwin --replace does the job, albeit in a rather messy way (all the windows vanish and then reappear) but it's better than having to do it manually.

There must be a cleaner way (however the control centre does it) but it's a start. Shame kill -HUP doesn't persuade kwin to re-read its config file...


Kryten2X4B
Registered Member
Posts
911
Karma
4
OS
beermad wrote:Is there a way to enable and disable KDE4 desktop effects from the command-line rather than through the control centre?


Hit shift + left-alt + f12 at the same time is quick enough for me :)


OpenSUSE 11.4, 64-bit with KDE 4.6.4
Proud to be a member of KDE forums since 2008-Oct.
User avatar
beermad
Registered Member
Posts
104
Karma
0
OS
Kryten2X4B wrote:
Hit shift + left-alt + f12 at the same time is quick enough for me :)


...which along with another thread I was looking at led me to some interesting output from dbus-monitor when I hit that combination:
Code: Select all
method call sender=:1.270 -> dest=org.kde.kded path=/modules/kdedglobalaccel; interface=org.kde.KdedGlobalAccel; member=setInactive

Now once I can decipher the dbus-send man page I may have an answer for doing it in a script.

I'll get there yet :-D


User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Since you are using KDE 4, and therefore Qt4, you may find qdbus easier to use.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
bepaald
Registered Member
Posts
5
Karma
0
OS
Hi! I'm having more or less the same issue. Did you ever get it working? Using qdbusviewer and Alt-Shift-F12, I saw the signal sent was:

Received signal from :1.2, path /modules/kdedglobalaccel, interface org.kde.KdedGlobalAccel, member invokeAction
Arguments: {"kwin", "Suspend Compositing", "KWin", "Suspend Compositing"}, "91208637"

But I don't know how to get the same effect using the command line. I'm pretty sure it should start like this:
Code: Select all
$ qdbus org.kde.kded /modules/kdedglobalaccel org.kde.KdedGlobalAccel.invokeAction


But anything I try to put after that results in either
Code: Select all
Invalid number of parameters
or
Code: Select all
Error: org.freedesktop.DBus.Error.UnknownMethod
No such method 'invokeAction' in interface 'org.kde.KdedGlobalAccel' at object path '/modules/kdedglobalaccel' (signature 'asx')


Any ideas?
User avatar
beermad
Registered Member
Posts
104
Karma
0
OS
bepaald wrote:Hi! I'm having more or less the same issue. Did you ever get it working? Using qdbusviewer and Alt-Shift-F12, I saw the signal sent was:

Received signal from :1.2, path /modules/kdedglobalaccel, interface org.kde.KdedGlobalAccel, member invokeAction
Arguments: {"kwin", "Suspend Compositing", "KWin", "Suspend Compositing"}, "91208637"

But I don't know how to get the same effect using the command line. I'm pretty sure it should start like this:
Code: Select all
$ qdbus org.kde.kded /modules/kdedglobalaccel org.kde.KdedGlobalAccel.invokeAction


But anything I try to put after that results in either
Code: Select all
Invalid number of parameters
or
Code: Select all
Error: org.freedesktop.DBus.Error.UnknownMethod
No such method 'invokeAction' in interface 'org.kde.KdedGlobalAccel' at object path '/modules/kdedglobalaccel' (signature 'asx')


Any ideas?


Unfortunately I didn't get anywhere. I've given up even trying to understand how to get dbus or qdbus working from the command-line.

I'm sure there's a very good reason for the impenetrable syntax and lack of useful documentation (or at least lack of any that I can find), but it's got me stumped.


bepaald
Registered Member
Posts
5
Karma
0
OS
Yeah, the lack of documentation is stunning.

The problem seems to be with the fact that org.kde.KdedGlobalAccel.invokeAction is a signal and not a method. I can call the methods just fine, for example:
Code: Select all
qdbus org.ktorrent.ktorrent /KTorrent org.ktorrent.KTorrent.torrents
will simply list all the torrents currently running in KTorrent. But the signals seem to work differently, and no amount of Googling seems to help me out on that.

Anyway, thanks for your quick reply, I'll just wait a bit and see if anyone else knows....

bepaald
User avatar
QueenZ
Registered Member
Posts
78
Karma
0
OS
I had to reinstall Linux when i enabled these effects.. i guess it's because i didn't have drivers installed..


User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
@QueenZ: There are numerous posts on this forum that detail how to edit the KWin configuration file to disable these configuration effects if a problem such as this is encountered.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Ran
Registered Member
Posts
1
Karma
0
It's very much an ugly hack, but I needed to do this -- so I did using xmacro. All I did was install it, create a file with this in it:
Code: Select all
KeyStrPress: Alt_L
KeyStrPress: Shift_L
KeyStrPress: F12
Delay: 0.1
KeyStrRelease: F12
KeyStrRelease: Shift_L
KeyStrRelease: Alt_L

and then I cat that and pipe it to xmacroplay ":0.0" whenever I want to toggle the special effects.
vatbier
Registered Member
Posts
16
Karma
0
See here viewtopic.php?f=17&t=6712 :
This command will disable compositing in the kwinrc config file:
kwriteconfig --file kwinrc --group Compositing --key Enabled false

Then restart kwin (in Alt+F2) with:
kwin --replace

To get compositing back, just substitute false with true and restart kwin again.


vatbier, proud to be a member of KDE forums since 2008-Oct.
Rufy
Registered Member
Posts
1
Karma
1
OS
I just worked out how to do this using qdbus. There's a function you can call with qdbus that toggles compositing, and by querying another function you can see if compositing is currently enabled and then disable it. Something like this:

Code: Select all
RESET="false"
RESULT=`qdbus org.kde.kwin /KWin org.kde.KWin.compositingActive`

if [ "$RESULT" = "true" ]
then
  RESET="true"
  qdbus org.kde.kwin /KWin org.kde.KWin.toggleCompositing
  sleep 2
fi

#
# put your commands to run with compositing disabled here
#

[ "$RESET" = "true" ] && qdbus org.kde.kwin /KWin org.kde.KWin.toggleCompositing


This script will detect if compositing is enabled, and if it is it will disable it. Then it will run your command. Once that is done, it re-enabled compositing if it was enabled when you ran the script. Otherwise it leaves compositing disabled.

Enjoy!


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]