-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b18ca37
commit 182fb11
Showing
5 changed files
with
65 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,16 @@ In particular this extension is a graphic interface for [envycontrol](https://gi | |
journalctl -f -o cat /usr/bin/gnome-shell | ||
``` | ||
|
||
### For looking updates using wayland (it opens a new wayland session in a window) | ||
### For debugging using wayland | ||
- To show all messages: | ||
``` | ||
export G_MESSAGES_DEBUG=all | ||
``` | ||
- To set window size: | ||
``` | ||
export MUTTER_DEBUG_DUMMY_MODE_SPECS=1366X768 | ||
``` | ||
- To open a new wayland session in a window: | ||
``` | ||
dbus-run-session -- gnome-shell --nested --wayland | ||
``` | ||
|
@@ -60,6 +69,6 @@ gnome-extensions pack [email protected] \ | |
## TODO | ||
- In "AttachedToBatteryView" change the title by getting it directly from envycontrol. | ||
- Automatically install envycontrol tool during extension installation phase. | ||
- Detect if envycontrol is not installed instead of prompting a restart in anycase. | ||
- Detect if envycontrol is not installed instead of prompting a restart popup in anycase. | ||
- Add a setting for allowing user to choose where to place the extension view between topbar and menu panel. | ||
- Change the big V close the gpu profile with icon. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,36 @@ | ||
import * as Main from 'resource:///org/gnome/shell/ui/main.js'; | ||
import GLib from 'gi:://GLib'; | ||
import St from 'gi://St'; | ||
import GObject from 'gi://GObject'; | ||
import Gio from 'gi://Gio'; | ||
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js'; | ||
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; | ||
import {Utility} from './lib/Utility.js'; | ||
import {TopBarView} from './ui/TopBarView.js'; | ||
import {AttachedToBatteryView} from './ui/AttachedToBatteryView.js'; | ||
import * as Extension from 'resource:///org/gnome/shell/extensions/extension.js'; | ||
|
||
import * as Util from 'resource:///org/gnome/shell/misc/util.js'; | ||
import Clutter from 'gi://Clutter'; | ||
import * as Utility from './lib/Utility.js'; | ||
import * as TopBarView from './ui/TopBarView.js'; | ||
import * as AttachedToBatteryView from './ui/AttachedToBatteryView.js'; | ||
|
||
import * as Extension from 'resource:///org/gnome/shell/extensions/extension.js'; | ||
|
||
export default class GpuSelector extends Extension.Extension { | ||
enable() { | ||
all_settings = this.getSettings('org.gnome.shell.extensions.GPU_profile_selector'); | ||
// if there is no battery, there is no power management panel, so the extension moves to TopBar | ||
if (Utility.isBatteryPlugged() && all_settings.get_boolean("force-topbar-view") !== true) { | ||
this.extensionViewTopbar = false | ||
this.extensionView = AttachedToBatteryView.getAttachedToBatteryView(all_settings); | ||
let all_settings = this.getSettings('org.gnome.shell.extensions.GPU_profile_selector'); | ||
// Deprecated: if there is no battery, there is no power management panel, so the extension moves to TopBar | ||
// if (Utility.isBatteryPlugged() && all_settings.get_boolean("force-topbar-view") !== true) { | ||
if (all_settings.get_boolean("force-topbar-view") !== true) { | ||
// init the indicator object | ||
this._indicator = new AttachedToBatteryView.AttachedToBatteryView(this); | ||
// add the toggle items to indicator | ||
this._indicator.quickSettingsItems.push(new AttachedToBatteryView.AttachedToBatteryToggle(this)); | ||
// Add to status area in quicksettings panel | ||
Main.panel.statusArea.quickSettings.addExternalIndicator(this._indicator); | ||
} else { | ||
this.extensionViewTopbar = true | ||
this.extensionView = new TopBarView.TopBarView(all_settings); | ||
Main.panel.addToStatusArea("GPU_SELECTOR", this.extensionView, 1); | ||
this.extensionView.enable(); | ||
// init the indicator object | ||
this._indicator = new TopBarView.TopBarView(this); | ||
// Add to status area panel | ||
Main.panel.addToStatusArea("GPU_SELECTOR", this._indicator, 1); | ||
} | ||
// enable indicator | ||
this._indicator.enable(); | ||
} | ||
|
||
disable() { | ||
this.extensionView.disable(); | ||
// also topbar popup must be destroyed | ||
if (this.extensionViewTopbar !== null && this.extensionViewTopbar) { | ||
this.extensionViewTopbar = null | ||
this.extensionView.destroy(); | ||
} | ||
this.extensionView = null; | ||
this._indicator.disable(); | ||
this._indicator.destroy(); | ||
this._indicator = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters