37 | 37 |
for k, v in values.items():
|
38 | 38 |
f.write('%s = %s\n' % (k, v))
|
39 | 39 |
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)
|
42 | 42 |
|
43 | 43 |
|
44 | 44 |
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
|
45 | 56 |
|
46 | 57 |
def run(self):
|
47 | 58 |
DistUtilsExtra.auto.install_auto.run(self)
|
|
53 | 64 |
'__version__': "%s" % self.distribution.get_version(),
|
54 | 65 |
'__config_path__': '"/etc/lightdm/lightdm-gtk-greeter.conf"'}
|
55 | 66 |
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)
|
56 | 85 |
|
57 | 86 |
|
58 | 87 |
DistUtilsExtra.auto.setup(
|