Giter Site home page Giter Site logo

gistart / tp_wattmeter Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 7.0 152 KB

Gnome shell extension -- shows battery power consumption of ThinkPad laptops

License: GNU General Public License v3.0

JavaScript 94.95% Shell 5.05%
gnome-shell-extension battery-information

tp_wattmeter's Introduction

tp_wattmeter's People

Contributors

gistart avatar pbirkants avatar timrichardson avatar tsroka avatar yves911 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tp_wattmeter's Issues

Discussion for new feature: show when lap mode is activated

Hi, modern thinkpads enter 'lap mode' when movement of the device is discussed. After a period of no movement, lap mode is deactived. This seems to take about five minutes at the fastest. Lap mode can be triggered with even slight movement, such as moving the laptop while it is on the desk.

When lap mode is activated, thermal throttling is quite severe. I have tested it on a Tigerlake X1 and Yoga; throttling caps CPU temp at 65 C, but in performance mode it should be 95C.

Gnome power settings will show when lap mode is activated, but it is annoying to check.
It's a good for an extension with an indicator, such as tp_wattmeter. It is not related to power consumption, but it is related to ThinkPads.

Would a pull request for this be accepted? Otherwise I will work on a stand-alone extension. I propose to use capital letter L to indicate when lap mode is detected, and nothing if not detected.

Detection of lap mode is done by inspecting /sys/devices/platform/thinkpad_acpi/dytc_lapmode
which has a value of 1 or 0. The polling period of the existing extension will be fine.

Gnome 42 support

Can we hope that this extension would be updated to run on latest LTS of Ubuntu (and upcoming Fedora release)?

Display correct results with multiple batteries

Some Thinkpads (up to T480) have two batteries. E.g. in my T450 the internal battery is BAT0 and the external/replaceable is BAT1. The system always discharges the external first (and while doing so, the power reported by the internal BAT0 will be 0).

One easy way to go around this is taking the maximum power of BAT1 and BAT0 and displaying that. (Or the sum of the two, just in case. )

Usage of indicator.indicators is deprecated

Ubuntu 20.04.1 / Gnome 3.36.3

Usage of indicator.indicators is deprecated for TPIndicator
get indicators@resource:///org/gnome/shell/ui/panelMenu.js:213:25
TPWattMeter@/home/spurlos/.local/share/gnome-shell/extensions/tp_wattmeter@gistart/extension.js:117:9
enable@/home/spurlos/.local/share/gnome-shell/extensions/tp_wattmeter@gistart/extension.js:135:20
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:167:32
_enableAllExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:612:22
_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:611:37
_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:639:18
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
_sync@resource:///org/gnome/shell/ui/sessionMode.js:198:14
popMode@resource:///org/gnome/shell/ui/sessionMode.js:166:14
_continueDeactivate@resource:///org/gnome/shell/ui/screenShield.js:502:30
deactivate/<@resource:///org/gnome/shell/ui/screenShield.js:493:44
finish@resource:///org/gnome/shell/gdm/authPrompt.js:523:13
finish@resource:///org/gnome/shell/ui/unlockDialog.js:867:26
deactivate@resource:///org/gnome/shell/ui/screenShield.js:493:26
ScreenShield/</<@resource:///org/gnome/shell/ui/screenShield.js:110:57
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
_convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:169:19

Only display when running on battery

It would be nice if you could add an option to hide the display when the laptop is not running from battery but from AC. The "0.0W" displayed when running from AC is not too informative, it just adds noise/cruft to the status bar.

Gnome 40.0.0

Hey, your extension is fantastic... but sadly doesn't work on Gnome 40.0.0

Precision of percentage is excessively high

I love the concept of this extension, but in practice it makes the display of my battery percentage take up way too much space because the decimal precision is way too high. One or two decimal points really ought to be enough.

image

I'm using a t450s with Fedora 32, gnome-shell version 3.36.5-1.fc32. Possibly worth noting it has two batteries.

Ubuntu 20.04 / Gnome 3.36.1 "ERROR" (Object without a GType)

JS ERROR: Extension tp_wattmeter@gistart: Error: Tried to construct an object without a GType; are you using GObject.registerClass() when inheriting from a GObject type?
TPIndicator@/home/user/.local/share/gnome-shell/extensions/tp_wattmeter@gistart/extension.js:28:9
TPWattMeter@/home/user/.local/share/gnome-shell/extensions/tp_wattmeter@gistart/extension.js:108:32
enable@/home/user/.local/share/gnome-shell/extensions/tp_wattmeter@gistart/extension.js:131:20
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:166:32
loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:336:26
callback@resource:///org/gnome/shell/ui/extensionDownloader.js:232:39
gotExtensionZipFile/<@resource:///org/gnome/shell/ui/extensionDownloader.js:115:13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.