Skip to content

Commit

Permalink
gets path from new metadata property
Browse files Browse the repository at this point in the history
  • Loading branch information
MattByName committed Dec 6, 2023
1 parent d3de7d0 commit 7edcdb3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import * as PopupMenu from "resource:///org/gnome/shell/ui/popupMenu.js";
import * as PanelMenu from "resource:///org/gnome/shell/ui/panelMenu.js";
import * as Slider from "resource:///org/gnome/shell/ui/slider.js";

const Me = ExtensionUtils.getCurrentExtension();
let overlay_active = false;
let tinter = null;
let menu = null;
let overlay = null;

Expand All @@ -19,8 +17,6 @@ let overlay_color = {
blue: 20,
alpha: 80,
};
let ExtensionPath;
ExtensionPath = Me.path;
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js";
export default class ColorTinter extends Extension {
/**
Expand Down Expand Up @@ -116,7 +112,7 @@ export default class ColorTinter extends Extension {
loadColor() {
// Load last from json

this._file = Gio.file_new_for_path(`${ExtensionPath}/settings.json`);
this._file = Gio.file_new_for_path(`${this.metadata.path}/settings.json`);
if (this._file.query_exists(null)) {
var flag;
var data;
Expand All @@ -135,7 +131,7 @@ export default class ColorTinter extends Extension {

// Save Color
saveColor() {
this._file = Gio.file_new_for_path(`${ExtensionPath}/settings.json`);
this._file = Gio.file_new_for_path(`${this.metadata.path}/settings.json`);
this._file.replace_contents(
JSON.stringify(overlay_color),
null,
Expand Down Expand Up @@ -178,7 +174,7 @@ const MenuButton = GObject.registerClass(
iconName = "icon_mono.svg";
else iconName = "icon.svg";

icon.gicon = Gio.icon_new_for_string(`${Me.path}/${iconName}`);
icon.gicon = Gio.icon_new_for_string(`${this.metadata.path}/${iconName}`);
icon.set_icon_size(20);
box.add(icon);

Expand Down

0 comments on commit 7edcdb3

Please sign in to comment.