You are not logged in.
Hi,
I am trying to use dbus to use the KDE zoom-in/out feature. I need this to assign mouse-based shortcuts as described here
Using dbus-monitor, I got the following output when pressing the default shortcut for KDE-zoom:
signal sender=:1.5 -> dest=(null destination) serial=1152 path=/component/kwin; interface=org.kde.kglobalaccel.Component; member=globalShortcutPressed
string "kwin"
string "view_zoom_in"
int64 30802948
method call sender=:1.5 -> dest=org.kde.knotify serial=1153 path=/Notify; interface=org.kde.KNotify; member=event
string "globalshortcutpressed"
string "kglobalaccel"
array [
variant string "application"
variant string "KWin"
]
string ""
string "The global shortcut for Zoom &In was issued."
array [
]
array [
]
int32 -1
int64 0
method return sender=:1.11 -> dest=:1.5 reply_serial=1153
int32 0
But I can't figure out how to use this info to actually send the zoom-in message with dbus-send. Can anyone help me with this?
Last edited by codemon (2010-10-13 05:45:58)
Offline
Hello
I recommend you use qdbusviewer to dig into dbus methods.
As far as I know, there is no dbus method in kwin to trigger the zoom. But, as you discovered, you can use kglobalaccel's invokeShortcut method to simulate a keypress. The resulting qdbus console call is :
> qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "view_zoom_in"
Cheers
Offline
Thanks for the help! Works perfectly!
Offline
So I resume:
yaourt -S xbindkeys
xbindkeys --defaults > $HOME/.xbindkeysrc
Then edit with your favorite text editor the file ~/.xbindkeysrc and add before the end those lines:
# Zoom in
"qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "view_zoom_in""
m:0x50 + c:133 + b:4
# Zoom out
"qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "view_zoom_out""
m:0x50 + c:133 + b:5
Restart xbindkeys to apply the new shortcut:
killall xbindkeys && xbindkeys
Now you can fully enjoy the zoom effect and add xbindkeys into Autostart kde systemsettings tab.
Enjoy^^.
P.S: the shortcut I used in those line is meta key + scroll up for zoom in and meta key + scroll down for the zoom out.
Last edited by splashy (2011-08-09 22:39:50)
Offline