Add .config/DankMaterialShell/firefox.css
Add .config/DankMaterialShell/plugin_settings.json Add .config/DankMaterialShell/plugins/calculator/CalculatorLauncher.qml Add .config/DankMaterialShell/plugins/calculator/CalculatorSettings.qml Add .config/DankMaterialShell/plugins/calculator/README.md Add .config/DankMaterialShell/plugins/calculator/calculator.js Add .config/DankMaterialShell/plugins/calculator/.git/HEAD Add .config/DankMaterialShell/plugins/calculator/.git/config Add .config/DankMaterialShell/plugins/calculator/.git/index Add .config/DankMaterialShell/plugins/calculator/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/calculator/.git/objects/pack/pack-67f644835e660794f65c9273e46788b0c3da57cf.idx Add .config/DankMaterialShell/plugins/calculator/.git/objects/pack/pack-67f644835e660794f65c9273e46788b0c3da57cf.rev Add .config/DankMaterialShell/plugins/calculator/.git/objects/pack/pack-67f644835e660794f65c9273e46788b0c3da57cf.pack Add .config/DankMaterialShell/plugins/calculator/.git/refs/heads/main Add .config/DankMaterialShell/plugins/calculator/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/calculator/.git/refs/remotes/origin/qalc Add .config/DankMaterialShell/plugins/calculator/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/calculator/plugin.json Add .config/DankMaterialShell/plugins/calculator/screenshot.png Add .config/DankMaterialShell/plugins/calculator/test_precision.js Add .config/DankMaterialShell/plugins/calculator/test_single.js Add .config/DankMaterialShell/plugins/commandRunner/CommandRunner.qml Add .config/DankMaterialShell/plugins/commandRunner/CommandRunnerSettings.qml Add .config/DankMaterialShell/plugins/commandRunner/LICENSE Add .config/DankMaterialShell/plugins/commandRunner/README.md Add .config/DankMaterialShell/plugins/commandRunner/.git/HEAD Add .config/DankMaterialShell/plugins/commandRunner/.git/config Add .config/DankMaterialShell/plugins/commandRunner/.git/index Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/pack/pack-5a720f795fd2994ef506cd867d86ca7df8a25a31.idx Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/pack/pack-5a720f795fd2994ef506cd867d86ca7df8a25a31.rev Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/pack/pack-5a720f795fd2994ef506cd867d86ca7df8a25a31.pack Add .config/DankMaterialShell/plugins/commandRunner/.git/refs/heads/main Add .config/DankMaterialShell/plugins/commandRunner/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/commandRunner/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/commandRunner/plugin.json Add .config/DankMaterialShell/plugins/commandRunner/screenshot.png Add .config/DankMaterialShell/plugins/dankActions.meta Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankActions/DankActionsSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankActions/DankActionsWidget.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankActions/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankBatteryAlerts/DankBatteryAlerts.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankBatteryAlerts/DankBatteryAlertsSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankBatteryAlerts/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/DankHooks.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/DankHooksSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/README.md Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankPomodoroTimer/DankPomodoroSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankPomodoroTimer/DankPomodoroWidget.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankPomodoroTimer/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/LICENSE Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/README.md Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/HEAD Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/config Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/index Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/pack/pack-3221a15c022ef4a7bb6bf2c47e40068b66b3588b.idx Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/pack/pack-3221a15c022ef4a7bb6bf2c47e40068b66b3588b.rev Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/pack/pack-3221a15c022ef4a7bb6bf2c47e40068b66b3588b.pack Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/refs/heads/master Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/refs/remotes/origin/master Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.gitignore Add .config/DankMaterialShell/plugins/emojiLauncher/EmojiLauncher.qml Add .config/DankMaterialShell/plugins/emojiLauncher/EmojiLauncherSettings.qml Add .config/DankMaterialShell/plugins/emojiLauncher/LICENSE Add .config/DankMaterialShell/plugins/emojiLauncher/README.md Add .config/DankMaterialShell/plugins/emojiLauncher/catalog.js Add .config/DankMaterialShell/plugins/emojiLauncher/data/emojis.txt Add .config/DankMaterialShell/plugins/emojiLauncher/data/math.txt Add .config/DankMaterialShell/plugins/emojiLauncher/data/nerdfont.txt Add .config/DankMaterialShell/plugins/emojiLauncher/.git/HEAD Add .config/DankMaterialShell/plugins/emojiLauncher/.git/config Add .config/DankMaterialShell/plugins/emojiLauncher/.git/index Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/pack/pack-e04a5b1ea381dc3a792b8bf08cf70e735b195c0d.idx Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/pack/pack-e04a5b1ea381dc3a792b8bf08cf70e735b195c0d.rev Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/pack/pack-e04a5b1ea381dc3a792b8bf08cf70e735b195c0d.pack Add .config/DankMaterialShell/plugins/emojiLauncher/.git/refs/heads/main Add .config/DankMaterialShell/plugins/emojiLauncher/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/emojiLauncher/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/emojiLauncher/plugin.json Add .config/DankMaterialShell/plugins/emojiLauncher/screenshot.png Add .config/DankMaterialShell/plugins/emojiLauncher/scripts/generate_catalog.py Add .config/DankMaterialShell/plugins/dankActions Add .config/DankMaterialShell/plugins/webSearch/LICENSE Add .config/DankMaterialShell/plugins/webSearch/README.md Add .config/DankMaterialShell/plugins/webSearch/WebSearch.qml Add .config/DankMaterialShell/plugins/webSearch/WebSearchSettings.qml Add .config/DankMaterialShell/plugins/webSearch/.git/HEAD Add .config/DankMaterialShell/plugins/webSearch/.git/config Add .config/DankMaterialShell/plugins/webSearch/.git/index Add .config/DankMaterialShell/plugins/webSearch/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/webSearch/.git/objects/pack/pack-6a60c736f418e5b4b1f0505f66c1e2a371d46fed.idx Add .config/DankMaterialShell/plugins/webSearch/.git/objects/pack/pack-6a60c736f418e5b4b1f0505f66c1e2a371d46fed.rev Add .config/DankMaterialShell/plugins/webSearch/.git/objects/pack/pack-6a60c736f418e5b4b1f0505f66c1e2a371d46fed.pack Add .config/DankMaterialShell/plugins/webSearch/.git/refs/heads/main Add .config/DankMaterialShell/plugins/webSearch/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/webSearch/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/webSearch/plugin.json Add .config/DankMaterialShell/plugins/webSearch/screenshot.png Add .config/DankMaterialShell/settings.json
This commit is contained in:
parent
b22161e0ca
commit
809b12203c
103 changed files with 25020 additions and 0 deletions
|
|
@ -0,0 +1,110 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginComponent {
|
||||
id: root
|
||||
Item {}
|
||||
|
||||
property bool enableCriticalAlert: pluginData.enableCriticalAlert ?? true
|
||||
property int criticalThreshold: pluginData.criticalThreshold ?? 10
|
||||
property string criticalTitle: pluginData.criticalTitle || "Critical Battery Level"
|
||||
property string criticalMessage: pluginData.criticalMessage || "Battery at ${level}% - Connect charger immediately!"
|
||||
property bool enableWarningAlert: pluginData.enableWarningAlert ?? true
|
||||
property int warningThreshold: pluginData.warningThreshold ?? 20
|
||||
property string warningTitle: pluginData.warningTitle || "Low Battery"
|
||||
property string warningMessage: pluginData.warningMessage || "Battery at ${level}% - Consider charging soon"
|
||||
|
||||
property bool criticalAlertSent: false
|
||||
property bool warningAlertSent: false
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("DankBatteryAlerts: Started monitoring battery level")
|
||||
console.log("DankBatteryAlerts: Critical alerts:", enableCriticalAlert, "at", criticalThreshold + "%")
|
||||
console.log("DankBatteryAlerts: Warning alerts:", enableWarningAlert, "at", warningThreshold + "%")
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: BatteryService.batteryAvailable ? BatteryService : null
|
||||
|
||||
function onBatteryLevelChanged() {
|
||||
const level = BatteryService.batteryLevel
|
||||
const isCharging = BatteryService.isCharging
|
||||
|
||||
if (isCharging) {
|
||||
criticalAlertSent = false
|
||||
warningAlertSent = false
|
||||
return
|
||||
}
|
||||
|
||||
if (enableCriticalAlert && level <= criticalThreshold && !criticalAlertSent) {
|
||||
sendNotification(
|
||||
criticalTitle,
|
||||
criticalMessage.replace("${level}", level),
|
||||
"critical",
|
||||
"battery_alert"
|
||||
)
|
||||
criticalAlertSent = true
|
||||
} else if (enableWarningAlert && level <= warningThreshold && !warningAlertSent && !criticalAlertSent) {
|
||||
sendNotification(
|
||||
warningTitle,
|
||||
warningMessage.replace("${level}", level),
|
||||
"normal",
|
||||
"battery_std"
|
||||
)
|
||||
warningAlertSent = true
|
||||
}
|
||||
|
||||
if (level > warningThreshold) {
|
||||
warningAlertSent = false
|
||||
}
|
||||
if (level > criticalThreshold) {
|
||||
criticalAlertSent = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendNotification(title, message, urgency, icon) {
|
||||
const process = notifyProcessComponent.createObject(root, {
|
||||
notifyTitle: title,
|
||||
notifyMessage: message,
|
||||
notifyUrgency: urgency,
|
||||
notifyIcon: icon
|
||||
})
|
||||
process.running = true
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notifyProcessComponent
|
||||
|
||||
Process {
|
||||
property string notifyTitle: ""
|
||||
property string notifyMessage: ""
|
||||
property string notifyUrgency: "normal"
|
||||
property string notifyIcon: "battery_alert"
|
||||
|
||||
command: [
|
||||
"notify-send",
|
||||
"-a", "DankMaterialShell",
|
||||
"-i", notifyIcon,
|
||||
"-u", notifyUrgency,
|
||||
notifyTitle,
|
||||
notifyMessage
|
||||
]
|
||||
|
||||
onExited: (exitCode) => {
|
||||
if (exitCode !== 0) {
|
||||
console.error("DankBatteryAlerts: notify-send failed with code:", exitCode)
|
||||
}
|
||||
destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
console.log("DankBatteryAlerts: Stopped monitoring battery level")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginSettings {
|
||||
id: root
|
||||
pluginId: "dankBatteryAlerts"
|
||||
|
||||
StyledText {
|
||||
text: "Battery Alerts"
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
font.weight: Font.Bold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Get notified when battery reaches critical or warning levels while on battery power"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Critical Alert"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
ToggleSetting {
|
||||
settingKey: "enableCriticalAlert"
|
||||
label: "Enable Critical Alert"
|
||||
description: "Show urgent notification when battery reaches critical level"
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
SliderSetting {
|
||||
settingKey: "criticalThreshold"
|
||||
label: "Critical Threshold"
|
||||
description: "Battery percentage to trigger critical alert"
|
||||
defaultValue: 10
|
||||
minimum: 1
|
||||
maximum: 30
|
||||
unit: "%"
|
||||
rightIcon: "battery_alert"
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "criticalTitle"
|
||||
label: "Critical Title"
|
||||
description: "Notification title for critical alerts"
|
||||
placeholder: "Critical Battery Level"
|
||||
defaultValue: "Critical Battery Level"
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "criticalMessage"
|
||||
label: "Critical Message"
|
||||
description: "Use ${level} for battery percentage"
|
||||
placeholder: "Battery at ${level}% - Connect charger immediately!"
|
||||
defaultValue: "Battery at ${level}% - Connect charger immediately!"
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Warning Alert"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
ToggleSetting {
|
||||
settingKey: "enableWarningAlert"
|
||||
label: "Enable Warning Alert"
|
||||
description: "Show notification when battery reaches warning level"
|
||||
defaultValue: true
|
||||
}
|
||||
|
||||
SliderSetting {
|
||||
settingKey: "warningThreshold"
|
||||
label: "Warning Threshold"
|
||||
description: "Battery percentage to trigger warning alert"
|
||||
defaultValue: 20
|
||||
minimum: 5
|
||||
maximum: 50
|
||||
unit: "%"
|
||||
rightIcon: "battery_std"
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "warningTitle"
|
||||
label: "Warning Title"
|
||||
description: "Notification title for warning alerts"
|
||||
placeholder: "Low Battery"
|
||||
defaultValue: "Low Battery"
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "warningMessage"
|
||||
label: "Warning Message"
|
||||
description: "Use ${level} for battery percentage"
|
||||
placeholder: "Battery at ${level}% - Consider charging soon"
|
||||
defaultValue: "Battery at ${level}% - Consider charging soon"
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Alert Behavior"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "• Critical alerts use urgent priority and persist longer\n• Alerts reset when battery is charging or rises above threshold\n• Only one alert per threshold per battery discharge cycle"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"id": "dankBatteryAlerts",
|
||||
"name": "Dank Battery Alerts",
|
||||
"description": "Receive notifications when battery level reaches critical or warning thresholds",
|
||||
"version": "1.1.0",
|
||||
"author": "Avenge Media",
|
||||
"icon": "battery_alert",
|
||||
"type": "daemon",
|
||||
"component": "./DankBatteryAlerts.qml",
|
||||
"settings": "./DankBatteryAlertsSettings.qml",
|
||||
"permissions": ["settings_read", "settings_write"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue