MCPcopy Index your code
hub / github.com/ShadowBlip/PowerStation

github.com/ShadowBlip/PowerStation @v0.8.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.8.1 ↗ · + Follow
290 symbols 388 edges 30 files 75 documented · 26%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PowerStation Logo PowerStation

Discord

About

PowerStation is an open source TDP control and performance daemon for Linux that can be used to control CPU and GPU settings for better performance and battery life. Performance control is done through DBus to provide a UI-agnostic interface to CPU and GPU settings.

Install

You can install with:

make build
sudo make install

If you are using ArchLinux, you can install PowerStation from the AUR:

yay -S powerstation-bin

Then start the service with:

sudo systemctl enable powerstation
sudo systemctl start powerstation

Documentation

XML specifications for all interfaces can be found in bindings/dbus-xml.

Individual interface documentation can be found here:

Usage

When PowerStation is running as a service, you can interact with it over DBus. There are various DBus libraries available for popular programming languages like Python, Rust, C++, etc.

You can also interface with DBus using the busctl command:

busctl tree org.shadowblip.PowerStation
└─ /org
  └─ /org/shadowblip
    └─ /org/shadowblip/Performance
      ├─ /org/shadowblip/Performance/CPU
      │ ├─ /org/shadowblip/Performance/CPU/Core0
      │ ├─ /org/shadowblip/Performance/CPU/Core1
      │ ├─ /org/shadowblip/Performance/CPU/Core10
      │ ├─ /org/shadowblip/Performance/CPU/Core11
      │ ├─ /org/shadowblip/Performance/CPU/Core2
      │ ├─ /org/shadowblip/Performance/CPU/Core3
      │ ├─ /org/shadowblip/Performance/CPU/Core4
      │ ├─ /org/shadowblip/Performance/CPU/Core5
      │ ├─ /org/shadowblip/Performance/CPU/Core6
      │ ├─ /org/shadowblip/Performance/CPU/Core7
      │ ├─ /org/shadowblip/Performance/CPU/Core8
      │ └─ /org/shadowblip/Performance/CPU/Core9
      └─ /org/shadowblip/Performance/GPU
        ├─ /org/shadowblip/Performance/GPU/Card1
        │ └─ /org/shadowblip/Performance/GPU/Card1/HDMI
        │   └─ /org/shadowblip/Performance/GPU/Card1/HDMI/A
        │     └─ /org/shadowblip/Performance/GPU/Card1/HDMI/A/1
        └─ /org/shadowblip/Performance/GPU/Card2
          └─ /org/shadowblip/Performance/GPU/Card2/eDP
            └─ /org/shadowblip/Performance/GPU/Card2/eDP/1
busctl introspect org.shadowblip.PowerStation /org/shadowblip/Performance/GPU/Card2
NAME                                TYPE      SIGNATURE RESULT/VALUE           FLAGS
org.freedesktop.DBus.Introspectable interface -         -                      -
.Introspect                         method    -         s                      -
org.freedesktop.DBus.Peer           interface -         -                      -
.GetMachineId                       method    -         s                      -
.Ping                               method    -         -                      -
org.freedesktop.DBus.Properties     interface -         -                      -
.Get                                method    ss        v                      -
.GetAll                             method    s         a{sv}                  -
.Set                                method    ssv       -                      -
.PropertiesChanged                  signal    sa{sv}as  -                      -
org.shadowblip.GPU.Card             interface -         -                      -
.EnumerateConnectors                method    -         ao                     -
.Class                              property  s         "integrated"           emits-change
.ClassId                            property  s         "030000"               emits-change
.ClockLimitMhzMax                   property  d         -                      emits-change
.ClockLimitMhzMin                   property  d         -                      emits-change
.ClockValueMhzMax                   property  d         -                      emits-change writable
.ClockValueMhzMin                   property  d         -                      emits-change writable
.Device                             property  s         "Renoir"               emits-change
.DeviceId                           property  s         "1636"                 emits-change
.ManualClock                        property  b         false                  emits-change writable
.Name                               property  s         "card2"                emits-change
.Path                               property  s         "/sys/class/drm/card2" emits-change
.RevisionId                         property  s         "c7"                   emits-change
.Subdevice                          property  s         ""                     emits-change
.SubdeviceId                        property  s         "12b5"                 emits-change
.SubvendorId                        property  s         "1462"                 emits-change
.Vendor                             property  s         "AMD"                  emits-change
.VendorId                           property  s         "1002"                 emits-change
org.shadowblip.GPU.Card.TDP         interface -         -                      -
.Boost                              property  d         11                     emits-change writable
.PowerProfile                       property  s         "max-performance"      emits-change writable
.TDP                                property  d         55                     emits-change writable
.ThermalThrottleLimitC              property  d         95                     emits-change writable

Testing

When PowerStation is running, you can test setting properties with:

busctl set-property org.shadowblip.PowerStation /org/shadowblip/Performance/CPU/Core11 org.shadowblip.CPU.Core Online "b" False

License

PowerStation is licensed under THE GNU GPLv3+. See LICENSE for details.

Extension points exported contracts — how you extend this code

HardwareAccess (Interface)
Helper trait to simplify access to hardware information [4 implementers]
src/performance/gpu/tdp.rs
TitleCase (Interface)
(no doc) [1 implementers]
src/main.rs
GPUDevice (Interface)
Represents the data contained in /sys/class/drm/cardX [2 implementers]
src/performance/gpu/interface.rs
TDPDevice (Interface)
(no doc) [4 implementers]
src/performance/gpu/tdp.rs
VecDequeDelta (Interface)
(no doc) [2 implementers]
src/performance/gpu/intel/monitor.rs
IntelMonitorClient (Interface)
(no doc) [1 implementers]
src/performance/gpu/intel/monitor.rs

Core symbols most depended-on inside this repo

is_unsupported_gpu
called by 6
src/performance/gpu/amd/ryzenadj.rs
name
called by 5
src/performance/gpu/amd/amdgpu.rs
path
called by 5
src/performance/gpu/amd/amdgpu.rs
hardware
called by 4
src/performance/gpu/amd/tdp.rs
delta
called by 4
src/performance/gpu/intel/monitor.rs
path
called by 3
src/performance/gpu/intel/intelgpu.rs
has_feature
called by 3
src/performance/cpu/cpu_features.rs
set_fast_ppt_cap
called by 2
src/performance/gpu/amd/hwmon.rs

Shape

Method 248
Class 19
Function 11
Enum 6
Interface 6

Languages

Rust100%

Modules by API surface

src/performance/gpu/dbus/devices.rs37 symbols
src/performance/gpu/dbus/gpu.rs35 symbols
src/performance/gpu/amd/amdgpu.rs25 symbols
src/performance/gpu/intel/intelgpu.rs24 symbols
src/performance/gpu/intel/monitor.rs21 symbols
src/performance/gpu/amd/ryzenadj.rs21 symbols
src/performance/gpu/amd/hwmon.rs19 symbols
src/performance/gpu/dbus/tdp.rs15 symbols
src/performance/cpu/cpu_features.rs15 symbols
src/performance/gpu/intel/tdp.rs12 symbols
src/performance/gpu/amd/tdp.rs12 symbols
src/performance/gpu/platform/hardware.rs11 symbols

For agents

$ claude mcp add PowerStation \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact