File: startup

package info (click to toggle)
playonlinux 4.1.1-1
  • links: PTS, VCS
  • area: contrib
  • in suites: wheezy
  • size: 11,208 kB
  • sloc: python: 6,173; sh: 5,358; ansic: 72; makefile: 8
file content (90 lines) | stat: -rwxr-xr-x 2,911 bytes parent folder | download
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
#!/bin/bash

# Copyright (C) 2007-2010 PlayOnLinux Team
# Copyright (C) 2011 Pâris Quentin

# 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 

# This is the startup script

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources" 

install_debfonts () # Debian tweak to avoid downloading Microsoft Fonts
{
	if [ ! -e "$REPERTOIRE/configurations/msfonts_installed" ] && [ ! -e "$REPERTOIRE/configurations/msfonts_deb_installed" ]
	then
		DEBFONTS="/usr/share/fonts/truetype/msttcorefonts"
		if [ ! -d $DEBFONTS ]
		then
			rm $HOME/.PlayOnLinux/fonts/ -r 2> /dev/null
			rm $HOME/.PlayOnLinux/fonts 2> /dev/null
			rm $HOME/.PlayOnLinux/configurations/fonts_installed 2> /dev/null
			rm $HOME/.PlayOnLinux/configurations/msfonts_deb_installed 2> /dev/null
		fi
		if [ -d $DEBFONTS ]
		then
			rm $HOME/.PlayOnLinux/fonts/ -r 2> /dev/null
			rm $HOME/.PlayOnLinux/fonts 2> /dev/null
			rm $HOME/.PlayOnLinux/configurations/fonts_installed 2> /dev/null
			FONTDIR=$HOME/.PlayOnLinux/fonts/
			mkdir -p $FONTDIR
			OLDDIR="$PWD"
			cd $DEBFONTS
			for ttf in *
			do
				ln -s $DEBFONTS/$ttf $FONTDIR/$ttf
			done
			cd $OLDDIR
			touch "$HOME/.PlayOnLinux/configurations/msfonts_deb_installed"
		fi
	fi
}


# POL / POM won't work without that 
construire_repertoire_personnel
# Initialize link between python and bash
touch "$POL_USER_ROOT/configurations/guis/index_$POL_ID"

# Cleaning tmp directory
clean_tmp

### Operations below are background asynchronous tasks

(# Cleanup old gui files
"$PLAYONLINUX/bash/delete_gui_files"

# Plugins
install_plugins

install_debfonts
# First use ?
[ "$(POL_Config_Read FIRST_USE)" = "" ] && bash "$PLAYONLINUX/bash/first_use"
[ "$POL_OS" == "Mac" ] && [ ! -e "/Applications/Utilities/XQuartz.app" ] && [ ! "$OSX_VERSION" = "11" ] && bash "$PLAYONLINUX/bash/first_use"

# Run XQuartz
[ "$POL_OS" = "Mac" ] && POL_Internal_RunXQuartz

if [ "$(POL_Config_Read VDRIVES_LINK_MADE)" = "" ]; then
	POL_Config_Write VDRIVES_LINK_MADE TRUE
	[ -e "$HOME/$APPLICATION_TITLE's virtual drives" ] || ln -s "$POL_USER_ROOT/wineprefix/" "$HOME/$APPLICATION_TITLE's virtual drives"
fi

if [ "$(POL_Config_Read GECKO_INSTALLED)" = "" ]; then
	POL_Config_Write GECKO_INSTALLED TRUE
	bash "$PLAYONLINUX/bash/install_gecko"
fi
) &