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 #6767 from jhenstridge/icon-theme-support
wrappers: allow snaps to install icon theme icons
- Loading branch information
Showing
13 changed files
with
490 additions
and
8 deletions.
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
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
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,2 @@ | ||
#!/bin/sh | ||
echo "From test-snapd-icon-theme snap" |
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,5 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Name=Echo | ||
Exec=test-snapd-icon-theme.echo | ||
Icon=snap.test-snapd-icon-theme.foo |
5 changes: 5 additions & 0 deletions
5
...n-theme/meta/gui/icons/hicolor/scalable/apps/snap.test-snapd-icon-theme.foo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 @@ | ||
name: test-snapd-icon-theme | ||
version: 1.0 | ||
|
||
apps: | ||
echo: | ||
command: bin/echo |
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,37 @@ | ||
summary: Parallel installed snaps have non-conflicting icons | ||
|
||
restore: | | ||
snap unset system experimental.parallel-instances | ||
execute: | | ||
#shellcheck source=tests/lib/snaps.sh | ||
. "$TESTSLIB"/snaps.sh | ||
echo "Install a snap providing icons" | ||
install_local test-snapd-icon-theme | ||
echo "Install additional instances of the snap" | ||
snap set system experimental.parallel-instances=true | ||
install_local_as test-snapd-icon-theme test-snapd-icon-theme_longname | ||
install_local_as test-snapd-icon-theme test-snapd-icon-theme_foo | ||
echo "Each instance provides its own icons" | ||
icondir=/var/lib/snapd/desktop/icons/hicolor/scalable/apps | ||
[ -f "$icondir/snap.test-snapd-icon-theme.foo.svg" ] | ||
[ -f "$icondir/snap.test-snapd-icon-theme_longname.foo.svg" ] | ||
[ -f "$icondir/snap.test-snapd-icon-theme_foo.foo.svg" ] | ||
echo "Each instance's desktop file references its own icon" | ||
desktopdir=/var/lib/snapd/desktop/applications | ||
MATCH '^Icon=snap.test-snapd-icon-theme.foo$' < "$desktopdir/test-snapd-icon-theme_echo.desktop" | ||
MATCH '^Icon=snap.test-snapd-icon-theme_longname.foo$' < "$desktopdir/test-snapd-icon-theme+longname_echo.desktop" | ||
MATCH '^Icon=snap.test-snapd-icon-theme_foo.foo$' < "$desktopdir/test-snapd-icon-theme+foo_echo.desktop" | ||
echo "Removing once instance does not remove the other instances' icons" | ||
snap remove test-snapd-icon-theme_foo | ||
[ -f "$icondir/snap.test-snapd-icon-theme.foo.svg" ] | ||
[ -f "$icondir/snap.test-snapd-icon-theme_longname.foo.svg" ] | ||
[ ! -f "$icondir/snap.test-snapd-icon-theme_foo.foo.svg" ] | ||
snap remove test-snapd-icon-theme | ||
[ -f "$icondir/snap.test-snapd-icon-theme_longname.foo.svg" ] |
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,29 @@ | ||
summary: Snaps can install icon theme icons | ||
|
||
execute: | | ||
#shellcheck source=tests/lib/snaps.sh | ||
. "$TESTSLIB"/snaps.sh | ||
echo "Install a snap providing icons" | ||
install_local test-snapd-icon-theme | ||
echo "Icons provided by the snap are installed to a shared location" | ||
iconfile=/var/lib/snapd/desktop/icons/hicolor/scalable/apps/snap.test-snapd-icon-theme.foo.svg | ||
[ -f "$iconfile" ] | ||
MATCH "icon from test-snapd-icon-theme" < "$iconfile" | ||
echo "Desktop files can reference installed icons" | ||
desktopfile=/var/lib/snapd/desktop/applications/test-snapd-icon-theme_echo.desktop | ||
MATCH '^Icon=snap.test-snapd-icon-theme.foo$' < "$desktopfile" | ||
echo "Remove the snap" | ||
snap remove test-snapd-icon-theme | ||
echo "The icon has been removed" | ||
[ ! -f "$iconfile" ] | ||
echo "The empty icon theme subdirectories have also been removed" | ||
[ ! -d /var/lib/snapd/desktop/icons/hicolor ] | ||
echo "But the base icons directory remains" | ||
[ -d /var/lib/snapd/desktop/icons ] |
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
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
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
Oops, something went wrong.