mirror of
https://github.com/morgan9e/gnome-shell-extension-freon
synced 2026-04-14 16:34:21 +09:00
fix NVIDIA GPUs label detection, #58
This commit is contained in:
@@ -15,7 +15,8 @@ const NvidiaUtil = new Lang.Class({
|
||||
this._labels = [];
|
||||
if(this._argv){
|
||||
// [0] ushakov-pc:0[gpu:0] (GeForce GTX 770)
|
||||
for each(let line in GLib.spawn_command_line_sync(path + " -q gpus")){
|
||||
let [res, out] = GLib.spawn_command_line_sync(path + " -q gpus")
|
||||
for each(let line in out.toString().split('\n')){
|
||||
let match = /.*\[gpu:[\d]\].*\(([\w\d\ ]+)\).*/.exec(line);
|
||||
if(match){
|
||||
this._labels.push(match[1]);
|
||||
|
||||
Reference in New Issue
Block a user