├── .gitignore
├── icon.png
├── example.png
├── .prettierrc.json
├── .editorconfig
├── Makefile
├── metadata.json
├── schemas
└── org.gnome.shell.extensions.autohide-battery.gschema.xml
├── README.md
├── po
├── autohide-battery.pot
├── ko.po
├── ja.po
├── zh_Hans.po
├── nb_NO.po
├── ru.po
├── ckb.po
├── ca.po
├── tr.po
├── ota.po
├── hi.po
├── nl.po
├── es.po
├── gl.po
├── ta.po
├── id.po
├── lt.po
├── uk.po
├── de.po
├── be.po
├── fr.po
└── pl.po
├── LICENSE
├── .github
└── workflows
│ └── release.yml
├── prefs.js
├── extension.js
└── CHANGELOG.md
/.gitignore:
--------------------------------------------------------------------------------
1 | *.zip
2 | node_modules
3 |
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ai/autohide-battery/HEAD/icon.png
--------------------------------------------------------------------------------
/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ai/autohide-battery/HEAD/example.png
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "arrowParens": "avoid",
3 | "jsxSingleQuote": false,
4 | "quoteProps": "consistent",
5 | "semi": false,
6 | "singleQuote": true,
7 | "trailingComma": "none"
8 | }
9 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [Makefile]
12 | indent_style = tab
13 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: test clean build local
2 |
3 | test: build
4 |
5 | clean:
6 | rm -f *.zip
7 |
8 | build: clean
9 | gnome-extensions pack ./
10 |
11 | local: build
12 | gnome-extensions install -f *.zip
13 |
14 | debug: local
15 | dbus-run-session -- gnome-shell --nested --wayland
16 |
--------------------------------------------------------------------------------
/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Autohide Battery",
3 | "description": "Hide battery icon in top panel, if battery is fully charged and AC is connected",
4 | "url": "https://github.com/ai/autohide-battery",
5 | "uuid": "autohide-battery@sitnik.ru",
6 | "shell-version": ["45", "46", "47", "48", "49"],
7 | "settings-schema": "org.gnome.shell.extensions.autohide-battery",
8 | "gettext-domain": "autohide-battery",
9 | "donations": {
10 | "github": "ai"
11 | },
12 | "version": 58
13 | }
14 |
--------------------------------------------------------------------------------
/schemas/org.gnome.shell.extensions.autohide-battery.gschema.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Minimum battery level to hide icon
6 | 100
7 |
8 |
9 | Hide icon on any battery state
10 | false
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Autohide Battery
2 |
3 |
4 |
5 | GNOME Shell extension to hide battery icon, if battery is fully charged
6 | and AC is connected.
7 |
8 | [
](https://extensions.gnome.org/extension/595/autohide-battery/)
9 |
10 | See also [Hide Keyboard Layout].
11 |
12 | [Hide Keyboard Layout]: https://github.com/ai/hide-keyboard-layout
13 |
14 |
15 | ## Install
16 |
17 | 1. Open [Autohide Battery] on GNOME Shell Extensions site.
18 | 2. Click slider to install extension.
19 |
20 | [Autohide Battery]: https://extensions.gnome.org/extension/595/autohide-battery/
21 |
22 |
23 | ## Translations
24 |
25 | You can help us translating extension settings to your language.
26 |
27 | [Translate on Weblate](https://hosted.weblate.org/engage/autohide-battery/)
28 |
--------------------------------------------------------------------------------
/po/autohide-battery.pot:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | #, fuzzy
7 | msgid ""
8 | msgstr ""
9 | "Project-Id-Version: PACKAGE VERSION\n"
10 | "Report-Msgid-Bugs-To: \n"
11 | "POT-Creation-Date: 2024-06-01 21:16+0200\n"
12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 | "Last-Translator: FULL NAME \n"
14 | "Language-Team: LANGUAGE \n"
15 | "Language: \n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=CHARSET\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 |
20 | #: prefs.js:27
21 | msgid "If you changed maximum charging level to extend battery life"
22 | msgstr ""
23 |
24 | #: prefs.js:29
25 | msgid "Hide on battery level above"
26 | msgstr ""
27 |
28 | #: prefs.js:43
29 | msgid "For laptops often jumping between charging and discharging"
30 | msgstr ""
31 |
32 | #: prefs.js:45
33 | msgid "Hide battery even on discharge if the level is above"
34 | msgstr ""
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright 2013 Andrey Sitnik
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/po/ko.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2022-10-04 14:15+0000\n"
12 | "Last-Translator: Hoseok Seo \n"
13 | "Language-Team: Korean \n"
15 | "Language: ko\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=1; plural=0;\n"
20 | "X-Generator: Weblate 4.14.1\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "배터리 수명을 연장하기 위해 최대 충전 잔량을 변경한 경우"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "지정된 배터리 잔량 이상 숨기기"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr ""
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr ""
37 |
--------------------------------------------------------------------------------
/po/ja.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2021-08-31 11:04+0000\n"
12 | "Last-Translator: Andrey Sitnik \n"
13 | "Language-Team: Japanese \n"
15 | "Language: ja\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=1; plural=0;\n"
20 | "X-Generator: Weblate 4.8.1-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "バッテリーの寿命を延ばすために最大充電量を変更した場合"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "バッテリー残量が________以上で非表示"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr ""
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr ""
37 |
--------------------------------------------------------------------------------
/po/zh_Hans.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2024-08-11 10:09+0000\n"
12 | "Last-Translator: 杨鹏 <596382932@qq.com>\n"
13 | "Language-Team: Chinese (Simplified) \n"
15 | "Language: zh_Hans\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=1; plural=0;\n"
20 | "X-Generator: Weblate 5.7-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "如果改变上限,可延长电池寿命"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "限制电量上限"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr "适用于笔记本电脑充电和放电切换"
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr "如果电量高于设置值即使在放电也隐藏电量"
37 |
--------------------------------------------------------------------------------
/po/nb_NO.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2021-08-29 14:09+0000\n"
12 | "Last-Translator: Allan Nordhøy \n"
13 | "Language-Team: Norwegian Bokmål \n"
15 | "Language: nb_NO\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 4.8.1-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "Hvis du endret maksimal ladningsnivå for å utvide batterilevetiden"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "Skjul på batterinivå over"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr ""
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr ""
37 |
--------------------------------------------------------------------------------
/po/ru.po:
--------------------------------------------------------------------------------
1 | # Russian translations for autohide-battery package.
2 | # This file is distributed under the same license
3 | # as the autohide-battery package.
4 | #
5 | msgid ""
6 | msgstr ""
7 | "Project-Id-Version: PACKAGE VERSION\n"
8 | "Report-Msgid-Bugs-To: \n"
9 | "POT-Creation-Date: 2020-04-05 17:59-0400\n"
10 | "PO-Revision-Date: 2020-04-05 16:47-0400\n"
11 | "Last-Translator: Andrey Sitnik \n"
12 | "Language-Team: none\n"
13 | "Language: ru\n"
14 | "MIME-Version: 1.0\n"
15 | "Content-Type: text/plain; charset=UTF-8\n"
16 | "Content-Transfer-Encoding: 8bit\n"
17 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
18 | "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
19 |
20 | #: prefs.js:27
21 | msgid "If you changed maximum charging level to extend battery life"
22 | msgstr "Если вы ограничили уровень заряда для продления срока службы батареи"
23 |
24 | #: prefs.js:29
25 | msgid "Hide on battery level above"
26 | msgstr "Скрывать иконку при заряде больше"
27 |
28 | #: prefs.js:43
29 | msgid "For laptops often jumping between charging and discharging"
30 | msgstr "Если ноутбук часто переключается между зарядкой и разрядкой"
31 |
32 | #: prefs.js:45
33 | msgid "Hide battery even on discharge if the level is above"
34 | msgstr "Скрывать даже при разряде если заряд больше"
35 |
36 |
--------------------------------------------------------------------------------
/po/ckb.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2023-11-08 00:38+0000\n"
12 | "Last-Translator: Salam Muhammad \n"
13 | "Language-Team: Kurdish (Central) \n"
15 | "Language: ckb\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.2-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "ئەگەر زۆرترین ئاستی شەحنکردنەوەت گۆڕی بۆ درێژکردنەوەی تەمەنی پاتری"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "شاردنەوە لەسەر ئاستی باتری زیاتر لە"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr ""
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr ""
37 |
--------------------------------------------------------------------------------
/po/ca.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2022-04-20 23:08+0000\n"
12 | "Last-Translator: Maite Guix \n"
13 | "Language-Team: Catalan \n"
15 | "Language: ca\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 4.12-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr ""
25 | "Si has canviat el nivell de càrrega màxim per a allargar la durada de la "
26 | "bateria"
27 |
28 | #: prefs.js:29
29 | msgid "Hide on battery level above"
30 | msgstr "Amagar el nivell de bateria de dalt"
31 |
32 | #: prefs.js:43
33 | msgid "For laptops often jumping between charging and discharging"
34 | msgstr ""
35 |
36 | #: prefs.js:45
37 | msgid "Hide battery even on discharge if the level is above"
38 | msgstr ""
39 |
--------------------------------------------------------------------------------
/po/tr.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2024-06-17 12:09+0000\n"
12 | "Last-Translator: Sabri Ünal \n"
13 | "Language-Team: Turkish \n"
15 | "Language: tr\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.6-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "Pil ömrünü uzatmak için azami şarj düzeyini değiştirdiyseniz"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "Yukarıdaki pil düzeyini gizle"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr "Sık sık şarjdan çekilendizüstü bilgisayarlar için"
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr "Düzey yukarıda ise bil boşalırken bile pili sakla"
37 |
--------------------------------------------------------------------------------
/po/ota.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2024-06-01 21:16+0200\n"
11 | "PO-Revision-Date: 2025-10-30 11:02+0000\n"
12 | "Last-Translator: bgo-eiu \n"
13 | "Language-Team: Turkish (Ottoman) \n"
15 | "Language: ota\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.14.1-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "پیل عمرینی اوزاتمق ایچین اعظمی شارژ دوزەیینی دگیشدردییسەڭز"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "یوقاریدەكی پیل دوزەیینی گیزلە"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr "صیق صیق شارژدن چكیلەندیزیستی بیلگیصایرلر ایچین"
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr "دوزەی یوقاریدە ایسە بیل بوشالیركن بیلە پیلی صاقلا"
37 |
--------------------------------------------------------------------------------
/po/hi.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2024-06-03 14:09+0000\n"
12 | "Last-Translator: Scrambled777 \n"
13 | "Language-Team: Hindi \n"
15 | "Language: hi\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n > 1;\n"
20 | "X-Generator: Weblate 5.6-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "यदि आपने बैटरी जीवन बढ़ाने के लिए अधिकतम चार्जिंग स्तर बदल दिया है"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "बैटरी स्तर के ऊपर छुपाएं"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr "लैपटॉप जो अक्सर चार्जिंग और डिस्चार्ज होते रहते है"
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr "यदि स्तर ऊपर है तो डिस्चार्ज होने पर भी बैटरी छिपाएं"
37 |
--------------------------------------------------------------------------------
/po/nl.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: \n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2024-07-07 20:09+0000\n"
12 | "Last-Translator: Heimen Stoffels \n"
13 | "Language-Team: Dutch \n"
15 | "Language: nl\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.7-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "Als u het maximale oplaadniveau heeft gewijzigd om de accuduur te verlengen"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "Verbergen als bovenstaand oplaadniveau bereikt is"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr "Voor laptops die regelmatig verspringen van op- naar ontladen"
33 |
34 | #: prefs.js:45
35 | msgid "Hide battery even on discharge if the level is above"
36 | msgstr "Oplaadniveau verbergen tijdens ontladen als het niveau hoger is dan"
37 |
--------------------------------------------------------------------------------
/po/es.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2025-04-30 17:49+0000\n"
12 | "Last-Translator: xuars \n"
13 | "Language-Team: Spanish \n"
15 | "Language: es\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.12-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr ""
25 | "Si has cambiado el nivel máximo de carga para alargar la vida de la batería"
26 |
27 | #: prefs.js:29
28 | msgid "Hide on battery level above"
29 | msgstr "Ocultar en el nivel de batería superior a"
30 |
31 | #: prefs.js:43
32 | msgid "For laptops often jumping between charging and discharging"
33 | msgstr "Para portátiles que cambian frecuentemente entre carga y descarga"
34 |
35 | #: prefs.js:45
36 | msgid "Hide battery even on discharge if the level is above"
37 | msgstr "Ocultar la batería incluso al descargarse si la carga es mayor"
38 |
--------------------------------------------------------------------------------
/po/gl.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2024-06-01 21:16+0200\n"
11 | "PO-Revision-Date: 2025-04-30 17:49+0000\n"
12 | "Last-Translator: xuars \n"
13 | "Language-Team: Galician \n"
15 | "Language: gl\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.12-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr ""
25 | "Se cambiaches o nivel máximo de carga para extender a vida útil da batería"
26 |
27 | #: prefs.js:29
28 | msgid "Hide on battery level above"
29 | msgstr "Ocultar no nivel de batería superior a"
30 |
31 | #: prefs.js:43
32 | msgid "For laptops often jumping between charging and discharging"
33 | msgstr "Para portátiles que frecuentemente cambian entre cargarse e descargarse"
34 |
35 | #: prefs.js:45
36 | msgid "Hide battery even on discharge if the level is above"
37 | msgstr "Ocultar batería incluso en descarga se o nivel é superior a"
38 |
--------------------------------------------------------------------------------
/po/ta.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2024-06-01 21:16+0200\n"
11 | "PO-Revision-Date: 2024-12-05 16:53+0000\n"
12 | "Last-Translator: தமிழ்நேரம் \n"
13 | "Language-Team: Tamil \n"
15 | "Language: ta\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.9-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr "பேட்டரி ஆயுளை நீட்டிக்க அதிகபட்ச சார்சிங் அளவை மாற்றினால்"
25 |
26 | #: prefs.js:29
27 | msgid "Hide on battery level above"
28 | msgstr "மேலே பேட்டரி மட்டத்தில் மறைக்கவும்"
29 |
30 | #: prefs.js:43
31 | msgid "For laptops often jumping between charging and discharging"
32 | msgstr ""
33 | "மடிக்கணினிகளுக்கு பெரும்பாலும் சார்ச் செய்வதற்கும் வெளியேற்றுவதற்கும் இடையில் குதிக்கிறது"
34 |
35 | #: prefs.js:45
36 | msgid "Hide battery even on discharge if the level is above"
37 | msgstr "நிலை மேலே இருந்தால் கூட வெளியேற்றத்தில் கூட பேட்டரியை மறைக்கவும்"
38 |
--------------------------------------------------------------------------------
/po/id.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2024-12-30 14:00+0000\n"
12 | "Last-Translator: Reza Almanda \n"
13 | "Language-Team: Indonesian \n"
15 | "Language: id\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=1; plural=0;\n"
20 | "X-Generator: Weblate 5.10-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr ""
25 | "Jika Anda mengubah tingkat pengisian daya maksimum untuk memperpanjang masa "
26 | "pakai baterai"
27 |
28 | #: prefs.js:29
29 | msgid "Hide on battery level above"
30 | msgstr "Sembunyikan pada level baterai di atas"
31 |
32 | #: prefs.js:43
33 | msgid "For laptops often jumping between charging and discharging"
34 | msgstr ""
35 | "Untuk laptop yang sering berpindah-pindah antara pengisian daya dan pemakaian"
36 |
37 | #: prefs.js:45
38 | msgid "Hide battery even on discharge if the level is above"
39 | msgstr "Sembunyikan baterai bahkan saat pengosongan jika levelnya di atas"
40 |
--------------------------------------------------------------------------------
/po/lt.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2021-08-29 14:09+0000\n"
12 | "Last-Translator: Gediminas Murauskas \n"
13 | "Language-Team: Lithuanian \n"
15 | "Language: lt\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=3; plural=(n % 10 == 1 && (n % 100 < 11 || n % 100 > "
20 | "19)) ? 0 : ((n % 10 >= 2 && n % 10 <= 9 && (n % 100 < 11 || n % 100 > 19)) ? "
21 | "1 : 2);\n"
22 | "X-Generator: Weblate 4.8.1-dev\n"
23 |
24 | #: prefs.js:27
25 | msgid "If you changed maximum charging level to extend battery life"
26 | msgstr ""
27 | "Jei esate pakeitę maksimalų įkrovimo lygį, kad prailgėtumėte baterijos "
28 | "tarnavimo laiką"
29 |
30 | #: prefs.js:29
31 | msgid "Hide on battery level above"
32 | msgstr "Paslėpti pasiekus didesnę baterijos įkrovą nei"
33 |
34 | #: prefs.js:43
35 | msgid "For laptops often jumping between charging and discharging"
36 | msgstr ""
37 |
38 | #: prefs.js:45
39 | msgid "Hide battery even on discharge if the level is above"
40 | msgstr ""
41 |
--------------------------------------------------------------------------------
/po/uk.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2024-12-17 13:00+0000\n"
12 | "Last-Translator: Максим Горпиніч \n"
13 | "Language-Team: Ukrainian \n"
15 | "Language: uk\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20 | "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
21 | "X-Generator: Weblate 5.9\n"
22 |
23 | #: prefs.js:27
24 | msgid "If you changed maximum charging level to extend battery life"
25 | msgstr "Якщо ви обмежили рівень заряду для продовження терміну служби батареї"
26 |
27 | #: prefs.js:29
28 | msgid "Hide on battery level above"
29 | msgstr "Приховувати іконку при заряді більше"
30 |
31 | #: prefs.js:43
32 | msgid "For laptops often jumping between charging and discharging"
33 | msgstr "Для ноутбуків часто скачуть між зарядкою та розрядкою"
34 |
35 | #: prefs.js:45
36 | msgid "Hide battery even on discharge if the level is above"
37 | msgstr "Приховати батарею навіть при розрядці, якщо рівень вище"
38 |
--------------------------------------------------------------------------------
/po/de.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2025-07-01 13:08+0000\n"
12 | "Last-Translator: Kachelkaiser \n"
13 | "Language-Team: German \n"
15 | "Language: de\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n != 1;\n"
20 | "X-Generator: Weblate 5.13-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr ""
25 | "Falls Sie den Ladezustand begrenzt haben, um die Batterielebensdauer zu "
26 | "verlängern"
27 |
28 | #: prefs.js:29
29 | msgid "Hide on battery level above"
30 | msgstr "Ausblenden bei Batteriestand über"
31 |
32 | #: prefs.js:43
33 | msgid "For laptops often jumping between charging and discharging"
34 | msgstr ""
35 | "Für Laptops, die häufig zwischen Aufladen und Entladung (Stromverbrauch) "
36 | "wechseln"
37 |
38 | #: prefs.js:45
39 | msgid "Hide battery even on discharge if the level is above"
40 | msgstr ""
41 | "Auch beim Entladen den Akku verstecken, solange die Akkuladung höher ist als"
42 |
--------------------------------------------------------------------------------
/po/be.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2025-07-20 11:02+0000\n"
12 | "Last-Translator: Sasha Glazko \n"
13 | "Language-Team: Belarusian \n"
15 | "Language: be\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20 | "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
21 | "X-Generator: Weblate 5.13-dev\n"
22 |
23 | #: prefs.js:27
24 | msgid "If you changed maximum charging level to extend battery life"
25 | msgstr ""
26 | "Калі вы абмежавалі ўзровень зарада для падаўжэння тэрміну службы батарэі"
27 |
28 | #: prefs.js:29
29 | msgid "Hide on battery level above"
30 | msgstr "Схаваць значок пры зарадзе больш за"
31 |
32 | #: prefs.js:43
33 | msgid "For laptops often jumping between charging and discharging"
34 | msgstr "Для ноўтбукаў, якія часта пераходзяць з зарадкі на разрадку"
35 |
36 | #: prefs.js:45
37 | msgid "Hide battery even on discharge if the level is above"
38 | msgstr "Схаваць значок нават пры разрадцы пры зарадзе больш за"
39 |
--------------------------------------------------------------------------------
/po/fr.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2025-12-17 06:00+0000\n"
12 | "Last-Translator: Antoine \n"
13 | "Language-Team: French \n"
15 | "Language: fr\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=2; plural=n > 1;\n"
20 | "X-Generator: Weblate 5.15.1-dev\n"
21 |
22 | #: prefs.js:27
23 | msgid "If you changed maximum charging level to extend battery life"
24 | msgstr ""
25 | "Si vous avez modifié le niveau de charge maximal pour prolonger la durée de "
26 | "vie de la batterie"
27 |
28 | #: prefs.js:29
29 | msgid "Hide on battery level above"
30 | msgstr "Masquer le niveau de la batterie au-dessus"
31 |
32 | #: prefs.js:43
33 | msgid "For laptops often jumping between charging and discharging"
34 | msgstr ""
35 | "Pour les ordinateurs portables qui passe par intermittence de chargement à "
36 | "déchargement"
37 |
38 | #: prefs.js:45
39 | msgid "Hide battery even on discharge if the level is above"
40 | msgstr ""
41 | "Cacher la batterie, même lors de la décharge, si le niveau est au dessus"
42 |
--------------------------------------------------------------------------------
/po/pl.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: PACKAGE VERSION\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2020-04-05 18:11-0400\n"
11 | "PO-Revision-Date: 2024-06-03 14:09+0000\n"
12 | "Last-Translator: Eryk Michalak \n"
13 | "Language-Team: Polish \n"
15 | "Language: pl\n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=UTF-8\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
20 | "|| n%100>=20) ? 1 : 2);\n"
21 | "X-Generator: Weblate 5.6-dev\n"
22 |
23 | #: prefs.js:27
24 | msgid "If you changed maximum charging level to extend battery life"
25 | msgstr ""
26 | "Jeśli zmieniono maksymalny poziom naładowania w celu wydłużenia żywotności "
27 | "baterii"
28 |
29 | #: prefs.js:29
30 | msgid "Hide on battery level above"
31 | msgstr "Ukryj przy poziomie naładowania baterii powyżej"
32 |
33 | #: prefs.js:43
34 | msgid "For laptops often jumping between charging and discharging"
35 | msgstr "Dla laptopów często podłączanych i odłączanych od ładowania"
36 |
37 | #: prefs.js:45
38 | msgid "Hide battery even on discharge if the level is above"
39 | msgstr ""
40 | "Ukryj poziom naładowania baterii nawet podczas rozładowywania nawet gdy jego "
41 | "poziom jest powyżej"
42 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | tags:
5 | - '*'
6 | permissions:
7 | contents: write
8 | jobs:
9 | release:
10 | name: Release On Tag
11 | if: startsWith(github.ref, 'refs/tags/')
12 | runs-on: ubuntu-latest
13 | steps:
14 | - name: Checkout the repository
15 | uses: actions/checkout@v4
16 | - name: Extract the changelog
17 | id: changelog
18 | run: |
19 | TAG_NAME=${GITHUB_REF/refs\/tags\//}
20 | READ_SECTION=false
21 | CHANGELOG=""
22 | while IFS= read -r line; do
23 | if [[ "$line" =~ ^#+\ +(.*) ]]; then
24 | if [[ "${BASH_REMATCH[1]}" == "$TAG_NAME" ]]; then
25 | READ_SECTION=true
26 | elif [[ "$READ_SECTION" == true ]]; then
27 | break
28 | fi
29 | elif [[ "$READ_SECTION" == true ]]; then
30 | CHANGELOG+="$line"$'\n'
31 | fi
32 | done < "CHANGELOG.md"
33 | CHANGELOG=$(echo "$CHANGELOG" | awk '/./ {$1=$1;print}')
34 | echo "changelog_content<> $GITHUB_OUTPUT
35 | echo "$CHANGELOG" >> $GITHUB_OUTPUT
36 | echo "EOF" >> $GITHUB_OUTPUT
37 | - name: Create the release
38 | if: steps.changelog.outputs.changelog_content != ''
39 | uses: softprops/action-gh-release@v1
40 | with:
41 | name: ${{ github.ref_name }}
42 | body: '${{ steps.changelog.outputs.changelog_content }}'
43 | draft: false
44 | prerelease: false
45 |
--------------------------------------------------------------------------------
/prefs.js:
--------------------------------------------------------------------------------
1 | import Adw from 'gi://Adw'
2 | import Gtk from 'gi://Gtk'
3 | import {
4 | gettext as _,
5 | ExtensionPreferences
6 | } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'
7 |
8 | export default class AutohideBatteryPreferences extends ExtensionPreferences {
9 | fillPreferencesWindow(window) {
10 | let settings = this.getSettings()
11 | window._settings = settings
12 |
13 | let page = new Adw.PreferencesPage()
14 | window.add(page)
15 |
16 | let group = new Adw.PreferencesGroup()
17 | page.add(group)
18 |
19 | let level = new Adw.SpinRow({
20 | adjustment: new Gtk.Adjustment({
21 | 'lower': 0,
22 | 'step-increment': 1,
23 | 'upper': 100,
24 | 'value': settings.get_int('hide-on')
25 | }),
26 | subtitle: _(
27 | 'If you changed maximum charging level to extend battery life'
28 | ),
29 | title: _('Hide on battery level above')
30 | })
31 | group.add(level)
32 |
33 | level.connect('changed', () => {
34 | settings.set_int('hide-on', level.get_value())
35 | })
36 | settings.connect('changed::hide-on', () => {
37 | level.set_value(settings.get_int('hide-on'))
38 | })
39 |
40 | let always = new Adw.SwitchRow({
41 | active: settings.get_boolean('hide-always'),
42 | subtitle: _(
43 | 'For laptops often jumping between charging and discharging'
44 | ),
45 | title: _('Hide battery even on discharge if the level is above')
46 | })
47 | group.add(always)
48 |
49 | always.connect('notify::active', () => {
50 | settings.set_boolean('hide-always', always.get_active())
51 | })
52 | settings.connect('changed::hide-always', () => {
53 | always.set_active(settings.get_boolean('hide-always'))
54 | })
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/extension.js:
--------------------------------------------------------------------------------
1 | import GLib from 'gi://GLib'
2 | import UPower from 'gi://UPowerGlib'
3 | import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js'
4 | import { panel } from 'resource:///org/gnome/shell/ui/main.js'
5 |
6 | export default class AutohideBatteryExtension extends Extension {
7 | #batteryWatching = null
8 |
9 | #initTimeout = null
10 |
11 | #settings = null
12 |
13 | #settingsWatching = null
14 |
15 | disable() {
16 | if (this.#settings) {
17 | this.#settings.disconnect(this.#settingsWatching)
18 | this.#settings = null
19 | }
20 |
21 | if (this.#initTimeout) {
22 | GLib.Source.remove(this.#initTimeout)
23 | this.#initTimeout = null
24 | }
25 |
26 | this.#getBattery(proxy => {
27 | proxy.disconnect(this.#batteryWatching)
28 | })
29 |
30 | this.#show()
31 | }
32 |
33 | enable() {
34 | this.#settings = this.getSettings()
35 | this.#settingsWatching = this.#settings.connect('changed::hide-on', () => {
36 | this.#update()
37 | })
38 |
39 | this.#getBattery(proxy => {
40 | this.#batteryWatching = proxy.connect('g-properties-changed', () => {
41 | this.#update()
42 | })
43 | })
44 |
45 | this.#update()
46 | this.#initTimeout = GLib.timeout_add_seconds(
47 | GLib.PRIORITY_DEFAULT,
48 | 1,
49 | () => {
50 | this.#update()
51 | return GLib.SOURCE_CONTINUE
52 | }
53 | )
54 | }
55 |
56 | #getBattery(callback) {
57 | let system = panel.statusArea.quickSettings._system
58 | if (system && system._systemItem._powerToggle) {
59 | callback(system._systemItem._powerToggle._proxy, system)
60 | }
61 | }
62 |
63 | #hide() {
64 | this.#getBattery((proxy, icon) => {
65 | icon.hide()
66 | })
67 | }
68 |
69 | #show() {
70 | this.#getBattery((proxy, icon) => {
71 | icon.show()
72 | })
73 | }
74 |
75 | #update() {
76 | let hideOn = this.#settings.get_int('hide-on')
77 | let hideAlways = this.#settings.get_boolean('hide-always')
78 |
79 | this.#getBattery(proxy => {
80 | let isPendingCharge = proxy.State === UPower.DeviceState.PENDING_CHARGE
81 | let isFullyCharged = proxy.State === UPower.DeviceState.FULLY_CHARGED
82 | let isDischarging = proxy.State === UPower.DeviceState.DISCHARGING
83 |
84 | if (proxy.Type !== UPower.DeviceKind.BATTERY) {
85 | this.#show()
86 | } else if ((hideAlways || !isDischarging) && proxy.Percentage >= hideOn) {
87 | this.#hide()
88 | } else if (isFullyCharged || isPendingCharge) {
89 | this.#hide()
90 | } else {
91 | this.#show()
92 | }
93 | })
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | ## 58
4 | * Added GNOME 49 support (by Nathaniel Russell).
5 | * Fixed German translation.
6 | * Fixed Belarusian translation.
7 |
8 | ## 57
9 | * Added Galician translation (by xuars).
10 | * Fixed Spanish translation (by xuars).
11 |
12 | ## 56
13 | * Added GNOME 48 support (by Nathaniel Russell).
14 | * Added Indonesian translation (by Reza Almanda).
15 |
16 | ## 55
17 | * Updated Ukrainian translation (by Maxim Gorpinic).
18 |
19 | ## 54
20 | * Added Tamil translation (by தமிழ்நேரம்).
21 |
22 | ## 53
23 | * Updated Simplified Chinese translation (by 杨鹏).
24 |
25 | ## 52
26 | * Updated Turkish translation (by Sabri Ünal).
27 | * Updated Dutch translation (by Heimen Stoffels).
28 |
29 | ## 51
30 | * Updated German translation (by Lacey Anaya).
31 |
32 | ## 50
33 | * Updated Spanish translation (by gallegonovato).
34 | * Updated Polish translation (by Eryk Michalak).
35 | * Updated Hindi translation (by Scrambled777).
36 |
37 | ## 49
38 | * Added support for laptops often switching between charging and discharging.
39 |
40 | ## 48
41 | * Always show icon on discharging state (by Suvan Banerjee).
42 |
43 | ## 47
44 | * Added Hindi translation (by Scrambled777).
45 |
46 | ## 46
47 | * Hide icon on any battery state if battery level more than specified by user.
48 | * Added GNOME 46 support.
49 |
50 | ## 45
51 | * Better detection for better safety state.
52 |
53 | ## 44
54 | * Added Central Kurdish translation (by Hoshmand M. Qadir).
55 |
56 | ## 43
57 | * Moved to `libadwaita` in preferences.
58 |
59 | ## 42
60 | * Moved to GNOME 45.
61 |
62 | ## 41
63 | * Reverted lock screen support to pass new extension’s rules.
64 |
65 | ## 40
66 | * Added Turkish translation (by Sabri Ünal).
67 |
68 | ## 39
69 | * Fixed GSettings schema file.
70 |
71 | ## 38
72 | * Fixed GSettings name.
73 |
74 | ## 37
75 | * Added GNOME 44 support.
76 |
77 | ## 36
78 | * Added Indonesian translation (by Reza Almanda).
79 |
80 | ## 35
81 | * Fixed GNOME API usage.
82 |
83 | ## 34
84 | * Fixed GNOME 43 support.
85 |
86 | ## 33
87 | * Fixed Spanish translation (by gallegonovato).
88 |
89 | ## 32
90 | * Fixed GNOME 43 support (by Asriel Camora).
91 |
92 | ## 31
93 | * Added Korean translation (by Hoseok Seo).
94 |
95 | ## 30
96 | * Added GNOME 43 support.
97 |
98 | ## 29
99 | * Added Polish translation (by Maciej Klupp).
100 |
101 | ## 28
102 | * Added Simplified Chinese translation (by LiuliPack).
103 | * Added Spanish translation.
104 |
105 | ## 27
106 | * Added Catalan translation (by Maite Guix).
107 |
108 | ## 26
109 | * Fixed extension initialization (by Albert Hopkins).
110 |
111 | ## 25
112 | * Fixed GNOME 42 support (by Albert Hopkins).
113 |
114 | ## 24
115 | * Added GNOME 42 support.
116 |
117 | ## 23
118 | * Fixed bug with uninitialized variable (by @oxayotl).
119 |
120 | ## 22
121 | * Fixed lock screen support (by @oxayotl).
122 |
123 | ## 21
124 | * Added Belarusian translation (by Ilya Ryabchinski).
125 | * Added German trabslation (by Svetlana Chervyakova).
126 | * Added French translation (by J. Lavoie).
127 | * Added Japanese translation (by Marat Vyshegorodtsev).
128 | * Added Lithuanian translation (by Gediminas Murauskas).
129 | * Added Norwegian Bokmål translation (by Allan Nordhøy).
130 | * Added Ukrainian translation (by Andy Ivaniuk).
131 |
132 | ## 20
133 | * Do not load settings if extension was not initialized.
134 |
135 | ## 19
136 | * Added Dutch translation (by Heimen Stoffels).
137 |
138 | ## 18
139 | * Added GNOME 40 support (by @RuiGuilherme).
140 |
141 | ## 17
142 | * Fixed deprecation warning.
143 |
144 | ## 16
145 | * Update GNOME supported list.
146 |
147 | ## 15
148 | * Add settings to set charging threshold.
149 |
150 | ## 14
151 | * Improve behaviour in rare edge cases.
152 |
153 | ## 13
154 | * Simplify code by removing objects.
155 |
156 | ## 12
157 | * Hide icon on 100% charge instead of “fully charged” status.
158 | * Remove GNOME <= 3.10 support.
159 |
160 | ## 11
161 | * Add GNOME 3.22 to supported list.
162 |
163 | ## 10
164 | * Add GNOME 3.20 to supported list.
165 |
166 | ## 9
167 | * Add GNOME 3.18 to supported list.
168 |
169 | ## 8
170 | * Add GNOME 3.16 to supported list.
171 |
172 | ## 7
173 | * Add GNOME 3.14 to supported list.
174 |
175 | ## 6
176 | * Add GNOME 3.12 support.
177 |
178 | ## 5
179 | * Use async method to get devices.
180 |
181 | ## 4
182 | * Add GNOME 3.10 support.
183 | * Change license to MIT.
184 |
185 | ## 3
186 | * Add GNOME 3.7.92 to supported list.
187 |
188 | ## 2
189 | * Add GNOME 3.8 to supported list.
190 |
191 | ## 1
192 | * Initial release.
193 |
--------------------------------------------------------------------------------