summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/areapicker/AreaPicker.qml41
-rw-r--r--modules/areapicker/Picker.qml9
-rw-r--r--modules/bar/BarWrapper.qml5
-rw-r--r--modules/dashboard/Media.qml4
-rw-r--r--modules/drawers/Drawers.qml16
-rw-r--r--modules/notifications/Notification.qml2
6 files changed, 71 insertions, 6 deletions
diff --git a/modules/areapicker/AreaPicker.qml b/modules/areapicker/AreaPicker.qml
index 7ff051f..0d8b2fe 100644
--- a/modules/areapicker/AreaPicker.qml
+++ b/modules/areapicker/AreaPicker.qml
@@ -12,6 +12,7 @@ Scope {
property bool freeze
property bool closing
+ property bool clipboardOnly
Variants {
model: Quickshell.screens
@@ -51,12 +52,28 @@ Scope {
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;
}
}
@@ -67,6 +84,7 @@ Scope {
onPressed: {
root.freeze = false;
root.closing = false;
+ root.clipboardOnly = false;
root.activeAsync = true;
}
}
@@ -77,6 +95,29 @@ Scope {
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;
}
}
diff --git a/modules/areapicker/Picker.qml b/modules/areapicker/Picker.qml
index 1625ccf..67ec268 100644
--- a/modules/areapicker/Picker.qml
+++ b/modules/areapicker/Picker.qml
@@ -73,7 +73,14 @@ MouseArea {
function save(): void {
const tmpfile = Qt.resolvedUrl(`/tmp/caelestia-picker-${Quickshell.processId}-${Date.now()}.png`);
- CUtils.saveItem(screencopy, tmpfile, Qt.rect(Math.ceil(rsx), Math.ceil(rsy), Math.floor(sw), Math.floor(sh)), path => Quickshell.execDetached(["swappy", "-f", path]));
+ CUtils.saveItem(screencopy, tmpfile, Qt.rect(Math.ceil(rsx), Math.ceil(rsy), Math.floor(sw), Math.floor(sh)), path => {
+ if (root.loader.clipboardOnly) {
+ Quickshell.execDetached(["sh", "-c", "wl-copy --type image/png < " + path]);
+ Quickshell.execDetached(["notify-send", "-a", "caelestia-cli", "-i", path, "Screenshot taken", "Screenshot copied to clipboard"]);
+ } else {
+ Quickshell.execDetached(["swappy", "-f", path]);
+ }
+ });
closeAnim.start();
}
diff --git a/modules/bar/BarWrapper.qml b/modules/bar/BarWrapper.qml
index b496cfd..29961b6 100644
--- a/modules/bar/BarWrapper.qml
+++ b/modules/bar/BarWrapper.qml
@@ -12,11 +12,12 @@ Item {
required property ShellScreen screen
required property PersistentProperties visibilities
required property BarPopouts.Wrapper popouts
+ required property bool disabled
readonly property int padding: Math.max(Appearance.padding.smaller, Config.border.thickness)
readonly property int contentWidth: Config.bar.sizes.innerWidth + padding * 2
- readonly property int exclusiveZone: Config.bar.persistent || visibilities.bar ? contentWidth : Config.border.thickness
- readonly property bool shouldBeVisible: Config.bar.persistent || visibilities.bar || isHovered
+ readonly property int exclusiveZone: !disabled && (Config.bar.persistent || visibilities.bar) ? contentWidth : Config.border.thickness
+ readonly property bool shouldBeVisible: !disabled && (Config.bar.persistent || visibilities.bar || isHovered)
property bool isHovered
function closeTray(): void {
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml
index 3d4dcdb..37d1226 100644
--- a/modules/dashboard/Media.qml
+++ b/modules/dashboard/Media.qml
@@ -224,7 +224,7 @@ Item {
label.animate: true
toggle: true
padding: Appearance.padding.small / 2
- checked: Players.active?.isPlaying
+ checked: Players.active?.isPlaying ?? false
font.pointSize: Math.round(Appearance.font.size.large * 1.5)
disabled: !Players.active?.canTogglePlaying
onClicked: Players.active?.togglePlaying()
@@ -323,7 +323,7 @@ Item {
id: playerSelector
disabled: !Players.list.length
- active: menuItems.find(m => m.modelData === Players.active) ?? menuItems[0]
+ active: menuItems.find(m => m.modelData === Players.active) ?? menuItems[0] ?? null
menu.onItemSelected: item => Players.manualActive = item.modelData
menuItems: playerList.instances
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index 2ba79a4..9fc38bd 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -18,6 +18,20 @@ Variants {
id: scope
required property ShellScreen modelData
+ readonly property bool barDisabled: {
+ const regexChecker = /^\^.*\$$/;
+ for (const filter of Config.bar.excludedScreens) {
+ // If filter is a regex
+ if (regexChecker.test(filter)) {
+ if ((new RegExp(filter)).test(modelData.name))
+ return true;
+ } else {
+ if (filter === modelData.name)
+ return true;
+ }
+ }
+ return false;
+ }
Exclusions {
screen: scope.modelData
@@ -169,6 +183,8 @@ Variants {
visibilities: visibilities
popouts: panels.popouts
+ disabled: scope.barDisabled
+
Component.onCompleted: Visibilities.bars.set(scope.modelData, this)
}
}
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml
index 95507fc..b5376cf 100644
--- a/modules/notifications/Notification.qml
+++ b/modules/notifications/Notification.qml
@@ -18,7 +18,7 @@ StyledRect {
readonly property bool hasImage: modelData.image.length > 0
readonly property bool hasAppIcon: modelData.appIcon.length > 0
readonly property int nonAnimHeight: summary.implicitHeight + (root.expanded ? appName.height + body.height + actions.height + actions.anchors.topMargin : bodyPreview.height) + inner.anchors.margins * 2
- property bool expanded
+ property bool expanded: Config.notifs.openExpanded
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.tPalette.m3surfaceContainer
radius: Appearance.rounding.normal