summaryrefslogtreecommitdiffstats
path: root/pkgs/simple/flameshot-once/flameshot
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-02 02:18:54 +0000
committertv <tv@krebsco.de>2026-12-02 02:18:54 +0000
commite1b4d6373e96ab22b36119ac689d72ced9164c47 (patch)
tree7e590e95ba5b0323f4c3bc8c6d0c7ca340945491 /pkgs/simple/flameshot-once/flameshot
parente69079eb1ecd2c779dfec93b66e3bd180889dd68 (diff)
flameshot-once: flameshot 13.3.0, configured by a module
flameshot-once starts flameshot's daemon and its GUI, with flameshot.ini from config.nix's settings, and with imgur, uploads to its createUrl and an xdg-open that opens or deletes them. flameshot gets the history and applauncher patches, too. The buttons option, which was commented out, is left out, and with it the tools that listed the button types for it.
Diffstat (limited to 'pkgs/simple/flameshot-once/flameshot')
-rw-r--r--pkgs/simple/flameshot-once/flameshot/default.nix10
-rw-r--r--pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch27
-rw-r--r--pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch28
-rw-r--r--pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch56
4 files changed, 93 insertions, 28 deletions
diff --git a/pkgs/simple/flameshot-once/flameshot/default.nix b/pkgs/simple/flameshot-once/flameshot/default.nix
index 10154cc4..7b9ccbf0 100644
--- a/pkgs/simple/flameshot-once/flameshot/default.nix
+++ b/pkgs/simple/flameshot-once/flameshot/default.nix
@@ -2,14 +2,16 @@ self: super:
super.flameshot.overrideAttrs (old: rec {
name = "flameshot-${version}";
- version = "0.10.2";
+ version = builtins.head (builtins.match "tags/v(.*)" src.rev);
src = self.fetchFromGitHub {
owner = "flameshot-org";
repo = "flameshot";
- rev = "v${version}";
- sha256 = "sha256-rZUiaS32C77tFJmEkw/9MGbVTVscb6LOCyWaWO5FyR4=";
+ rev = "tags/v13.3.0";
+ hash = "sha256-RyoLniRmJRinLUwgmaA4RprYAVHnoPxCP9LyhHfUPe0=";
};
patches = old.patches or [] ++ [
- ./flameshot_imgur_0.10.2.patch
+ ./flameshot-13.imgur.patch
+ ./flameshot-13.history.patch
+ ./flameshot-13.applauncher.patch
];
})
diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch
new file mode 100644
index 00000000..c43096dd
--- /dev/null
+++ b/pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch
@@ -0,0 +1,27 @@
+diff --git a/src/tools/launcher/applauncherwidget.cpp b/src/tools/launcher/applauncherwidget.cpp
+index 4ec68f29..3a0fa9ad 100644
+--- a/src/tools/launcher/applauncherwidget.cpp
++++ b/src/tools/launcher/applauncherwidget.cpp
+@@ -22,6 +22,7 @@
+ #include <QStandardPaths>
+ #include <QTabWidget>
+ #include <QTemporaryFile>
++#include <stdlib.h>
+
+ namespace {
+ #if defined(Q_OS_WIN)
+@@ -72,6 +73,14 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap& p, QWidget* parent)
+ m_parser.processDirectory(QDir(appsDir));
+ }
+
++ const char *USER = secure_getenv("USER");
++ QString dirUser = "/etc/profiles/per-user/" + QString::fromUtf8(USER) + "/share/applications/";
++ QDir appsDirUser(dirUser);
++ m_parser.processDirectory(appsDirUser);
++
++ QString dir = QStringLiteral("/run/current-system/sw/share/applications/");
++ QDir appsDir(dir);
++ m_parser.processDirectory(appsDir);
+ #endif
+
+ initAppMap();
diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch
new file mode 100644
index 00000000..3626f5c7
--- /dev/null
+++ b/pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch
@@ -0,0 +1,28 @@
+diff --git a/src/utils/history.cpp b/src/utils/history.cpp
+index 877e6195..7e46f168 100644
+--- a/src/utils/history.cpp
++++ b/src/utils/history.cpp
+@@ -76,9 +76,9 @@ const HistoryFileName& History::unpackFileName(const QString& fileNamePacked)
+ int nPathIndex = fileNamePacked.lastIndexOf("/");
+ QStringList unpackedFileName;
+ if (nPathIndex == -1) {
+- unpackedFileName = fileNamePacked.split("-");
++ unpackedFileName = fileNamePacked.split("|");
+ } else {
+- unpackedFileName = fileNamePacked.mid(nPathIndex + 1).split("-");
++ unpackedFileName = fileNamePacked.mid(nPathIndex + 1).split("|");
+ }
+
+ switch (unpackedFileName.length()) {
+@@ -109,9 +109,9 @@ const QString& History::packFileName(const QString& storageType,
+ if (storageType.length() > 0) {
+ if (deleteToken.length() > 0) {
+ m_packedFileName =
+- storageType + "-" + deleteToken + "-" + m_packedFileName;
++ storageType + "|" + deleteToken + "|" + m_packedFileName;
+ } else {
+- m_packedFileName = storageType + "-" + m_packedFileName;
++ m_packedFileName = storageType + "|" + m_packedFileName;
+ }
+ }
+ return m_packedFileName;
diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch
index c4c0bf38..bc9537c1 100644
--- a/pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch
+++ b/pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch
@@ -1,35 +1,43 @@
---- a/src/tools/imgur/imguruploader.cpp
-+++ b/src/tools/imgur/imguruploader.cpp
-@@ -31,6 +31,7 @@
- #include <QTimer>
+diff --git a/src/tools/imgupload/storages/imgur/imguruploader.cpp b/src/tools/imgupload/storages/imgur/imguruploader.cpp
+index 1021dc6b..909c5633 100644
+--- a/src/tools/imgupload/storages/imgur/imguruploader.cpp
++++ b/src/tools/imgupload/storages/imgur/imguruploader.cpp
+@@ -17,6 +17,7 @@
+ #include <QNetworkRequest>
+ #include <QShortcut>
#include <QUrlQuery>
- #include <QVBoxLayout>
+#include <stdlib.h>
ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent)
- : QWidget(parent)
-@@ -79,8 +80,11 @@ void ImgurUploader::handleReply(QNetworkReply* reply)
- m_imageURL.setUrl(data[QStringLiteral("link")].toString());
-
- auto deleteToken = data[QStringLiteral("deletehash")].toString();
-+ char *deleteImageURLPattern = secure_getenv("IMGUR_DELETE_URL");
-+ if (deleteImageURLPattern == NULL)
-+ deleteImageURLPattern = "https://imgur.com/delete/%1";
- m_deleteImageURL.setUrl(
-- QStringLiteral("https://imgur.com/delete/%1").arg(deleteToken));
-+ QString::fromUtf8(deleteImageURLPattern).arg(deleteToken));
-
- // save history
- QString imageName = m_imageURL.toString();
-@@ -133,7 +137,10 @@ void ImgurUploader::upload()
+ : ImgUploaderBase(capture, parent)
+@@ -84,7 +85,13 @@ void ImgurUploader::upload()
QString description = FileNameHandler().parsedPattern();
urlQuery.addQueryItem(QStringLiteral("description"), description);
- QUrl url(QStringLiteral("https://api.imgur.com/3/image"));
-+ char *createImageURLPattern = secure_getenv("IMGUR_CREATE_URL");
-+ if (createImageURLPattern == NULL)
-+ createImageURLPattern = "https://api.imgur.com/3/image";
-+ QUrl url(QString::fromUtf8(createImageURLPattern));
++ const char *IMGUR_CREATE_URL = secure_getenv("IMGUR_CREATE_URL");
++ QString createUrlPattern =
++ IMGUR_CREATE_URL != NULL
++ ? QString::fromUtf8(IMGUR_CREATE_URL)
++ : QStringLiteral("https://api.imgur.com/3/image")
++ ;
++ QUrl url(createUrlPattern);
url.setQuery(urlQuery);
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader,
+@@ -101,8 +108,14 @@ void ImgurUploader::deleteImage(const QString& fileName,
+ const QString& deleteToken)
+ {
+ Q_UNUSED(fileName)
++ const char *IMGUR_DELETE_URL = secure_getenv("IMGUR_DELETE_URL");
++ QString deleteImageURLPattern =
++ IMGUR_DELETE_URL != NULL
++ ? QString::fromUtf8(IMGUR_DELETE_URL)
++ : QStringLiteral("https://imgur.com/delete/%1")
++ ;
+ bool successful = QDesktopServices::openUrl(
+- QUrl(QStringLiteral("https://imgur.com/delete/%1").arg(deleteToken)));
++ QUrl(deleteImageURLPattern.arg(deleteToken)));
+ if (!successful) {
+ notification()->showMessage(tr("Unable to open the URL."));
+ }