diff options
Diffstat (limited to 'modules/areapicker/AreaPicker.qml')
| -rw-r--r-- | modules/areapicker/AreaPicker.qml | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/modules/areapicker/AreaPicker.qml b/modules/areapicker/AreaPicker.qml new file mode 100644 index 0000000..547810b --- /dev/null +++ b/modules/areapicker/AreaPicker.qml @@ -0,0 +1,70 @@ +import "root:/widgets" +import Quickshell +import Quickshell.Wayland +import Quickshell.Io + +Scope { + LazyLoader { + id: root + + property bool freeze + + Variants { + model: Quickshell.screens + + StyledWindow { + id: win + + required property ShellScreen modelData + + screen: modelData + name: "area-picker" + WlrLayershell.exclusionMode: ExclusionMode.Ignore + WlrLayershell.layer: WlrLayer.Overlay + WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive + + anchors.top: true + anchors.bottom: true + anchors.left: true + anchors.right: true + + Picker { + loader: root + screen: win.modelData + } + } + } + } + + IpcHandler { + target: "picker" + + function open(): void { + root.freeze = false; + root.activeAsync = true; + } + + function openFreeze(): void { + root.freeze = true; + root.activeAsync = true; + } + } + + CustomShortcut { + name: "screenshot" + description: "Open screenshot tool" + onPressed: { + root.freeze = false; + root.activeAsync = true; + } + } + + CustomShortcut { + name: "screenshotFreeze" + description: "Open screenshot tool (freeze mode)" + onPressed: { + root.freeze = true; + root.activeAsync = true; + } + } +} |