🎉 Add option to disable effects if on battery power

This commit is contained in:
Simon Schneegans
2022-05-25 12:59:03 +02:00
parent 8dc73ff9f6
commit b215379dac
7 changed files with 114 additions and 6 deletions
+9 -1
View File
@@ -13,7 +13,8 @@
'use strict';
const {Gtk} = imports.gi;
const {Gtk, Gio} = imports.gi;
const ByteArray = imports.byteArray;
// Returns the given argument, except for "alpha", "beta", and "rc". In these cases -3,
// -2, and -1 are returned respectively.
@@ -83,4 +84,11 @@ function shellVersionIsAtLeast(major, minor) {
}
return false;
}
// Reads the contents of a file contained in the global resources archive. The data
// is returned as a string.
function getStringResource(path) {
const data = Gio.resources_lookup_data(path, 0);
return ByteArray.toString(ByteArray.fromGBytes(data));
}