Package list lightdm-gtk-greeter-settings / b2b3640
New option for setup.py: --xfce-integration Andrew P. 7 years ago
2 changed file(s) with 40 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
4545 content.reparent(plug)
4646 Gtk.main()
4747 else:
48 if args.use_gtk_header is None:
49 args.use_gtk_header = helpers.string2bool(os.getenv('GTK_CSD'), False)
50 elif args.use_gtk_header:
51 os.putenv('GTK_CSD', '1')
52
53 window_mode = WindowMode.Default
4854 if args.use_gtk_header:
49 window = GtkGreeterSettingsWindow.GtkGreeterSettingsWindow(mode=WindowMode.GtkHeader)
50 else:
51 window = GtkGreeterSettingsWindow.GtkGreeterSettingsWindow()
55 window_mode = WindowMode.GtkHeader
56
57 window = GtkGreeterSettingsWindow.GtkGreeterSettingsWindow(mode=window_mode)
5258 window.show()
5359 Gtk.main()
5460
3737 for k, v in values.items():
3838 f.write('%s = %s\n' % (k, v))
3939 except OSError as e:
40 print ("ERROR: Can't write installation config: %s" % e)
41 sys.exit(1)
40 print("ERROR: Can't write installation config: %s" % e)
41 sys.exit(1)
4242
4343
4444 class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto):
45
46 user_options = DistUtilsExtra.auto.install_auto.user_options + \
47 [('xfce-integration', None,
48 'adds application icon to Xfce settings manager'),
49 ('use-gtk-header', None,
50 'use GtkHeaderBar instead of default DE window header')]
51
52 def initialize_options(self):
53 super().initialize_options()
54 self.xfce_integration = None
55 self.use_gtk_header = None
4556
4657 def run(self):
4758 DistUtilsExtra.auto.install_auto.run(self)
5364 '__version__': "%s" % self.distribution.get_version(),
5465 '__config_path__': '"/etc/lightdm/lightdm-gtk-greeter.conf"'}
5566 write_config(self.install_lib, values)
67
68 desktop_file_path = os.path.join(self.install_data, 'share', 'applications',
69 'lightdm-gtk-greeter-settings.desktop')
70
71 if self.xfce_integration:
72 with open(desktop_file_path, 'a') as f:
73 f.write('X-XfcePluggable=true\n')
74
75 if self.use_gtk_header:
76 with open(desktop_file_path, 'r+') as f:
77 lines = f.readlines()
78 for i, line in enumerate(lines):
79 if line.startswith('Exec='):
80 lines[i] = line.strip() + ' --use-gtk-header\n'
81 break
82 f.seek(0)
83 f.truncate(0)
84 f.writelines(lines)
5685
5786
5887 DistUtilsExtra.auto.setup(