-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgconf-settings
executable file
·99 lines (87 loc) · 2.85 KB
/
gconf-settings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/perl
use strict;
use warnings;
sub gconfGetCmd($);
sub gconfSetCmd($$$$);
sub listInt($);
sub listString($);
my $swype = 1;
my $lockScreenBG = '/usr/share/backgrounds/lockscreen.jpg';
my @vkbNormal = ('libmeego-keyboard.so', 'en_us.xml');
my @vkbSwype = ('libswype-keyboard.so' , 'Swype');
my $vkbEnabled = listString [$swype ? (@vkbSwype) : (@vkbNormal)];
my $vkbActive = listString [$swype ? (@vkbSwype) : (@vkbNormal)];
my %usbModes = (
ask => 'ask',
sdk => 'windows_network',
sync => 'ovi_suite',
storage => 'mass_storage',
);
my $display = '/system/osso/dsm/display';
my $locks = '/system/osso/dsm/locks';
my $statusArea = '/desktop/meego/status_area';
my $TRUE = ['true', 'bool'];
my $FALSE = ['false', 'bool'];
my $batLineRGB = [0, 60, 0];
my %gconf = (
"/Meego/System/UsbMode" => [$usbModes{sync}],
"/desktop/meego/background/portrait/picture_filename" => [$lockScreenBG],
"$statusArea/display_netspeed" => $TRUE,
"$statusArea/display_percentage" => $TRUE,
"$statusArea/display_percentage_line" => $TRUE,
"$statusArea/red_percentage_line" => [$$batLineRGB[0], 'int'],
"$statusArea/green_percentage_line" => [$$batLineRGB[1], 'int'],
"$statusArea/blue_percentage_line" => [$$batLineRGB[2], 'int'],
"$locks/tklock_double_tap_gesture" => [0, 'int'],
"$display/display_dim_timeout" => [240, 'int'],
"$display/possible_display_dim_timeouts" =>
listInt [15, 30, 60, 120, 180, 240],
"/meegotouch/inputmethods/onscreen/enabled" => $vkbEnabled,
"/meegotouch/inputmethods/onscreen/active" => $vkbActive,
"/apps/clock/clocktype" => ["digital"],
"/meegotouch/i18n/lc_time" => ["en_US"],
"/meegotouch/i18n/lc_timeformat24h" => ["12"],
"/meegotouch/i18n/language" => ["en"],
"/meegotouch/i18n/region" => ["en_US"],
"/meegotouch/i18n/lc_monetary" => ["en_US"],
"/meegotouch/i18n/lc_collate" => ["en_US"],
"/meegotouch/i18n/lc_numeric" => ["en_US"],
);
sub main(@){
die "Usage: $0\n" if @_ > 0;
my @cmds = ();
for my $key(keys %gconf){
my @arr = @{$gconf{$key}};
my $val = shift @arr;
my $type = @arr > 0 ? shift @arr : 'string';
my $listType = @arr > 0 ? shift @arr : undef;
push @cmds, "echo -n \"$key| NEW: $val OLD: \"";
push @cmds, gconfGetCmd($key);
push @cmds, gconfSetCmd($key, $val, $type, $listType);
}
my $cmd = join "\n", @cmds;
print "$cmd\n\n";
system "n9", "-s", $cmd;
}
sub gconfGetCmd($){
return "gconftool-2 --get $_[0]";
}
sub gconfSetCmd($$$$){
my ($key, $val, $type, $listType) = @_;
my $cmd = "gconftool-2 --set '$key' '$val' --type=$type";
if(lc $type eq 'list'){
$cmd .= " --list-type=$listType";
}
return $cmd;
}
sub listInt($){
my @list = @{shift()};
my $val = '[' . (join ',', @list) . ']';
return [$val, 'list', 'int'];
}
sub listString($){
my @list = @{shift()};
my $val = '[' . (join ',', @list) . ']';
return [$val, 'list', 'string'];
}
&main(@ARGV);