summaryrefslogtreecommitdiff
path: root/utils/kEsetroot.in
blob: d375994790a6f4a0662050b565192f9c0f33e0c2 (plain)
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
100
101
102
103
104
105
106
107
#!@PERL@
#=======================================================================
# kEsetroot  - KDE Esetroot integration for Eterm
#
# Copyright (C) 1999 - 2000  Dax T. Games
#                           (dgames@isoc.net)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#=======================================================================
# Written by Dax Games <dgames@isoc.net>
# Sets root pixmap for Eterm transparency.

$HOME = $ENV{'HOME'};
$KDEDIR = $ENV{'KDEDIR'};
open (in,"$HOME/.kde/share/config/desktop0rc");

while (<in>) {
	if ($_ =~ /^Wallpaper=(.*)/i) {
		if (-e $1) {
			$PixMap = $1
			#system("/usr/bin/Esetroot -display :0 $1");
		}
		elsif (-e "$KDEDIR/share/wallpapers/$1") {
			$PixMap = "$KDEDIR/share/wallpapers/$1"
			#system("/usr/bin/Esetroot -display :0 $KDEDIR/share/wallpapers/$1");		
		}
		else { 
			exit(1);
		}
	}
	elsif ($_ =~ /^WallpaperMode=(.*)/i) {
		$WallpaperMode = uc($1);
		if ($WallpaperMode eq "TILED") {
			$PixMapMode = ""
		}
		elsif ($WallpaperMode eq "CENTRED") {
			$PixMapMode = "-center ";
		}
		elsif ($WallpaperMode eq "SCALED") {
			$PixMapMode = "-scale ";
		}
	}

}
close (in);

system("@BINDIR@/Esetroot $PixMapMode $PixMap");

if (!-e "$HOME/Desktop/Autostart/kEsetroot.kdelnk") {
	print "Do you want to start kEsetroot when KDE starts? y/n [y] ";
	$AutostartYORN = (<>);
	chomp $AutostartYORN;

	if ($AutostartYORN = "" or $AutostartYORN = "Y") {
		open (out, ">$HOME/Desktop/Autostart/kEsetroot.kdelnk");
		print out "\# KDE Config File\n";
		print out "[KDE Desktop Entry]\n";
		print out "Name[fi]=Sovellus\n";
		print out "Comment[C]=Set root pixmap for Eterm transparency\n";
		print out "SwallowTitle=\n";
		print out "SwallowExec=\n";
		print out "Name[ru]=ðÒÉÌÏÖÅÎÉÅ\n";
		print out "BinaryPattern=\n";
		print out "Name[hr]=Program\n";
		print out "Name[sl]=Uporabni¹ki program\n";
		print out "Name[pl]=Aplikacja\n";
		print out "Name=Application\n";
		print out "Name[ca]=Aplicacions\n";
		print out "Name[it]=Applicazione\n";
		print out "Name[da]=Anvendelse\n";
		print out "Name[C]=KDE Esetroot\n";
		print out "MimeType=\n";
		print out "Name[de]=Anwendung\n";
		print out "Name[ja]=¥¢¥×¥ê¥±¡¼¥·¥ç¥ó\n";
		print out "Exec=kEsetroot\n";
		print out "Name[cs]=Aplikace\n";
		print out "Name[sv]=Program\n";
		print out "Icon=kwm.xpm\n";
		print out "TerminalOptions=\n";
		print out "Name[sk]=Aplikácia\n";
		print out "Path=\n";
		print out "Name[pt_BR]=Aplicativo\n";
		print out "Type=Application\n";
		print out "Name[es]=Aplicaciones\n";
		print out "Name[is]=Forrit\n";
		print out "Name[pt]=Aplicação\n";
		print out "Terminal=0\n";
		print out "Name[no]=Applikasjon\n";
		print out "Name[hu]=Applikáció\n";
		print out "Name[ro]=Aplicaþie\n";
		close(out);
	}
}