forked from popey/matterhorn-snap
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlauncher
37 lines (29 loc) · 1.02 KB
/
launcher
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
#!/bin/bash
config_file="${XDG_CONFIG_HOME:-$HOME/.config}/$SNAP_NAME/config.ini"
if ! [ -e "$config_file" ]; then
mkdir -p "$(dirname "$config_file")"
cat << EOF > "$config_file"
[mattermost]
#host = matterhorn.yourhost.org
#team = the default team
# Set with: snap run --shell matterhorn -c 'secret-tool store --label="\$SNAP_NAME" \$SNAP_NAME <token>
#tokencmd = secret-tool lookup $SNAP_NAME token
urlOpenCommand = xdg-open
activityNotifyCommand = ${SNAP%/*}/current/app/notification-scripts/notify
showTypingIndicator = True
enableAspell = True
#aspellDictionary = "en"
EOF
echo "A default configuration file has been created at"
echo " $config_file"
echo
echo "Use with your \$EDITOR to customize it"
echo
echo "Call this command to setup an access token:"
echo " snap run --shell matterhorn -c \\"
echo " 'secret-tool store --label=\"\$SNAP_NAME\" \$SNAP_NAME <token>'"
echo
echo "Press any key to run $SNAP_NAME..."
read -n1 foo
fi
exec "$SNAP/app/matterhorn" "${@}"