feat: rename Game Bar to Quickpanel and support DMS 2.0
This commit is contained in:
27 files changed
+158
-145
No files matched your search
@@ -9,7 +9,7 @@ Item {
|
||||
property var daemon: null
|
||||
|
||||
readonly property var pluginData: (daemon && daemon.pluginData) ? daemon.pluginData : ({})
|
||||
readonly property string saveDirectory: String(pluginData.captureDirectory || "~/Videos/GameBar").trim()
|
||||
readonly property string saveDirectory: String(pluginData.captureDirectory || "~/Videos/Quickpanel").trim()
|
||||
readonly property int fps: Math.max(10, pluginData.captureFps || 60)
|
||||
readonly property int replaySeconds: Math.max(5, pluginData.captureReplaySeconds || 30)
|
||||
readonly property string audioSource: String(pluginData.captureAudio || "default_output").trim()
|
||||
@@ -40,7 +40,7 @@ Item {
|
||||
function timestampedFile() {
|
||||
const now = new Date();
|
||||
const stamp = Qt.formatDateTime(now, "yyyy-MM-dd_HH-mm-ss");
|
||||
return service.expandedDirectory() + "/GameBar_" + stamp + ".mp4";
|
||||
return service.expandedDirectory() + "/Quickpanel_" + stamp + ".mp4";
|
||||
}
|
||||
|
||||
function baseArgs(monitor) {
|
||||
@@ -54,7 +54,7 @@ Item {
|
||||
service.targetMonitor = monitor || "focused";
|
||||
service.lastFile = service.timestampedFile();
|
||||
service.lastError = "";
|
||||
recorder.command = ["sh", "-c", 'mkdir -p "$1" && exec gpu-screen-recorder "${@:2}"', "gameBar", service.expandedDirectory()].concat(service.baseArgs(service.targetMonitor)).concat(["-o", service.lastFile]);
|
||||
recorder.command = ["sh", "-c", 'mkdir -p "$1" && exec gpu-screen-recorder "${@:2}"', "quickpanel", service.expandedDirectory()].concat(service.baseArgs(service.targetMonitor)).concat(["-o", service.lastFile]);
|
||||
recorder.running = true;
|
||||
service.mode = "recording";
|
||||
service.startedAt = Date.now();
|
||||
@@ -68,7 +68,7 @@ Item {
|
||||
|
||||
service.targetMonitor = monitor || "focused";
|
||||
service.lastError = "";
|
||||
recorder.command = ["sh", "-c", 'mkdir -p "$1" && exec gpu-screen-recorder "${@:2}"', "gameBar", service.expandedDirectory()].concat(service.baseArgs(service.targetMonitor)).concat(["-c", "mp4", "-r", String(service.replaySeconds), "-o", service.expandedDirectory()]);
|
||||
recorder.command = ["sh", "-c", 'mkdir -p "$1" && exec gpu-screen-recorder "${@:2}"', "quickpanel", service.expandedDirectory()].concat(service.baseArgs(service.targetMonitor)).concat(["-c", "mp4", "-r", String(service.replaySeconds), "-o", service.expandedDirectory()]);
|
||||
recorder.running = true;
|
||||
service.mode = "replay";
|
||||
service.startedAt = Date.now();
|
||||
|
||||
@@ -75,7 +75,7 @@ Item {
|
||||
statesProc.environment = {
|
||||
"GAMEBAR_HA_TOKEN": service.token
|
||||
};
|
||||
statesProc.command = ["sh", "-c", service.curlGetScript, "gameBar", service.baseUrl + "/api/states"];
|
||||
statesProc.command = ["sh", "-c", service.curlGetScript, "quickpanel", service.baseUrl + "/api/states"];
|
||||
statesProc.running = true;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ Item {
|
||||
callProc.environment = {
|
||||
"GAMEBAR_HA_TOKEN": service.token
|
||||
};
|
||||
callProc.command = ["sh", "-c", service.curlPostScript, "gameBar", next.url, next.body];
|
||||
callProc.command = ["sh", "-c", service.curlPostScript, "quickpanel", next.url, next.body];
|
||||
callProc.running = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ Item {
|
||||
const body = label !== "" ? label : "Timer finished after " + service.formatDuration(service.durationMs);
|
||||
|
||||
if (service.soundOnFinish && service.alarmSound !== "")
|
||||
Quickshell.execDetached(["sh", "-c", '[ -r "$1" ] && exec paplay "$1"', "gameBar", service.alarmSound]);
|
||||
Quickshell.execDetached(["sh", "-c", '[ -r "$1" ] && exec paplay "$1"', "quickpanel", service.alarmSound]);
|
||||
|
||||
if (service.notifyOnFinish)
|
||||
Quickshell.execDetached(["notify-send", "-a", "Game Bar", "-u", "critical", "-i", "timer", "Timer finished", body]);
|
||||
|
||||
Reference in new issue
Block a user