11. Application bus
- Install (on the virtual machine) all the software required:
# apt-get install d-feet qt5-dbus python3-module-pydbus
Follow «DBus programming» lecture part.
H/W
Log in to sugon and create a folder named 11_ApplicationBus.
- Finish all the tasks on VE
- Listen to D-bus messages with 'dbus-monitor'. In the first terminal, run 'dbus-monitor' to listen to messages:
andrewt@comp-core-i7-3615qm-0dbf32 ~ $ dbus-monitor | grep -A 10 -B 4 "Hello world"
In the second terminal, send a notification:andrewt@comp-core-i7-3615qm-0dbf32 ~ $ notify-send "Hello world"
Save what was recorded by 'dbus-monitor' to the 'notification.log' file and upload it to 'sugon'. - Listen to D-bus messages with 'dbus-monitor' to know the call that changes wallpaper.
- Run 'dbus-monitor':
andrewt@comp-core-i7-3615qm-0dbf32 ~ $ dbus-monitor | grep -A 10 -B 10 "last-image"
- Change the desktop wallpaper.
- Find the method call that changes wallpaper in the 'dbus-monitor' output.
- Based on the call description from 'dbus-monitor' write a command that changes the wallpaper using 'qdbus'. Hint: andrewt@comp-core-i7-3615qm-0dbf32 ~ $ qdbus org.xfce.Xfconf bla-bla-bla
- Save the command to the 'wallpaper.sh' file and upload it to sugon.
- Run 'dbus-monitor':
Modify the server.py service. Add a new method: Signature:
<method name='MultiString'> <arg type='s' name='a' direction='in'/> <arg type='u' name='num' direction='in'/> <arg type='as' name='response' direction='out'/> </method>
Body:def MultiString(self, s, num): """returns n strings""" return s * num
Save the program itself and the output (to the 'miltistring.log') and save it to sugon.