~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to bin/ubiquity-dm

  • Committer: Dmitrijs Ledkovs
  • Date: 2013-10-18 22:30:43 UTC
  • Revision ID: dmitrijs.ledkovs@canonical.com-20131018223043-xlovtd27clg1vzhw
Set wallpaper for 'feh' only, for others just assume gsettings schemes
are correct.

Show diffs side-by-side

added added

removed removed

Lines of Context:
350
350
 
351
351
            background_image = None
352
352
            for background in (
353
 
                    '/usr/share/backgrounds/edubuntu_default.png',
354
353
                    '/usr/share/xfce4/backdrops/ubuntustudio-1310.png',
355
354
                    '/usr/share/xfce4/backdrops/xubuntu-wallpaper.png',
356
355
                    '/usr/share/lubuntu/wallpapers/'
357
 
                    'lubuntu-default-wallpaper.png',
358
 
                    '/usr/share/backgrounds/ubuntukylin-default-settings.jpg',
359
 
                    '/usr/share/backgrounds/warty-final-ubuntu.png',
360
 
                    '/usr/share/backgrounds/gnome/FootFall.png'):
 
356
                    'lubuntu-default-wallpaper.png'):
361
357
                exists = os.access(background, os.R_OK)
362
358
                if exists:
363
359
                    background_image = background
364
360
                    break
365
361
 
366
 
            # Setting a wallpaper image, or solid color.
367
 
            if visual_a11y or background_image is None:
368
 
                picture_option = 'none'
369
 
                background_image = False
370
 
            else:
371
 
                picture_option = 'zoom'
372
 
 
373
 
            if background_image:
374
 
                background_url = 'file://' + background_image
375
 
            else:
376
 
                background_url = "''"
377
 
 
378
362
            accessibility = False
379
363
            if gsettings._gsettings_exists():
380
364
                accessibility = gsettings.get(
395
379
                     'false'),
396
380
                    ('org.gnome.metacity', 'compositing-manager',
397
381
                     'true'),
398
 
                    ('org.gnome.desktop.background', 'picture-options',
399
 
                     picture_option),
400
 
                    ('org.gnome.desktop.background', 'picture-uri',
401
 
                     background_url),
402
382
                    ('org.gnome.desktop.wm.preferences', 'num-workspaces',
403
383
                     '1'),
404
384
                ]
 
385
                # Setting a wallpaper image, or solid color.
 
386
                if visual_a11y:
 
387
                    gsettings_keys.append(
 
388
                        ('org.gnome.desktop.background', 'picture-options',
 
389
                            'none'))
 
390
                    gsettings_keys.append(
 
391
                        ('org.gnome.desktop.background', 'picture-uri',
 
392
                            "''"))
405
393
 
406
394
                if osextras.find_on_path('gnome-shell'):
407
395
                    gsettings_keys.append(
611
599
                    # them figure it out.
612
600
                    reboot = False
613
601
 
 
602
        # Revert gnome-settings to default, for dropping to desktop
 
603
        if gsettings._gsettings_exists():
 
604
            for gs_schema, gs_key, gs_value in gsettings_keys:
 
605
                subprocess.call(
 
606
                    ['gsettings', 'reset', gs_schema, gs_key],
 
607
                    stdin=null, stdout=logfile, stderr=logfile,
 
608
                    preexec_fn=self.drop_privileges)
 
609
 
614
610
        def kill_if_exists(pid, signum):
615
611
            try:
616
612
                os.kill(pid, signum)