ctrl + c & ctrl + s shortcuts + screenshot destination dir env var
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 16s
JS/TS / lint (pull_request) Successful in 17s
Python / fmt (pull_request) Successful in 32s
Python / lint (pull_request) Successful in 32s
Python / test (pull_request) Successful in 1m0s
C++ / build (pull_request) Successful in 1m35s
Python / typecheck (pull_request) Failing after 1m12s
Rust / fmt (pull_request) Successful in 38s
Rust / build (pull_request) Successful in 1m34s
Rust / clippy (pull_request) Successful in 1m28s
Python / buildcheck (pull_request) Successful in 2m35s
C++ / clang-tidy (pull_request) Successful in 3m23s

This commit is contained in:
2026-08-11 18:57:36 +02:00
parent ad5fda2718
commit 06fb202e36
5 changed files with 33 additions and 5 deletions
+1
View File
@@ -5,6 +5,7 @@ JsonObject {
property string mode: "manual"
property real radius: 12.0
property bool rounding: false
property bool saveOnCopy: false
property bool shadow: true
property real shadow_blur: 22.0
property list<int> shadow_color: [0, 0, 0, 160]
+13 -2
View File
@@ -8,6 +8,7 @@ import QtQuick.Effects
import qs.Components
import qs.Config
import qs.Helpers.Picker
import qs.Paths
Item {
id: root
@@ -103,8 +104,9 @@ Item {
const finalize = finalPath => {
if (copyToClipboard) {
Quickshell.execDetached(["sh", "-c", `wl-copy --type image/png < '${finalPath.replace(/'/g, `'\\''`)}'`]);
} else {
const dest = `${Quickshell.env("HOME")}/Pictures/Screenshots/zshell-${Date.now()}.png`;
}
if (!copyToClipboard || Config.screenshot.saveOnCopy) {
const dest = `${Paths.screenshots}/zshell-${Date.now()}.png`;
Quickshell.execDetached(["sh", "-c", `mkdir -p "$(dirname '${dest}')" && cp '${path.replace(/'/g, `'\\''`)}' '${dest}'`]);
}
};
@@ -176,6 +178,15 @@ Item {
}
}
Keys.onEscapePressed: root.mode === "edit" ? cancel() : closeAnim.start()
Keys.onPressed: e => {
if ((e.key == Qt.Key_C) && (e.modifiers & Qt.ControlModifier)) {
save(true);
e.accepted = true;
} else if ((e.key == Qt.Key_S) && (e.modifiers & Qt.ControlModifier)) {
save(false);
e.accepted = true;
}
}
onClientsChanged: {
if (root.mode === "select")
checkClientRects(selectArea.mouseX, selectArea.mouseY);
+2 -2
View File
@@ -15,9 +15,9 @@ Singleton {
category: "appearance"
},
{
name: qsTr("Screenshot"),
name: qsTr("Screenshots"),
icon: "screenshot_region",
description: qsTr("Set screenshot effects"),
description: qsTr("Set screenshot options and effects"),
category: "appearance"
},
+16 -1
View File
@@ -12,7 +12,7 @@ import qs.Modules.Settings.Common
PageBase {
id: root
title: qsTr("Screenshot effects")
title: qsTr("Screenshots")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
@@ -22,6 +22,21 @@ PageBase {
SectionHeader {
first: true
text: qsTr("Behavior")
}
ToggleRow {
checked: Config.screenshot.saveOnCopy
first: true
last: true
settingAnchor: "screenshot-save-on-copy"
subtext: qsTr("Also save screenshot to disk when copying to clipboard")
text: qsTr("Save on copy")
onToggled: Config.screenshot.saveOnCopy = checked
}
SectionHeader {
text: qsTr("Effects")
}
+1
View File
@@ -17,6 +17,7 @@ Singleton {
readonly property string notifimagecache: `${imagecache}/notifs`
readonly property string pictures: Quickshell.env("XDG_PICTURES_DIR") || `${home}/Pictures`
readonly property string recsdir: Quickshell.env("ZSHELL_RECORDINGS_DIR") || `${videos}/Recordings`
readonly property string screenshots: Quickshell.env("ZSHELL_SCREENSHOTS_DIR") || `${home}/Pictures/Screenshots`
readonly property string state: `${Quickshell.env("XDG_STATE_HOME") || `${home}/.local/state`}/zshell`
readonly property string videos: Quickshell.env("XDG_VIDEOS_DIR") || `${home}/Videos`
readonly property string wallsdir: Quickshell.env("ZSHELL_WALLPAPERS_DIR") || absolutePath(Config.general.wallpaperPath)