diff options
author | Aylur <[email protected]> | 2024-09-14 11:59:09 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-14 11:59:09 +0200 |
commit | 45a3118f79970aebb561a31b050c2a63fc202c91 (patch) | |
tree | 5125d930cff745b93d579dc1d0e877af9ae405b4 /docs/libraries/powerprofiles.md | |
parent | e9f9de6ba557de6a553f03de813af0fdbdbec047 (diff) | |
parent | 4d5c7a7b514c7f4f71b2950f051b64c3e3df3008 (diff) |
Merge pull request #9 from tokyob0t/main
Added examples for python and lua to the docs :nerd_face:
Diffstat (limited to 'docs/libraries/powerprofiles.md')
-rw-r--r-- | docs/libraries/powerprofiles.md | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/docs/libraries/powerprofiles.md b/docs/libraries/powerprofiles.md index a722c3d..8571c29 100644 --- a/docs/libraries/powerprofiles.md +++ b/docs/libraries/powerprofiles.md @@ -67,19 +67,27 @@ astal-power-profiles --help :::code-group ```js [<i class="devicon-javascript-plain"></i> JavaScript] -import PowerProfiles from "gi://AstalPowerProfiles"; +import PowerProfiles from "gi://AstalPowerProfiles" const powerprofiles = PowerProfiles.get_default() -console.log(powerprofiles.activeProfile) +print(powerprofiles.activeProfile) ``` ```py [<i class="devicon-python-plain"></i> Python] -# Not yet documented +from gi.repository import AstalPowerProfiles as PowerProfiles + +powerprofiles = PowerProfiles.get_default() + +print(powerprofiles.get_active_profile()) ``` ```lua [<i class="devicon-lua-plain"></i> Lua] --- Not yet documented +local PowerProfiles = require("lgi").require("AstalPowerProfiles") + +local powerprofiles = PowerProfiles.get_default() + +print(powerprofiles.active_profile) ``` ```vala [<i class="devicon-vala-plain"></i> Vala] |