diff --git a/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml b/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml index 9d984d5ec..2af55f014 100644 --- a/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml +++ b/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml @@ -33,9 +33,9 @@ PanelWindow { property var selectionMode: RegionSelection.SelectionMode.RectCorners signal dismiss() - property string permanentScreenshotDir: Config.options.screenSnip.savePath && Config.options.screenSnip.savePath !== "" - ? Config.options.screenSnip.savePath - : "" + property string saveScreenshotDir: Config.options.screenSnip.savePath !== "" + ? Config.options.screenSnip.savePath + : "" property string screenshotDir: Directories.screenshotTemp property string imageSearchEngineBaseUrl: Config.options.search.imageSearch.imageSearchEngineBaseUrl @@ -262,20 +262,23 @@ PanelWindow { } switch (root.action) { case RegionSelection.SnipAction.Copy: - if (permanentScreenshotDir === "") { - // no permanent dir, just copy to clipboard + if (saveScreenshotDir === "") { + // not saving the screenshot, just copy to clipboard snipProc.command = ["bash", "-c", `${cropToStdout} | wl-copy && ${cleanup}`] break; } - const saveFileName = 'screenshot-' + DateTime.fileDateTime + '.png' - const savePath = `${root.permanentScreenshotDir}/${saveFileName}` + + const savePathBase = root.saveScreenshotDir snipProc.command = [ - "bash", "-c", - `mkdir -p '${StringUtils.shellSingleQuoteEscape(root.permanentScreenshotDir)}' ` + - `&& ${cropToStdout} | tee >(wl-copy) > '${StringUtils.shellSingleQuoteEscape(savePath)}' ` + - `&& ${cleanup}` + "bash", "-c", + `mkdir -p '${StringUtils.shellSingleQuoteEscape(savePathBase)}' && \ + saveFileName="screenshot-$(date '+%Y-%m-%d_%H.%M.%S').png" && \ + savePath="${savePathBase}/$saveFileName" && \ + ${cropToStdout} | tee >(wl-copy) > "$savePath" && \ + ${cleanup}` ] + break; case RegionSelection.SnipAction.Edit: snipProc.command = ["bash", "-c", `${cropToStdout} | swappy -f - && ${cleanup}`] diff --git a/dots/.config/quickshell/ii/services/DateTime.qml b/dots/.config/quickshell/ii/services/DateTime.qml index c6998f056..62d296dbc 100644 --- a/dots/.config/quickshell/ii/services/DateTime.qml +++ b/dots/.config/quickshell/ii/services/DateTime.qml @@ -22,7 +22,6 @@ Singleton { property string shortDate: Qt.locale().toString(clock.date, Config.options?.time.shortDateFormat ?? "dd/MM") property string date: Qt.locale().toString(clock.date, Config.options?.time.dateFormat ?? "dddd, dd/MM") property string collapsedCalendarFormat: Qt.locale().toString(clock.date, "dd MMMM yyyy") - property string fileDateTime: Qt.locale().toString(clock.date, "dd-MM-yyyy_HH.mm") property string uptime: "0h, 0m" Timer {