Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions catwalk/BarWidget.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Effects
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Modules.Bar.Extras
import qs.Services.UI
Expand Down Expand Up @@ -69,6 +70,19 @@ Rectangle {
readonly property var idleIcons: root.pluginApi?.mainInstance?.idleIcons || []

readonly property real cpuUsage: root.pluginApi?.mainInstance?.cpuUsage ?? 0

function openPanel() {
if (pluginApi) {
var result = pluginApi.openPanel(root.screen);
Logger.i("Catwalk", "OpenPanel result:", result);
} else {
Logger.e("Catwalk", "PluginAPI is null");
}
}

function openExternalMonitor() {
Quickshell.execDetached(["sh", "-c", Settings.data.systemMonitor.externalMonitor]);
}

Timer {
interval: Math.max(30, 200 - root.cpuUsage * 1.7)
Expand Down Expand Up @@ -157,22 +171,20 @@ Rectangle {

Logger.i("Catwalk", "Clicked! API:", !!pluginApi, "Screen:", root.screen ? root.screen.name : "null");

// Open Panel on click
if (pluginApi) {
var result = pluginApi.openPanel(root.screen);
Logger.i("Catwalk", "OpenPanel result:", result);
} else {
Logger.e("Catwalk", "PluginAPI is null");
}

if (!root.enabled && !root.allowClickWhenDisabled) {
return;
}
// Open Panel on left/right click
// Open external monitor on middle click
if (mouse.button === Qt.LeftButton) {
root.openPanel();
root.clicked();
} else if (mouse.button === Qt.RightButton) {
root.openPanel();
root.rightClicked();
} else if (mouse.button === Qt.MiddleButton) {
root.openExternalMonitor();
root.middleClicked();
}
}
Expand Down
2 changes: 1 addition & 1 deletion catwalk/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "catwalk",
"name": "Catwalk",
"version": "1.1.0",
"version": "1.1.1",
"minNoctaliaVersion": "3.6.0",
"author": "MannuVilasara",
"license": "MIT",
Expand Down