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,270 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginComponent {
|
||||
id: root
|
||||
|
||||
property bool preparingForSleep: false
|
||||
|
||||
property string hookWallpaperPath: pluginData.wallpaperPath || ""
|
||||
property string hookLightMode: pluginData.lightMode || ""
|
||||
property string hookTheme: pluginData.theme || ""
|
||||
property string hookBatteryLevel: pluginData.batteryLevel || ""
|
||||
property string hookBatteryCharging: pluginData.batteryCharging || ""
|
||||
property string hookBatteryPluggedIn: pluginData.batteryPluggedIn || ""
|
||||
property string hookPowerRequestLock: pluginData.hookPowerRequestLock || ""
|
||||
property string hookPowerMonitorOff: pluginData.hookPowerMonitorOff || ""
|
||||
property string hookPowerMonitorOn: pluginData.hookPowerMonitorOn || ""
|
||||
property string hookPowerSuspend: pluginData.hookPowerSuspend || ""
|
||||
property string hookResumeFromSleep: pluginData.hookResumeFromSleep || ""
|
||||
property string hookWifiConnected: pluginData.wifiConnected || ""
|
||||
property string hookWifiSSID: pluginData.wifiSSID || ""
|
||||
property string hookEthernetConnected: pluginData.ethernetConnected || ""
|
||||
property string hookAudioVolume: pluginData.audioVolume || ""
|
||||
property string hookAudioMute: pluginData.audioMute || ""
|
||||
property string hookMicMute: pluginData.micMute || ""
|
||||
property string hookBrightness: pluginData.brightness || ""
|
||||
property string hookNightMode: pluginData.nightMode || ""
|
||||
property string hookDoNotDisturb: pluginData.doNotDisturb || ""
|
||||
property string hookMediaPlaying: pluginData.mediaPlaying || ""
|
||||
property string hookIdleStateActive: pluginData.idleStateActive || ""
|
||||
property string hookMonitorWallpaper: pluginData.monitorWallpaper || ""
|
||||
|
||||
Connections {
|
||||
target: SessionData
|
||||
function onWallpaperPathChanged() {
|
||||
if (hookWallpaperPath) {
|
||||
executeHook(hookWallpaperPath, "onWallpaperChanged", SessionData.wallpaperPath)
|
||||
}
|
||||
}
|
||||
|
||||
function onMonitorWallpapersChanged() {
|
||||
if (hookMonitorWallpaper) {
|
||||
const wallpapersJson = JSON.stringify(SessionData.monitorWallpapers)
|
||||
executeHook(hookMonitorWallpaper, "onMonitorWallpapersChanged", wallpapersJson)
|
||||
}
|
||||
}
|
||||
|
||||
function onIsLightModeChanged() {
|
||||
if (hookLightMode) {
|
||||
executeHook(hookLightMode, "onLightModeChanged", SessionData.isLightMode ? "light" : "dark")
|
||||
}
|
||||
}
|
||||
|
||||
function onNightModeEnabledChanged() {
|
||||
if (hookNightMode) {
|
||||
executeHook(hookNightMode, "onNightModeChanged", SessionData.nightModeEnabled ? "enabled" : "disabled")
|
||||
}
|
||||
}
|
||||
|
||||
function onDoNotDisturbChanged() {
|
||||
if (hookDoNotDisturb) {
|
||||
executeHook(hookDoNotDisturb, "onDoNotDisturbChanged", SessionData.doNotDisturb ? "enabled" : "disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: typeof Theme !== "undefined" ? Theme : null
|
||||
function onCurrentThemeChanged() {
|
||||
if (hookTheme) {
|
||||
executeHook(hookTheme, "onThemeChanged", Theme.currentTheme)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: BatteryService.batteryAvailable ? BatteryService : null
|
||||
function onBatteryLevelChanged() {
|
||||
if (hookBatteryLevel) {
|
||||
executeHook(hookBatteryLevel, "onBatteryLevelChanged", String(BatteryService.batteryLevel))
|
||||
}
|
||||
}
|
||||
|
||||
function onIsChargingChanged() {
|
||||
if (hookBatteryCharging) {
|
||||
executeHook(hookBatteryCharging, "onBatteryChargingChanged", BatteryService.isCharging ? "charging" : "not-charging")
|
||||
}
|
||||
}
|
||||
|
||||
function onIsPluggedInChanged() {
|
||||
if (hookBatteryPluggedIn) {
|
||||
executeHook(hookBatteryPluggedIn, "onBatteryPluggedInChanged", BatteryService.isPluggedIn ? "plugged-in" : "on-battery")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: IdleService
|
||||
|
||||
function onLockRequested() {
|
||||
if (hookPowerRequestLock) {
|
||||
executeHook(hookPowerRequestLock, "onLockRequested", "")
|
||||
}
|
||||
}
|
||||
|
||||
function onRequestMonitorOff() {
|
||||
if (hookPowerMonitorOff) {
|
||||
executeHook(hookPowerMonitorOff, "onRequestMonitorOff", "")
|
||||
}
|
||||
}
|
||||
|
||||
function onRequestMonitorOn() {
|
||||
if (hookPowerMonitorOn) {
|
||||
executeHook(hookPowerMonitorOn, "onRequestMonitorOn", "")
|
||||
}
|
||||
}
|
||||
|
||||
function onRequestSuspend() {
|
||||
if (hookPowerSuspend) {
|
||||
executeHook(hookPowerSuspend, "onRequestSuspend", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: DMSService
|
||||
|
||||
function onLoginctlStateUpdate(data) {
|
||||
var lastState = root.preparingForSleep
|
||||
root.preparingForSleep = data.preparingForSleep
|
||||
if (lastState && !root.preparingForSleep) {
|
||||
executeHook(hookResumeFromSleep, "onResumeFromSleep", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: NetworkService
|
||||
function onWifiConnectedChanged() {
|
||||
if (hookWifiConnected) {
|
||||
executeHook(hookWifiConnected, "onWifiConnectedChanged", NetworkService.wifiConnected ? "connected" : "disconnected")
|
||||
}
|
||||
}
|
||||
|
||||
function onCurrentWifiSSIDChanged() {
|
||||
if (hookWifiSSID) {
|
||||
executeHook(hookWifiSSID, "onWifiSSIDChanged", NetworkService.currentWifiSSID || "none")
|
||||
}
|
||||
}
|
||||
|
||||
function onEthernetConnectedChanged() {
|
||||
if (hookEthernetConnected) {
|
||||
executeHook(hookEthernetConnected, "onEthernetConnectedChanged", NetworkService.ethernetConnected ? "connected" : "disconnected")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AudioService.sink && AudioService.sink.audio ? AudioService.sink.audio : null
|
||||
|
||||
function onVolumeChanged() {
|
||||
if (hookAudioVolume && AudioService.sink && AudioService.sink.audio) {
|
||||
executeHook(hookAudioVolume, "onAudioVolumeChanged", String(Math.round(AudioService.sink.audio.volume * 100)))
|
||||
}
|
||||
}
|
||||
|
||||
function onMutedChanged() {
|
||||
if (hookAudioMute && AudioService.sink && AudioService.sink.audio) {
|
||||
executeHook(hookAudioMute, "onAudioMuteChanged", AudioService.sink.audio.muted ? "muted" : "unmuted")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AudioService.source && AudioService.source.audio ? AudioService.source.audio : null
|
||||
|
||||
function onMutedChanged() {
|
||||
if (hookMicMute && AudioService.source && AudioService.source.audio) {
|
||||
executeHook(hookMicMute, "onMicMuteChanged", AudioService.source.audio.muted ? "muted" : "unmuted")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: DisplayService
|
||||
|
||||
function onBrightnessLevelChanged() {
|
||||
if (hookBrightness && DisplayService.brightnessAvailable) {
|
||||
executeHook(hookBrightness, "onBrightnessChanged", String(DisplayService.brightnessLevel))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: MprisController.activePlayer
|
||||
|
||||
function onIsPlayingChanged() {
|
||||
if (hookMediaPlaying && MprisController.activePlayer) {
|
||||
executeHook(hookMediaPlaying, "onMediaPlayingChanged", MprisController.activePlayer.isPlaying ? "playing" : "paused")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function executeHook(scriptPath, hookName, hookValue) {
|
||||
if (!scriptPath || scriptPath.trim() === "") {
|
||||
return
|
||||
}
|
||||
|
||||
const process = hookProcessComponent.createObject(root, {
|
||||
hookScript: scriptPath,
|
||||
hookName: hookName,
|
||||
hookValue: hookValue
|
||||
})
|
||||
|
||||
if (!process) {
|
||||
console.error("DankHooks: Failed to create process object")
|
||||
return
|
||||
}
|
||||
|
||||
process.running = true
|
||||
}
|
||||
|
||||
Component {
|
||||
id: hookProcessComponent
|
||||
|
||||
Process {
|
||||
property string hookScript: ""
|
||||
property string hookName: ""
|
||||
property string hookValue: ""
|
||||
|
||||
command: ["sh", "-c", "$HOOK_SCRIPT \"$HOOK_NAME\" \"$HOOK_VALUE\""]
|
||||
environment: {
|
||||
"HOOK_SCRIPT": hookScript,
|
||||
"HOOK_NAME": hookName,
|
||||
"HOOK_VALUE": hookValue
|
||||
}
|
||||
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
if (text.trim()) {
|
||||
console.log("DankHooks output:", text.trim())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stderr: StdioCollector {
|
||||
onStreamFinished: {
|
||||
if (text.trim()) {
|
||||
ToastService.showError("Hook Script Error", text.trim())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onExited: (exitCode) => {
|
||||
if (exitCode !== 0) {
|
||||
ToastService.showError("Hook Script Error", `Script '${hookScript}' exited with code: ${exitCode}`)
|
||||
}
|
||||
destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
console.log("DankHooks: Stopped monitoring system events")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,324 @@
|
|||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginSettings {
|
||||
id: root
|
||||
pluginId: "dankHooks"
|
||||
|
||||
StyledText {
|
||||
text: "System Event Hooks"
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
font.weight: Font.Bold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Execute custom scripts when system events occur. Scripts receive two arguments: hook name (e.g., 'onBatteryLevelChanged') and event value."
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Appearance & Theme"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "wallpaperPath"
|
||||
label: "Wallpaper Changed"
|
||||
description: "Hook: onWallpaperChanged | Value: wallpaper file path"
|
||||
placeholder: "/path/to/wallpaper-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "monitorWallpaper"
|
||||
label: "Per-Monitor Wallpapers Changed"
|
||||
description: "Hook: onMonitorWallpapersChanged | Value: JSON object with all monitors (e.g., '{\"eDP-1\":\"/path1.jpg\",\"DP-2\":\"/path2.jpg\"}')"
|
||||
placeholder: "/path/to/monitor-wallpaper-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "lightMode"
|
||||
label: "Light/Dark Mode Changed"
|
||||
description: "Hook: onLightModeChanged | Value: 'light' or 'dark'"
|
||||
placeholder: "/path/to/mode-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "theme"
|
||||
label: "Theme Changed"
|
||||
description: "Hook: onThemeChanged | Value: theme name (e.g., 'blue', 'red', 'dynamic')"
|
||||
placeholder: "/path/to/theme-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "nightMode"
|
||||
label: "Night Mode Changed"
|
||||
description: "Hook: onNightModeChanged | Value: 'enabled' or 'disabled'"
|
||||
placeholder: "/path/to/nightmode-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Power & Battery"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "batteryLevel"
|
||||
label: "Battery Level Changed"
|
||||
description: "Hook: onBatteryLevelChanged | Value: percentage (0-100)"
|
||||
placeholder: "/path/to/battery-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "batteryCharging"
|
||||
label: "Battery Charging State Changed"
|
||||
description: "Hook: onBatteryChargingChanged | Value: 'charging' or 'not-charging'"
|
||||
placeholder: "/path/to/charging-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "batteryPluggedIn"
|
||||
label: "Power Adapter Changed"
|
||||
description: "Hook: onBatteryPluggedInChanged | Value: 'plugged-in' or 'on-battery'"
|
||||
placeholder: "/path/to/power-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "hookPowerRequestLock"
|
||||
label: "Lock Screen Event Triggered"
|
||||
description: "Hook: onLockRequested | Value: empty"
|
||||
placeholder: "/path/to/sessionlock-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "hookPowerMonitorOff"
|
||||
label: "Monitor Off Event Triggered"
|
||||
description: "Hook: onRequestMonitorOff | Value: empty"
|
||||
placeholder: "/path/to/monitoroff-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "hookPowerMonitorOn"
|
||||
label: "Monitor On Event Triggered"
|
||||
description: "Hook: onRequestMonitorOn | Value: empty"
|
||||
placeholder: "/path/to/monitoron-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "hookPowerSuspend"
|
||||
label: "Suspend Event Triggered"
|
||||
description: "Hook: onRequestSuspend | Value: empty"
|
||||
placeholder: "/path/to/suspend-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "hookResumeFromSleep"
|
||||
label: "Resume From Sleep Event Triggered"
|
||||
description: "Hook: onResumeFromSleep | Value: empty"
|
||||
placeholder: "/path/to/resumeFromSleep-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Network"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "wifiConnected"
|
||||
label: "WiFi Connection Changed"
|
||||
description: "Hook: onWifiConnectedChanged | Value: 'connected' or 'disconnected'"
|
||||
placeholder: "/path/to/wifi-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "wifiSSID"
|
||||
label: "WiFi Network Changed"
|
||||
description: "Hook: onWifiSSIDChanged | Value: SSID name or 'none'"
|
||||
placeholder: "/path/to/ssid-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "ethernetConnected"
|
||||
label: "Ethernet Connection Changed"
|
||||
description: "Hook: onEthernetConnectedChanged | Value: 'connected' or 'disconnected'"
|
||||
placeholder: "/path/to/ethernet-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Audio"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "audioVolume"
|
||||
label: "Audio Volume Changed"
|
||||
description: "Hook: onAudioVolumeChanged | Value: percentage (0-100)"
|
||||
placeholder: "/path/to/volume-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "audioMute"
|
||||
label: "Audio Mute Changed"
|
||||
description: "Hook: onAudioMuteChanged | Value: 'muted' or 'unmuted'"
|
||||
placeholder: "/path/to/mute-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "micMute"
|
||||
label: "Microphone Mute Changed"
|
||||
description: "Hook: onMicMuteChanged | Value: 'muted' or 'unmuted'"
|
||||
placeholder: "/path/to/mic-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Display & Media"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "brightness"
|
||||
label: "Brightness Changed"
|
||||
description: "Hook: onBrightnessChanged | Value: percentage (0-100)"
|
||||
placeholder: "/path/to/brightness-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "mediaPlaying"
|
||||
label: "Media Playback Changed"
|
||||
description: "Hook: onMediaPlayingChanged | Value: 'playing' or 'paused'"
|
||||
placeholder: "/path/to/media-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "System"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StringSetting {
|
||||
settingKey: "doNotDisturb"
|
||||
label: "Do Not Disturb Changed"
|
||||
description: "Hook: onDoNotDisturbChanged | Value: 'enabled' or 'disabled'"
|
||||
placeholder: "/path/to/dnd-hook.sh"
|
||||
defaultValue: ""
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.surfaceVariant
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Hook Script Examples"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Example hook script:"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: parent.width
|
||||
height: exampleCode.height + 16
|
||||
color: Theme.surface
|
||||
radius: Theme.cornerRadius
|
||||
|
||||
StyledText {
|
||||
id: exampleCode
|
||||
anchors.centerIn: parent
|
||||
anchors.margins: 8
|
||||
width: parent.width - 16
|
||||
text: '#!/bin/bash\n# Save as ~/.config/scripts/hook.sh\n# Make executable: chmod +x ~/.config/scripts/hook.sh\n\nHOOK_NAME="$1" # e.g., "onWallpaperChanged"\nHOOK_VALUE="$2" # e.g., "/path/to/wallpaper.jpg"\n\necho "Hook: $HOOK_NAME, Value: $HOOK_VALUE"\nnotify-send "$HOOK_NAME" "$HOOK_VALUE"'
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.family: "monospace"
|
||||
color: Theme.surfaceText
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "All hooks pass two arguments: $1 = hook name (e.g., 'onBatteryLevelChanged'), $2 = event value. See descriptions above for each hook's values."
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
# Dank Hooks Plugin
|
||||
|
||||
## Available Hooks
|
||||
|
||||
### Appearance & Theme
|
||||
|
||||
| Hook | Trigger | Hook Name | Value |
|
||||
|------|---------|-----------|-------|
|
||||
| **Wallpaper Changed** | When wallpaper changes | `onWallpaperChanged` | Wallpaper file path |
|
||||
| **Light/Dark Mode Changed** | When switching between modes | `onLightModeChanged` | `light` or `dark` |
|
||||
| **Theme Changed** | When color theme changes | `onThemeChanged` | Theme name (e.g., `blue`, `red`, `dynamic`) |
|
||||
| **Night Mode Changed** | When night mode toggles | `onNightModeChanged` | `enabled` or `disabled` |
|
||||
|
||||
### Power & Battery
|
||||
|
||||
| Hook | Trigger | Hook Name | Value |
|
||||
|------|---------|-----------|-------|
|
||||
| **Battery Level Changed** | When battery percentage changes | `onBatteryLevelChanged` | Battery percentage (0-100) |
|
||||
| **Battery Charging State Changed** | When charging state changes | `onBatteryChargingChanged` | `charging` or `not-charging` |
|
||||
| **Power Adapter Changed** | When power adapter connects/disconnects | `onBatteryPluggedInChanged` | `plugged-in` or `on-battery` |
|
||||
|
||||
### Network
|
||||
|
||||
| Hook | Trigger | Hook Name | Value |
|
||||
|------|---------|-----------|-------|
|
||||
| **WiFi Connection Changed** | When WiFi connects/disconnects | `onWifiConnectedChanged` | `connected` or `disconnected` |
|
||||
| **WiFi Network Changed** | When connected WiFi network changes | `onWifiSSIDChanged` | SSID name or `none` |
|
||||
| **Ethernet Connection Changed** | When Ethernet connects/disconnects | `onEthernetConnectedChanged` | `connected` or `disconnected` |
|
||||
|
||||
### Audio
|
||||
|
||||
| Hook | Trigger | Hook Name | Value |
|
||||
|------|---------|-----------|-------|
|
||||
| **Audio Volume Changed** | When speaker volume changes | `onAudioVolumeChanged` | Volume percentage (0-100) |
|
||||
| **Audio Mute Changed** | When speakers mute/unmute | `onAudioMuteChanged` | `muted` or `unmuted` |
|
||||
| **Microphone Mute Changed** | When microphone mutes/unmutes | `onMicMuteChanged` | `muted` or `unmuted` |
|
||||
|
||||
### Display & Media
|
||||
|
||||
| Hook | Trigger | Hook Name | Value |
|
||||
|------|---------|-----------|-------|
|
||||
| **Brightness Changed** | When screen brightness changes | `onBrightnessChanged` | Brightness percentage (0-100) |
|
||||
| **Media Playback Changed** | When media starts/stops playing | `onMediaPlayingChanged` | `playing` or `paused` |
|
||||
|
||||
### System
|
||||
|
||||
| Hook | Trigger | Hook Name | Value |
|
||||
|------|---------|-----------|-------|
|
||||
| **Do Not Disturb Changed** | When DND mode toggles | `onDoNotDisturbChanged` | `enabled` or `disabled` |
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"id": "dankHooks",
|
||||
"name": "Dank Hooks",
|
||||
"description": "Execute custom scripts on system events like wallpaper changes, theme updates, battery level changes, and more",
|
||||
"version": "1.0.5",
|
||||
"author": "Avenge Media",
|
||||
"icon": "webhook",
|
||||
"type": "daemon",
|
||||
"component": "./DankHooks.qml",
|
||||
"settings": "./DankHooksSettings.qml",
|
||||
"permissions": [
|
||||
"settings_read",
|
||||
"settings_write"
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue