-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-gmail.sh
More file actions
executable file
·31 lines (26 loc) · 856 Bytes
/
Copy pathinstall-gmail.sh
File metadata and controls
executable file
·31 lines (26 loc) · 856 Bytes
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
#!/bin/bash
set -e
# Install Gmail as a Chrome "app-mode" launcher.
# Chrome's --install-system-app flag only works on managed Chromebooks, so on
# Linux we just write a .desktop file that opens Chrome in app mode.
if ! command -v google-chrome &>/dev/null; then
echo "Google Chrome not found. Install it first (./install-chrome.sh)." >&2
exit 1
fi
APP_DIR="$HOME/.local/share/applications"
DESKTOP_FILE="$APP_DIR/gmail.desktop"
URL="https://mail.google.com/mail/u/0/"
mkdir -p "$APP_DIR"
cat > "$DESKTOP_FILE" <<EOF
[Desktop Entry]
Name=Gmail
Comment=Gmail web app
Exec=google-chrome --app=${URL}
Icon=mail-message-new
Type=Application
Categories=Network;Email;
StartupWMClass=chrome-mail.google.com__mail_u_0_-Default
Terminal=false
EOF
update-desktop-database "$APP_DIR" 2>/dev/null || true
echo "Gmail launcher installed at $DESKTOP_FILE"