11. Application bus

  1. Install (on the virtual machine) all the software required:
    • # apt-get install d-feet qt5-dbus python3-module-pydbus

  2. Follow «DBus programming» lecture part.


  1. Log in to sugon and create a folder named 11_ApplicationBus.

  2. Finish all the tasks on VE
  3. 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'.
  4. 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.
  5. 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'/>
    • def MultiString(self, s, num):
          """returns n strings"""
          return s * num
    Call this method from 'dbus-send' (specify types of arguments as: string and uint32).
  6. Save the program itself and the output (to the 'miltistring.log') and save it to sugon.

HSE/ArchitectureOS/Lab_11_ApplicationBus (last edited 2020-06-23 20:16:20 by FrBrGeorge)