Cleaned up the gnome shell extension installer
This commit is contained in:
parent
5cf37496f6
commit
af1fdcca2c
|
@ -113,7 +113,7 @@ class GnomeShellExtension {
|
||||||
final int indexOf = versionOutput.indexOf('.');
|
final int indexOf = versionOutput.indexOf('.');
|
||||||
final int lastIndexOf = versionOutput.lastIndexOf('.');
|
final int lastIndexOf = versionOutput.lastIndexOf('.');
|
||||||
if (indexOf < lastIndexOf) {
|
if (indexOf < lastIndexOf) {
|
||||||
versionOutput = versionOutput.substring(0, lastIndexOf);
|
versionOutput = versionOutput.substring(0, indexOf);
|
||||||
}
|
}
|
||||||
|
|
||||||
String metadata = "{\n" +
|
String metadata = "{\n" +
|
||||||
|
@ -123,7 +123,7 @@ class GnomeShellExtension {
|
||||||
" \"" + versionOutput + "\"\n" +
|
" \"" + versionOutput + "\"\n" +
|
||||||
" ],\n" +
|
" ],\n" +
|
||||||
" \"url\": \"https://github.com/dorkbox/SystemTray\",\n" +
|
" \"url\": \"https://github.com/dorkbox/SystemTray\",\n" +
|
||||||
" \"uuid\": \"SystemTray@dorkbox\",\n" +
|
" \"uuid\": \"" + UID + "\",\n" +
|
||||||
" \"version\": 1\n" +
|
" \"version\": 1\n" +
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
|
@ -145,9 +145,19 @@ class GnomeShellExtension {
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we have to enable us
|
// now we have to enable us
|
||||||
|
// gsettings get org.gnome.shell enabled-extensions (['background-logo@fedorahosted.org'] on fedora 23) different on openSuse
|
||||||
final StringBuilder stringBuilder = new StringBuilder(output);
|
final StringBuilder stringBuilder = new StringBuilder(output);
|
||||||
stringBuilder.delete(0, 4);
|
|
||||||
|
// strip off up to the leading ['
|
||||||
|
final int extensionIndex = output.indexOf("['");
|
||||||
|
if (extensionIndex > 0) {
|
||||||
|
stringBuilder.delete(0, extensionIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove the last ]
|
||||||
stringBuilder.delete(stringBuilder.length() - 2, stringBuilder.length());
|
stringBuilder.delete(stringBuilder.length() - 2, stringBuilder.length());
|
||||||
|
|
||||||
|
// add our extension to the list
|
||||||
if (stringBuilder.length() > 2) {
|
if (stringBuilder.length() > 2) {
|
||||||
stringBuilder.append(", ");
|
stringBuilder.append(", ");
|
||||||
}
|
}
|
||||||
|
@ -155,6 +165,7 @@ class GnomeShellExtension {
|
||||||
.append(UID)
|
.append(UID)
|
||||||
.append("'");
|
.append("'");
|
||||||
|
|
||||||
|
|
||||||
stringBuilder.append("]");
|
stringBuilder.append("]");
|
||||||
|
|
||||||
// gsettings set org.gnome.shell enabled-extensions "['SystemTray@dorkbox']"
|
// gsettings set org.gnome.shell enabled-extensions "['SystemTray@dorkbox']"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user