forked from Shinonome/dots-hyprland
add screenshot location
This commit is contained in:
@@ -464,6 +464,10 @@ Singleton {
|
|||||||
property string savePath: Directories.videos
|
property string savePath: Directories.videos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property JsonObject screenSnip: JsonObject {
|
||||||
|
property string savePath: "/home/vaguesyntax/Pictures"
|
||||||
|
}
|
||||||
|
|
||||||
property JsonObject sounds: JsonObject {
|
property JsonObject sounds: JsonObject {
|
||||||
property bool battery: false
|
property bool battery: false
|
||||||
property bool pomodoro: false
|
property bool pomodoro: false
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ PanelWindow {
|
|||||||
property var selectionMode: RegionSelection.SelectionMode.RectCorners
|
property var selectionMode: RegionSelection.SelectionMode.RectCorners
|
||||||
signal dismiss()
|
signal dismiss()
|
||||||
|
|
||||||
|
property string permanentScreenshotDir: Config.options.screenSnip.savePath && Config.options.screenSnip.savePath !== ""
|
||||||
|
? Config.options.screenSnip.savePath
|
||||||
|
: ""
|
||||||
|
|
||||||
property string screenshotDir: Directories.screenshotTemp
|
property string screenshotDir: Directories.screenshotTemp
|
||||||
property string imageSearchEngineBaseUrl: Config.options.search.imageSearch.imageSearchEngineBaseUrl
|
property string imageSearchEngineBaseUrl: Config.options.search.imageSearch.imageSearchEngineBaseUrl
|
||||||
property string fileUploadApiEndpoint: "https://uguu.se/upload"
|
property string fileUploadApiEndpoint: "https://uguu.se/upload"
|
||||||
@@ -258,8 +262,24 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
switch (root.action) {
|
switch (root.action) {
|
||||||
case RegionSelection.SnipAction.Copy:
|
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;
|
break;
|
||||||
|
|
||||||
|
//snipProc.command = ["bash", "-c", `${cropToStdout} | wl-copy && ${cleanup}`]
|
||||||
|
//break;
|
||||||
case RegionSelection.SnipAction.Edit:
|
case RegionSelection.SnipAction.Edit:
|
||||||
snipProc.command = ["bash", "-c", `${cropToStdout} | swappy -f - && ${cleanup}`]
|
snipProc.command = ["bash", "-c", `${cropToStdout} | swappy -f - && ${cleanup}`]
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -86,11 +86,11 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ContentSection {
|
ContentSection {
|
||||||
icon: "screen_record"
|
icon: "file_open"
|
||||||
title: Translation.tr("Screen Recording")
|
title: Translation.tr("Save paths")
|
||||||
|
|
||||||
ContentSubsection {
|
ContentSubsection {
|
||||||
title: Translation.tr("Save path") + " (example: /home/user/Videos)"
|
title: Translation.tr("Video save path")
|
||||||
MaterialTextArea {
|
MaterialTextArea {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: Translation.tr("Path")
|
placeholderText: Translation.tr("Path")
|
||||||
@@ -102,6 +102,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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentSection {
|
ContentSection {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ Singleton {
|
|||||||
property string shortDate: Qt.locale().toString(clock.date, Config.options?.time.shortDateFormat ?? "dd/MM")
|
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 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 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"
|
property string uptime: "0h, 0m"
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|||||||
Reference in New Issue
Block a user