Compare commits
No commits in common. "6193170b5e5373ff0a76e6df4b3221117328ef16" and "main" have entirely different histories.
6193170b5e
...
main
7 changed files with 156 additions and 33 deletions
|
|
@ -7,4 +7,8 @@ Language: Cpp
|
||||||
# Force pointers to the type for C++.
|
# Force pointers to the type for C++.
|
||||||
DerivePointerAlignment: false
|
DerivePointerAlignment: false
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
|
|
||||||
|
# Break after every argument or not at all
|
||||||
|
BinPackArguments: false
|
||||||
|
BinPackParameters: false
|
||||||
---
|
---
|
||||||
|
|
|
||||||
31
.woodpecker/check.yml
Normal file
31
.woodpecker/check.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
labels:
|
||||||
|
type: exec
|
||||||
|
|
||||||
|
pipeline:
|
||||||
|
- name: flake check
|
||||||
|
image: bash
|
||||||
|
commands:
|
||||||
|
- nix flake check
|
||||||
|
|
||||||
|
- name: package check
|
||||||
|
image: bash
|
||||||
|
commands:
|
||||||
|
- nix build
|
||||||
|
|
||||||
|
- name: notify
|
||||||
|
image: bash
|
||||||
|
secrets:
|
||||||
|
- source: matrix_roomid
|
||||||
|
target: room
|
||||||
|
- source: matrix_username
|
||||||
|
target: user
|
||||||
|
- source: matrix_password
|
||||||
|
target: pass
|
||||||
|
- source: matrix_homeserver
|
||||||
|
target: address
|
||||||
|
commands:
|
||||||
|
- nix run github:ambroisie/matrix-notifier
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- failure
|
||||||
|
- success
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) [year] [fullname]
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SOURCES = dragger.cc
|
SOURCES = src/dragger.cc
|
||||||
CONFIG += qt
|
CONFIG += qt
|
||||||
QT += widgets
|
QT += widgets
|
||||||
|
|
|
||||||
78
flake.lock
generated
78
flake.lock
generated
|
|
@ -1,28 +1,65 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1673956053,
|
||||||
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1631561581,
|
"lastModified": 1678901627,
|
||||||
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
|
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
|
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"ref": "master",
|
"ref": "main",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1660459072,
|
||||||
|
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1633329294,
|
"lastModified": 1680273054,
|
||||||
"narHash": "sha256-0LpQLS4KMgxslMgmDHmxG/5twFlXDBW9z4Or1iOrCvU=",
|
"narHash": "sha256-Bs6/5LpvYp379qVqGt9mXxxx9GSE789k3oFc+OAL07M=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ee084c02040e864eeeb4cf4f8538d92f7c675671",
|
"rev": "3364b5b117f65fe1ce65a3cdd5612a078a3b31e3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -32,21 +69,40 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-stable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1678872516,
|
||||||
|
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-22.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pre-commit-hooks": {
|
"pre-commit-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": [
|
"flake-utils": [
|
||||||
"flake-utils"
|
"flake-utils"
|
||||||
],
|
],
|
||||||
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1631170176,
|
"lastModified": 1680170909,
|
||||||
"narHash": "sha256-RLN/kur2Kpxt0cJp0Fms8ixuGpT8IHX0OpeQ8u8f0X4=",
|
"narHash": "sha256-FtKU/edv1jFRr/KwUxWTYWXEyj9g8GBrHntC2o8oFI8=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "3ed0e618cebc1ff291c27b749cf7568959cac028",
|
"rev": "29dbe1efaa91c3a415d8b45d62d48325a4748816",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
35
flake.nix
35
flake.nix
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
description = "A simple calculator";
|
description = "A CLI drag-and-drop tool";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils = {
|
flake-utils = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "numtide";
|
owner = "numtide";
|
||||||
repo = "flake-utils";
|
repo = "flake-utils";
|
||||||
ref = "master";
|
ref = "main";
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
|
|
@ -49,15 +49,12 @@
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
pre-commit = pre-commit-hooks.lib.${system}.run {
|
pre-commit = pre-commit-hooks.lib.${system}.run {
|
||||||
src = self;
|
src = ./.;
|
||||||
|
|
||||||
hooks = {
|
hooks = {
|
||||||
clang-format = {
|
clang-format = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "clang-format";
|
types_or = [ "c++" ];
|
||||||
entry = "${pkgs.clang-tools}/bin/clang-format -style=file -i";
|
|
||||||
types = [ "text" "c++" ];
|
|
||||||
language = "system";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs-fmt = {
|
nixpkgs-fmt = {
|
||||||
|
|
@ -72,10 +69,9 @@
|
||||||
defaultPackage = packages.dragger;
|
defaultPackage = packages.dragger;
|
||||||
|
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [ ]
|
inputsFrom = with packages; [
|
||||||
++ defaultPackage.nativeBuildInputs
|
dragger
|
||||||
++ defaultPackage.buildInputs
|
];
|
||||||
;
|
|
||||||
|
|
||||||
inherit (checks.pre-commit) shellHook;
|
inherit (checks.pre-commit) shellHook;
|
||||||
};
|
};
|
||||||
|
|
@ -85,19 +81,12 @@
|
||||||
};
|
};
|
||||||
}) // {
|
}) // {
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
dragger = with final; stdenv.mkDerivation {
|
dragger = with final; qt5.mkDerivation {
|
||||||
pname = "dragger";
|
pname = "dragger";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
|
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
libsForQt5.qt5.qtbase
|
|
||||||
];
|
|
||||||
nativeBuildInputs = [
|
|
||||||
libsForQt5.qt5.wrapQtAppsHook
|
|
||||||
];
|
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
qmake
|
qmake
|
||||||
'';
|
'';
|
||||||
|
|
@ -106,6 +95,14 @@
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp dragger $out/bin
|
cp dragger $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A CLI drag-and-drop tool";
|
||||||
|
homepage = "https://gitea.belanyi.fr/ambroisie/dragger";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ ambroisie ];
|
||||||
|
platforms = platforms.all;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QCommandLineParser>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDrag>
|
#include <QDrag>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
@ -9,10 +10,23 @@
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
QApplication::setApplicationName("dragger");
|
||||||
|
QApplication::setApplicationVersion("0.1.0");
|
||||||
|
|
||||||
|
QCommandLineParser parser;
|
||||||
|
parser.setApplicationDescription("A CLI drag-and-drop tool");
|
||||||
|
parser.addHelpOption();
|
||||||
|
parser.addVersionOption();
|
||||||
|
parser.addPositionalArgument(
|
||||||
|
"files",
|
||||||
|
QCoreApplication::translate("files", "files to drag-and-drop"),
|
||||||
|
"[FILES...]");
|
||||||
|
|
||||||
|
parser.process(app);
|
||||||
|
|
||||||
QList<QUrl> urls;
|
QList<QUrl> urls;
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (auto const& path : parser.positionalArguments()) {
|
||||||
QFileInfo file(QFile(argv[i]));
|
QFileInfo file{QFile{path}};
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
urls << QUrl("file:" + file.absoluteFilePath());
|
urls << QUrl("file:" + file.absoluteFilePath());
|
||||||
} else {
|
} else {
|
||||||
Loading…
Add table
Add a link
Reference in a new issue