mirror of
https://github.com/belsabbagh/dotfiles.git
synced 2026-04-11 09:36:46 +00:00
quickshell and hyprland additions
This commit is contained in:
124
.config/quickshell/caelestia/modules/areapicker/AreaPicker.qml
Normal file
124
.config/quickshell/caelestia/modules/areapicker/AreaPicker.qml
Normal file
@@ -0,0 +1,124 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.components.containers
|
||||
import qs.components.misc
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Io
|
||||
|
||||
Scope {
|
||||
LazyLoader {
|
||||
id: root
|
||||
|
||||
property bool freeze
|
||||
property bool closing
|
||||
property bool clipboardOnly
|
||||
|
||||
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: root.closing ? WlrKeyboardFocus.None : WlrKeyboardFocus.Exclusive
|
||||
mask: root.closing ? empty : null
|
||||
|
||||
anchors.top: true
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
|
||||
Region {
|
||||
id: empty
|
||||
}
|
||||
|
||||
Picker {
|
||||
loader: root
|
||||
screen: win.modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "picker"
|
||||
|
||||
function open(): void {
|
||||
root.freeze = false;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = false;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
|
||||
function openFreeze(): void {
|
||||
root.freeze = true;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = false;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
|
||||
function openClip(): void {
|
||||
root.freeze = false;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = true;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
|
||||
function openFreezeClip(): void {
|
||||
root.freeze = true;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = true;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
}
|
||||
|
||||
CustomShortcut {
|
||||
name: "screenshot"
|
||||
description: "Open screenshot tool"
|
||||
onPressed: {
|
||||
root.freeze = false;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = false;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
}
|
||||
|
||||
CustomShortcut {
|
||||
name: "screenshotFreeze"
|
||||
description: "Open screenshot tool (freeze mode)"
|
||||
onPressed: {
|
||||
root.freeze = true;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = false;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
}
|
||||
|
||||
CustomShortcut {
|
||||
name: "screenshotClip"
|
||||
description: "Open screenshot tool (clipboard)"
|
||||
onPressed: {
|
||||
root.freeze = false;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = true;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
}
|
||||
|
||||
CustomShortcut {
|
||||
name: "screenshotFreezeClip"
|
||||
description: "Open screenshot tool (freeze mode, clipboard)"
|
||||
onPressed: {
|
||||
root.freeze = true;
|
||||
root.closing = false;
|
||||
root.clipboardOnly = true;
|
||||
root.activeAsync = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user