Skip to content

Commit ab87042

Browse files
ids1024mmstick
authored andcommitted
improv: Use imports.misc.config.PACKAGE_VERSION
Since this exists, it seems better than spawning a subprocess. This should have no impact on behavior (except theoretically being faster).
1 parent f36570f commit ab87042

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const Tags = Me.imports.tags;
5353

5454
const STYLESHEET_PATHS = ['light', 'dark'].map(stylesheet_path);
5555
const STYLESHEETS = STYLESHEET_PATHS.map((path) => Gio.File.new_for_path(path));
56-
const GNOME_VERSION = utils.gnome_version()
56+
const GNOME_VERSION = imports.misc.config.PACKAGE_VERSION;
5757

5858
enum Style { Light, Dark }
5959

src/utils.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ export function async_process_ipc(argv: Array<string>): AsyncIPC | null {
137137
return { stdin, stdout }
138138
}
139139

140-
export function gnome_version(): null | string {
141-
let [,out] = GLib.spawn_command_line_sync("gnome-shell --version");
142-
if (!out) return null;
143-
144-
return imports.byteArray.toString(out).split(' ')[2]
145-
}
146-
147140
export function map_eq<K, V>(map1: Map<K, V>, map2: Map<K, V>) {
148141
if (map1.size !== map2.size) {
149142
return false

0 commit comments

Comments
 (0)