-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from jnsgruk/tray-icon-config
feat: add snap config item for tray-icon; disable by default
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# On Fedora $SNAP is under /var and there is some magic to map it to /snap. | ||
# We need to handle that case and reset $SNAP | ||
SNAP="${SNAP//\/var\/lib\/snapd/}" | ||
|
||
tray_icon="$(snapctl get tray-icon)" | ||
if [[ -z "$tray_icon" ]]; then | ||
snapctl set tray-icon=false | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Run the configure hook which sets defaults for any config options | ||
"${SNAP}/snap/hooks/configure" | ||
|
||
# Grab the config options | ||
tray_icon="$(snapctl get tray-icon)" | ||
|
||
# Define an array of command line options | ||
opts=() | ||
|
||
# If the the tray icon is enabled, add to the list of command line args | ||
if [[ "${tray_icon}" == "true" ]]; then | ||
opts+=("--use-tray-icon") | ||
fi | ||
|
||
# Run signal-desktop with the gathered arguments | ||
exec "${SNAP}/opt/Signal/signal-desktop" "--no-sandbox" "${opts[@]}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters