From e567f06cefbadc3f2313669c4bba809033cba350 Mon Sep 17 00:00:00 2001 From: vaguesyntax Date: Sat, 1 Nov 2025 14:38:16 +0300 Subject: [PATCH 1/8] initial commit of record-location --- .../quickshell/ii/modules/common/Config.qml | 4 + .../ii/modules/settings/ServicesConfig.qml | 19 +++ .../quickshell/ii/scripts/videos/record.sh | 110 ++++++++++-------- 3 files changed, 85 insertions(+), 48 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index 39c0ef131..042d10639 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -460,6 +460,10 @@ Singleton { } } + property JsonObject screenRecord: JsonObject { + property string savePath: Directories.videos + } + property JsonObject sounds: JsonObject { property bool battery: false property bool pomodoro: false diff --git a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml index c9ff0c16b..778ff2b84 100644 --- a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml +++ b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml @@ -85,6 +85,25 @@ ContentPage { } + ContentSection { + icon: "screen_record" + title: Translation.tr("Screen Recording") + + ContentSubsection { + title: Translation.tr("Save path") + " (example: /home/user/Videos)" + MaterialTextArea { + Layout.fillWidth: true + placeholderText: Translation.tr("Path") + text: Config.options.screenRecord.savePath + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.screenRecord.savePath = text; + } + } + } + + } + ContentSection { icon: "search" title: Translation.tr("Search") diff --git a/dots/.config/quickshell/ii/scripts/videos/record.sh b/dots/.config/quickshell/ii/scripts/videos/record.sh index 794bcf1ba..f6410838c 100755 --- a/dots/.config/quickshell/ii/scripts/videos/record.sh +++ b/dots/.config/quickshell/ii/scripts/videos/record.sh @@ -1,21 +1,35 @@ #!/usr/bin/env bash +CONFIG_FILE="$HOME/.config/illogical-impulse/config.json" +JSON_PATH=".screenRecord.savePath" + +CUSTOM_PATH=$(jq -r "$JSON_PATH" "$CONFIG_FILE" 2>/dev/null) + +RECORDING_DIR="" + +if [[ -n "$CUSTOM_PATH" ]]; then + RECORDING_DIR="$CUSTOM_PATH" +else + RECORDING_DIR="$HOME/Videos" +fi + getdate() { - date '+%Y-%m-%d_%H.%M.%S' + date '+%Y-%m-%d_%H.%M.%S' } getaudiooutput() { - pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2 + pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2 } getactivemonitor() { - hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name' + hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name' } -xdgvideo="$(xdg-user-dir VIDEOS)" -if [[ $xdgvideo = "$HOME" ]]; then - unset xdgvideo -fi -mkdir -p "${xdgvideo:-$HOME/Videos}" -cd "${xdgvideo:-$HOME/Videos}" || exit +# ORİJİNAL XDG MANTIĞI SİLİNDİ, YERİNE SADECE YENİ DEĞİŞKEN KULLANILDI +# xdgvideo="$(xdg-user-dir VIDEOS)" +# if $xdgvideo = "$HOME" ]]; then +# unset xdgvideo +# fi +mkdir -p "$RECORDING_DIR" +cd "$RECORDING_DIR" || exit # parse --region without modifying $@ so other flags like --fullscreen still work ARGS=("$@") @@ -23,47 +37,47 @@ MANUAL_REGION="" SOUND_FLAG=0 FULLSCREEN_FLAG=0 for ((i=0;i<${#ARGS[@]};i++)); do - if [[ "${ARGS[i]}" == "--region" ]]; then - if (( i+1 < ${#ARGS[@]} )); then - MANUAL_REGION="${ARGS[i+1]}" - else - notify-send "Recording cancelled" "No region specified for --region" -a 'Recorder' & disown - exit 1 - fi - elif [[ "${ARGS[i]}" == "--sound" ]]; then - SOUND_FLAG=1 - elif [[ "${ARGS[i]}" == "--fullscreen" ]]; then - FULLSCREEN_FLAG=1 - fi + if [[ "${ARGS[i]}" == "--region" ]]; then + if (( i+1 < ${#ARGS[@]} )); then + MANUAL_REGION="${ARGS[i+1]}" + else + notify-send "Recording cancelled" "No region specified for --region" -a 'Recorder' & disown + exit 1 + fi + elif [[ "${ARGS[i]}" == "--sound" ]]; then + SOUND_FLAG=1 + elif [[ "${ARGS[i]}" == "--fullscreen" ]]; then + FULLSCREEN_FLAG=1 + fi done if pgrep wf-recorder > /dev/null; then - notify-send "Recording Stopped" "Stopped" -a 'Recorder' & - pkill wf-recorder & + notify-send "Recording Stopped" "Stopped" -a 'Recorder' & + pkill wf-recorder & else - if [[ $FULLSCREEN_FLAG -eq 1 ]]; then - notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown - if [[ $SOUND_FLAG -eq 1 ]]; then - wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" - else - wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t - fi - else - # If a manual region was provided via --region, use it; otherwise run slurp as before. - if [[ -n "$MANUAL_REGION" ]]; then - region="$MANUAL_REGION" - else - if ! region="$(slurp 2>&1)"; then - notify-send "Recording cancelled" "Selection was cancelled" -a 'Recorder' & disown - exit 1 - fi - fi + if [[ $FULLSCREEN_FLAG -eq 1 ]]; then + notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown + if [[ $SOUND_FLAG -eq 1 ]]; then + wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" + else + wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t + fi + else + # If a manual region was provided via --region, use it; otherwise run slurp as before. + if [[ -n "$MANUAL_REGION" ]]; then + region="$MANUAL_REGION" + else + if ! region="$(slurp 2>&1)"; then + notify-send "Recording cancelled" "Selection was cancelled" -a 'Recorder' & disown + exit 1 + fi + fi - notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown - if [[ $SOUND_FLAG -eq 1 ]]; then - wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" --audio="$(getaudiooutput)" - else - wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" - fi - fi -fi + notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown + if [[ $SOUND_FLAG -eq 1 ]]; then + wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" --audio="$(getaudiooutput)" + else + wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" + fi + fi +fi \ No newline at end of file From 0fabedb0c4a445bcab33fe4f693f4d6f9c954f94 Mon Sep 17 00:00:00 2001 From: vaguesyntax Date: Sat, 1 Nov 2025 14:41:29 +0300 Subject: [PATCH 2/8] tweaks in script --- .../quickshell/ii/scripts/videos/record.sh | 91 +++++++++---------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/dots/.config/quickshell/ii/scripts/videos/record.sh b/dots/.config/quickshell/ii/scripts/videos/record.sh index f6410838c..bf0ab504d 100755 --- a/dots/.config/quickshell/ii/scripts/videos/record.sh +++ b/dots/.config/quickshell/ii/scripts/videos/record.sh @@ -8,26 +8,21 @@ CUSTOM_PATH=$(jq -r "$JSON_PATH" "$CONFIG_FILE" 2>/dev/null) RECORDING_DIR="" if [[ -n "$CUSTOM_PATH" ]]; then - RECORDING_DIR="$CUSTOM_PATH" + RECORDING_DIR="$CUSTOM_PATH" else - RECORDING_DIR="$HOME/Videos" + RECORDING_DIR="$HOME/Videos" # Use default path fi getdate() { - date '+%Y-%m-%d_%H.%M.%S' + date '+%Y-%m-%d_%H.%M.%S' } getaudiooutput() { - pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2 + pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2 } getactivemonitor() { - hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name' + hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name' } -# ORİJİNAL XDG MANTIĞI SİLİNDİ, YERİNE SADECE YENİ DEĞİŞKEN KULLANILDI -# xdgvideo="$(xdg-user-dir VIDEOS)" -# if $xdgvideo = "$HOME" ]]; then -# unset xdgvideo -# fi mkdir -p "$RECORDING_DIR" cd "$RECORDING_DIR" || exit @@ -37,47 +32,47 @@ MANUAL_REGION="" SOUND_FLAG=0 FULLSCREEN_FLAG=0 for ((i=0;i<${#ARGS[@]};i++)); do - if [[ "${ARGS[i]}" == "--region" ]]; then - if (( i+1 < ${#ARGS[@]} )); then - MANUAL_REGION="${ARGS[i+1]}" - else - notify-send "Recording cancelled" "No region specified for --region" -a 'Recorder' & disown - exit 1 - fi - elif [[ "${ARGS[i]}" == "--sound" ]]; then - SOUND_FLAG=1 - elif [[ "${ARGS[i]}" == "--fullscreen" ]]; then - FULLSCREEN_FLAG=1 - fi + if [[ "${ARGS[i]}" == "--region" ]]; then + if (( i+1 < ${#ARGS[@]} )); then + MANUAL_REGION="${ARGS[i+1]}" + else + notify-send "Recording cancelled" "No region specified for --region" -a 'Recorder' & disown + exit 1 + fi + elif [[ "${ARGS[i]}" == "--sound" ]]; then + SOUND_FLAG=1 + elif [[ "${ARGS[i]}" == "--fullscreen" ]]; then + FULLSCREEN_FLAG=1 + fi done if pgrep wf-recorder > /dev/null; then - notify-send "Recording Stopped" "Stopped" -a 'Recorder' & - pkill wf-recorder & + notify-send "Recording Stopped" "Stopped" -a 'Recorder' & + pkill wf-recorder & else - if [[ $FULLSCREEN_FLAG -eq 1 ]]; then - notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown - if [[ $SOUND_FLAG -eq 1 ]]; then - wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" - else - wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t - fi - else - # If a manual region was provided via --region, use it; otherwise run slurp as before. - if [[ -n "$MANUAL_REGION" ]]; then - region="$MANUAL_REGION" - else - if ! region="$(slurp 2>&1)"; then - notify-send "Recording cancelled" "Selection was cancelled" -a 'Recorder' & disown - exit 1 - fi - fi + if [[ $FULLSCREEN_FLAG -eq 1 ]]; then + notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown + if [[ $SOUND_FLAG -eq 1 ]]; then + wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" + else + wf-recorder -o "$(getactivemonitor)" --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t + fi + else + # If a manual region was provided via --region, use it; otherwise run slurp as before. + if [[ -n "$MANUAL_REGION" ]]; then + region="$MANUAL_REGION" + else + if ! region="$(slurp 2>&1)"; then + notify-send "Recording cancelled" "Selection was cancelled" -a 'Recorder' & disown + exit 1 + fi + fi - notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown - if [[ $SOUND_FLAG -eq 1 ]]; then - wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" --audio="$(getaudiooutput)" - else - wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" - fi - fi + notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'Recorder' & disown + if [[ $SOUND_FLAG -eq 1 ]]; then + wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" --audio="$(getaudiooutput)" + else + wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$region" + fi + fi fi \ No newline at end of file From ace8802480227850ab528d7e171288328e7786a9 Mon Sep 17 00:00:00 2001 From: vaguesyntax Date: Sat, 1 Nov 2025 15:55:46 +0300 Subject: [PATCH 3/8] add screenshot location --- .../quickshell/ii/modules/common/Config.qml | 4 ++++ .../regionSelector/RegionSelection.qml | 22 ++++++++++++++++++- .../ii/modules/settings/ServicesConfig.qml | 19 +++++++++++++--- .../quickshell/ii/services/DateTime.qml | 1 + 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index 042d10639..db8171b45 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -464,6 +464,10 @@ Singleton { property string savePath: Directories.videos } + property JsonObject screenSnip: JsonObject { + property string savePath: "/home/vaguesyntax/Pictures" + } + property JsonObject sounds: JsonObject { property bool battery: false property bool pomodoro: false diff --git a/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml b/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml index 5ecce47ba..53ccfaf34 100644 --- a/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml +++ b/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml @@ -33,6 +33,10 @@ 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 screenshotDir: Directories.screenshotTemp property string imageSearchEngineBaseUrl: Config.options.search.imageSearch.imageSearchEngineBaseUrl property string fileUploadApiEndpoint: "https://uguu.se/upload" @@ -258,8 +262,24 @@ PanelWindow { } switch (root.action) { case RegionSelection.SnipAction.Copy: - snipProc.command = ["bash", "-c", `${cropToStdout} | wl-copy && ${cleanup}`] + if (permanentScreenshotDir === "") { + // no permanent dir, just copy to clipboard + snipProc.command = ["bash", "-c", `${cropToStdout} | wl-copy && ${cleanup}`] + break; + } + const saveFileName = 'screenshot-' + DateTime.fileDateTime + '.png' + const savePath = `${root.permanentScreenshotDir}/${saveFileName}` + + snipProc.command = [ + "bash", "-c", + `mkdir -p '${StringUtils.shellSingleQuoteEscape(root.permanentScreenshotDir)}' ` + + `&& ${cropToStdout} | tee >(wl-copy) > '${StringUtils.shellSingleQuoteEscape(savePath)}' ` + + `&& ${cleanup}` + ] break; + + //snipProc.command = ["bash", "-c", `${cropToStdout} | wl-copy && ${cleanup}`] + //break; case RegionSelection.SnipAction.Edit: snipProc.command = ["bash", "-c", `${cropToStdout} | swappy -f - && ${cleanup}`] break; diff --git a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml index 778ff2b84..5511a6bad 100644 --- a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml +++ b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml @@ -86,11 +86,11 @@ ContentPage { } ContentSection { - icon: "screen_record" - title: Translation.tr("Screen Recording") + icon: "file_open" + title: Translation.tr("Save paths") ContentSubsection { - title: Translation.tr("Save path") + " (example: /home/user/Videos)" + title: Translation.tr("Video save path") MaterialTextArea { Layout.fillWidth: true placeholderText: Translation.tr("Path") @@ -101,6 +101,19 @@ ContentPage { } } } + + ContentSubsection { + title: Translation.tr("Screenshot save path") + " (leave empty to just copy)" + MaterialTextArea { + Layout.fillWidth: true + placeholderText: Translation.tr("Path") + text: Config.options.screenSnip.savePath + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.screenSnip.savePath = text; + } + } + } } diff --git a/dots/.config/quickshell/ii/services/DateTime.qml b/dots/.config/quickshell/ii/services/DateTime.qml index 62d296dbc..c6998f056 100644 --- a/dots/.config/quickshell/ii/services/DateTime.qml +++ b/dots/.config/quickshell/ii/services/DateTime.qml @@ -22,6 +22,7 @@ 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 { From 0c587415eadd3081c968d061fd1b6f921d2ee888 Mon Sep 17 00:00:00 2001 From: vaguesyntax Date: Sat, 1 Nov 2025 16:00:32 +0300 Subject: [PATCH 4/8] tweaks in settings/config --- .../quickshell/ii/modules/common/Config.qml | 2 +- .../ii/modules/settings/ServicesConfig.qml | 39 ++++++++----------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index db8171b45..8a3b51c73 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -465,7 +465,7 @@ Singleton { } property JsonObject screenSnip: JsonObject { - property string savePath: "/home/vaguesyntax/Pictures" + property string savePath: "" // only copy to clipboard when empty } property JsonObject sounds: JsonObject { diff --git a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml index 5511a6bad..3f5f25f45 100644 --- a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml +++ b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml @@ -89,32 +89,25 @@ ContentPage { icon: "file_open" title: Translation.tr("Save paths") - ContentSubsection { - title: Translation.tr("Video save path") - MaterialTextArea { - Layout.fillWidth: true - placeholderText: Translation.tr("Path") - text: Config.options.screenRecord.savePath - wrapMode: TextEdit.Wrap - onTextChanged: { - Config.options.screenRecord.savePath = text; - } - } - } - - ContentSubsection { - title: Translation.tr("Screenshot save path") + " (leave empty to just copy)" - MaterialTextArea { - Layout.fillWidth: true - placeholderText: Translation.tr("Path") - text: Config.options.screenSnip.savePath - wrapMode: TextEdit.Wrap - onTextChanged: { - Config.options.screenSnip.savePath = text; - } + MaterialTextArea { + Layout.fillWidth: true + placeholderText: Translation.tr("Video Recording Path") + text: Config.options.screenRecord.savePath + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.screenRecord.savePath = text; } } + MaterialTextArea { + Layout.fillWidth: true + placeholderText: Translation.tr("Screenshot Path (leave empyt to just copy)") + text: Config.options.screenSnip.savePath + wrapMode: TextEdit.Wrap + onTextChanged: { + Config.options.screenSnip.savePath = text; + } + } } ContentSection { From 6afa6d2142acc019ea921f0340bffbf0548165b0 Mon Sep 17 00:00:00 2001 From: vaguesyntax Date: Sat, 1 Nov 2025 16:04:04 +0300 Subject: [PATCH 5/8] remove reduntant code --- .../quickshell/ii/modules/regionSelector/RegionSelection.qml | 3 --- 1 file changed, 3 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml b/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml index 53ccfaf34..9d984d5ec 100644 --- a/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml +++ b/dots/.config/quickshell/ii/modules/regionSelector/RegionSelection.qml @@ -277,9 +277,6 @@ PanelWindow { `&& ${cleanup}` ] break; - - //snipProc.command = ["bash", "-c", `${cropToStdout} | wl-copy && ${cleanup}`] - //break; case RegionSelection.SnipAction.Edit: snipProc.command = ["bash", "-c", `${cropToStdout} | swappy -f - && ${cleanup}`] break; From a240329f22822a927a8ee757b19d9395bec7a4ca Mon Sep 17 00:00:00 2001 From: vaguesyntax Date: Sat, 1 Nov 2025 16:18:02 +0300 Subject: [PATCH 6/8] fix: initialize recording path setting properly --- dots/.config/quickshell/ii/modules/common/Config.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index 8a3b51c73..10eaa0126 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -461,7 +461,7 @@ Singleton { } property JsonObject screenRecord: JsonObject { - property string savePath: Directories.videos + property string savePath: Directories.videos.replace("file://","") // strip "file://" } property JsonObject screenSnip: JsonObject { From 8e1a3d26b1de458ecee8d5040ffec0ca21baf9a7 Mon Sep 17 00:00:00 2001 From: Vague Syntax Date: Sat, 1 Nov 2025 17:56:38 +0300 Subject: [PATCH 7/8] Update dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml Co-authored-by: Madjid Taha <1833954+madjidtaha@users.noreply.github.com> --- dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml index 3f5f25f45..f5931bb1b 100644 --- a/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml +++ b/dots/.config/quickshell/ii/modules/settings/ServicesConfig.qml @@ -101,7 +101,7 @@ ContentPage { MaterialTextArea { Layout.fillWidth: true - placeholderText: Translation.tr("Screenshot Path (leave empyt to just copy)") + placeholderText: Translation.tr("Screenshot Path (leave empty to just copy)") text: Config.options.screenSnip.savePath wrapMode: TextEdit.Wrap onTextChanged: { From 47aa8232f7e583b0b9e9ac5a8462be8dafb97b81 Mon Sep 17 00:00:00 2001 From: vaguesyntax Date: Thu, 6 Nov 2025 23:39:32 +0300 Subject: [PATCH 8/8] fixes --- .../regionSelector/RegionSelection.qml | 25 +++++++++++-------- .../quickshell/ii/services/DateTime.qml | 1 - 2 files changed, 14 insertions(+), 12 deletions(-) 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 {