-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathextension
55 lines (48 loc) · 1.93 KB
/
extension
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
#!/bin/sh -e
# Copyright (c) 2016 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
REQUIRES='x11'
DESCRIPTION='Clipboard synchronization and URL handling with Chromium OS.'
CHROOTBIN='croutonclip croutonnotify croutonurlhandler'
EXTENSION='gcpneefbbnfalgjniomfjknbcgkbijom'
# Check if the extension is installed and add a mark to the preparation script
if [ -z "$TARGETNOINSTALL" ]; then
if [ -d "/home/chronos/user/Extensions/$EXTENSION" ]; then
echo 'EXTENSION_INSTALLED=y'
else
echo 'EXTENSION_INSTALLED=n'
fi
fi
. "${TARGETSDIR:="$PWD"}/common"
### Append to prepare.sh:
install x11-utils xsel
compile websocket ''
# vtmonitor is needed for supporting xorg.
# There are three ways xorg might be installed relative to extension: via a
# dependency before extension, via explicit selection before extension, and via
# explicit selection after extension.
# The first is handled by checking XMETHOD, as the first X11 backend brought in
# (explicit or otherwise) sets XMETHOD permanently. The latter two are handled
# by greping the explicit targets file for xorg.
if [ "$XMETHOD" = 'xorg' ] || grep -q xorg /etc/crouton/targets; then
compile vtmonitor ''
fi
# Use croutonurlhandler as a fallback URL handler
handler='/usr/local/bin/croutonurlhandler'
for link in x-www-browser gnome-www-browser www-browser; do
if ! update-alternatives --query "$link" | grep -q "$handler"; then
update-alternatives --install "/usr/bin/$link" "$link" "$handler" 15
fi
done
if [ "$EXTENSION_INSTALLED" = 'y' ]; then
TIPS="$TIPS
You already have the Chromium OS extension installed, so you're good to go!
"
else
TIPS="$TIPS
You must install the Chromium OS extension for integration with crouton to work.
The extension is available here:
https://chromewebstore.google.com/detail/crouton-integration/gcpneefbbnfalgjniomfjknbcgkbijom
"
fi