File: convertrc.pl

package info (click to toggle)
gnomeicu 0.98.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,056 kB
  • ctags: 1,884
  • sloc: ansic: 26,607; sh: 502; makefile: 323; perl: 66
file content (85 lines) | stat: -rwxr-xr-x 1,496 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl

open( FILE, "<$ARGV[0]" ) || die "Cannot open $ARGV[0] for reading\n";

foreach( <FILE> )
{
	chop;
	if( /^\t/ )
	{
		s/\"//g;
		($null, $name, $val) = split( /\t{1,}/ );
		$list{ $name } = $val;
	}
}

close( FILE );

$contacts = "";

foreach( keys %list )
{
	if( /^[0-9\*\~]/ )
	{
		$contacts = join( ",", $contacts, $_, $list{ $_ } );
	}
}

$contacts =~ s/^\,//;

open( FILE, ">$ENV{ 'HOME' }/.gnome/GnomeICU" ) || die "Cannot open $ENV{ 'HOME' }/.gnome/GnomeICU for writing\n";

print FILE << "THE_END"

[Placement]
Dock=Menubar\\\\0,0,0,0

[User]
UIN=$list{'UIN'}
Password=$list{'Password'}
Status=$list{'Status'}
Nickname=$list{'Nickname'}
AwayMessage=$list{'AWAY'}

[Server]
Server=$list{'Server'}
Port=$list{'Port'}

[Window]
Size=$list{'WindowSize'}
Title=$list{'WindowTitle'}

[Toggles]
Sound=$list{'Sound'}
Beep=$list{'Beep'}
PacketDump=$list{'PacketDump'}
Force=$list{'Force'}

[Color]
Online=$list{'Online'}
Offline=$list{'Offline'}
Away=$list{'Away'}
NotAvailable=$list{'Not Available'}
FreeForChat=$list{'Free for Chat'}
Occupied=$list{'Occupied'}
DoNotDisturb=$list{'Do Not Disturb'}
Invisible=$list{'Invisible'}

[Sound]
UserOnline=$list{'UserOnline'}
UserOffline=$list{'UserOffline'}
RecvMessage=$list{'RecvMessage'}
RecvChat=$list{'RecvChat'}

[SoundFiles]
UserOnline=$list{'UserOnlineSound'}
UserOffline=$list{'UserOfflineSound'}
RecvMessage=$list{'RecvMessageSound'}
RecvChat=$list{'RecvChatSound'}

[Contacts]
Contacts=$contacts

[Existence]
exists=1
THE_END