Skip to content

Commit 53e5446

Browse files
Fix xdg-* commands
1 parent fffedc3 commit 53e5446

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.ci/scripts/set_default_linux_apps.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,29 @@
44
# found in the LICENSE file.
55
set -e
66

7+
# Set up a .desktop file pointing to the CIPD-installed Chrome.
8+
LOCAL_DESKTOP_FILE_DIR=~/.local/share/applications
9+
mkdir -p "$LOCAL_DESKTOP_FILE_DIR"
10+
CIPD_CHROME_DESKTOP_FILE=${LOCAL_DESKTOP_FILE_DIR}/cipd-chrome.desktop
11+
cat << EOF > "$CIPD_CHROME_DESKTOP_FILE"
12+
[Desktop Entry]
13+
Version=1.0
14+
Name=Google Chrome
15+
GenericName=Web Browser
16+
Comment=Access the Internet
17+
Exec=$CHROME_EXECUTABLE %U
18+
StartupNotify=true
19+
Terminal=false
20+
Icon=google-chrome
21+
Type=Application
22+
Categories=Network;WebBrowser;
23+
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/file;
24+
EOF
25+
26+
# Enable xdg-* commands to work correctly.
27+
export DESKTOP_SESSION=gnome
28+
29+
# Set Chrome as the default handler for http, https, and file, for url_launcher
30+
# tests that expect handlers for those schemes.
731
xdg-mime default google-chrome.desktop inode/directory
832
xdg-settings set default-web-browser google-chrome.desktop

0 commit comments

Comments
 (0)