重写 startb;补点中文注释;删减多余的定时模板

为啥又中文了?英文太长,中英夹杂键起来别扭。

不会真有人用我原始人般的配置吧?
This commit is contained in:
2026-03-24 03:08:10 +08:00
parent 8b9589c8c9
commit a1a0c2bdb6
17 changed files with 78 additions and 332 deletions

View File

@@ -1,16 +1,16 @@
#!/usr/bin/env python
# SPDX-License-Identifier: CC0-1.0
# Copyright © 2021 mpan; <https://mpan.pl/>; CC0 1.0 (THIS SCRIPT!)
# Context: <https://bbs.archlinux.org/viewtopic.php?id=269453>
# Reference: https://github.com/wogscpar/upower-python
# Arch 论坛贴: <https://bbs.archlinux.org/viewtopic.php?id=269453>
# UPower 实现: https://github.com/wogscpar/upower-python
# -*- encoding: utf-8 -*-
# @File : .battery-warn
# @Time : 2025/12/29 00:32:53
# @Author : SilverAg.L
# bash pipeline was still too complicated.
# Dependencies (pacman): python-dbus, libnotify, pipewire-audio
# bash 折腾管道还是太原始了。
# 包依赖 (pacman): python-dbus, libnotify, pipewire-audio
import dbus
@@ -18,11 +18,12 @@ from os import getenv
from subprocess import run as start_process
# region config
# 哪怕设备名也不稳定。pipewire 滚了几轮,桌面扬声器居然不见了。
# AUD_OUT_EMB = ( # my laptop embedded speaker
# "alsa_output.pci-0000_00_1f"
# ".3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink"
# )
# better searched by editor like VSCode.
# 环境变量展开这一块。同时也是为了查找起来方便。毕竟已经有 gtklock 这个例外了。
AUD_FILE = "~/.local/share/.low_power.wav".replace("~", getenv("HOME"), 1)
# endregion config