jtheoof / swappy Goto Github PK
View Code? Open in Web Editor NEWA Wayland native snapshot editing tool, inspired by Snappy on macOS
License: MIT License
A Wayland native snapshot editing tool, inspired by Snappy on macOS
License: MIT License
This issue was brought up by @apiraino
Ways to reproduce:
grim -g "$(slurp)" - | swappy -f -
The temporary file created in (usually) /tmp
remains there after swappy exits.
I've just downloaded it on Arch Linux with Sway to test it out, but after I took the screenshot, the icons are white on white background.
Is there a way to set the dark theme for the background?
P.s: The problem is probably because I also use Dolphin in the dark mode, so the GTK icons must be white, but other parts of UI aren't.
Thanks for a great piece of very useful software!
Is it possible to configure swappy to automatically save an image on close?
It's a pity, but it does.
I have installed swappy from your Fedora repo.
And I use this command to achieve such effect:
export NOW=$(date '+%s'); gnome-screenshot -a -f /tmp/$NOW.png; swappy -f /tmp/$NOW.png -o -
When I click a button 'copy to clipboard' my wayland session crashes to login.
I used to
grimshot save area /home/user/img/grimshots/$(zenity --entry --text "Set filename:" --entry-text ".png") | wl-copy -p
and want to replace by
grimshot save area - | swappy -f -
My first problem is #61 (comment)
Second is that swappy doesn't echo the output filename to let me autocopy this with | wl-copy -p
Then a question : why swappy doesn't exit when saving the file ?
I would, when finish editing and set filename in editor panel, save to "exit swappy and print file path on stdout"
I've recently moved from Gnome to Sway, so I don't have other systems/accounts to test on just yet.
I used Flameshot on X11 and was very excited to find this sceenshot tool for use with Sway...
The swappy
build went find with no errors, but when I try to draw I can only get a point, not a line...
Not sure if it's something caused by my Dygma keyboard? Hasn't been an issue with any other app though...
I tried both my Elecom Huge tackball and a regular mouse, but had the same issue on each. I took a short screen capture. You can't see when the button is pressed, but I'm attempting to draw any shape, but the most I can get is a point.
Note, I tried on the latest swappy release, v1.3.1 and using a copy of the latest git code.
swappy v1.5.1
wlroots v0.12.0
Ubuntu 21.04
[
{
"identifier": "1133:16419:Logitech_Wireless_Keyboard_PID:4023",
"name": "Logitech Wireless Keyboard PID:4023",
"vendor": 1133,
"product": 16419,
"type": "pointer",
"libinput": {
"send_events": "enabled",
"natural_scroll": "disabled"
}
},
{
"identifier": "1133:16419:Logitech_Wireless_Keyboard_PID:4023",
"name": "Logitech Wireless Keyboard PID:4023",
"vendor": 1133,
"product": 16419,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled",
"natural_scroll": "disabled"
}
},
{
"identifier": "1133:16418:Logitech_Wireless_Mouse_PID:4022",
"name": "Logitech Wireless Mouse PID:4022",
"vendor": 1133,
"product": 16418,
"type": "pointer",
"libinput": {
"send_events": "enabled",
"accel_speed": 0.0,
"accel_profile": "adaptive",
"natural_scroll": "disabled",
"left_handed": "disabled",
"middle_emulation": "disabled",
"scroll_method": "none",
"scroll_button": 274
}
},
{
"identifier": "1133:2142:Logitech_BRIO_Consumer_Control",
"name": "Logitech BRIO Consumer Control",
"vendor": 1133,
"product": 2142,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
},
{
"identifier": "1133:2142:Logitech_BRIO",
"name": "Logitech BRIO",
"vendor": 1133,
"product": 2142,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
},
{
"identifier": "4617:8705:Dygma_Raise",
"name": "Dygma Raise",
"vendor": 4617,
"product": 8705,
"type": "pointer",
"libinput": {
"send_events": "enabled",
"natural_scroll": "disabled",
"left_handed": "disabled",
"middle_emulation": "disabled",
"calibration_matrix": [
1.0,
0.0,
0.0,
0.0,
1.0,
0.0
]
}
},
{
"identifier": "4617:8705:Dygma_Raise_Mouse",
"name": "Dygma Raise Mouse",
"vendor": 4617,
"product": 8705,
"type": "pointer",
"libinput": {
"send_events": "enabled",
"accel_speed": 0.0,
"accel_profile": "adaptive",
"natural_scroll": "disabled",
"left_handed": "disabled",
"middle_emulation": "disabled",
"scroll_method": "none",
"scroll_button": 274
}
},
{
"identifier": "4617:8705:Dygma_Raise_System_Control",
"name": "Dygma Raise System Control",
"vendor": 4617,
"product": 8705,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
},
{
"identifier": "4617:8705:Dygma_Raise_Keyboard",
"name": "Dygma Raise Keyboard",
"vendor": 4617,
"product": 8705,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
},
{
"identifier": "4617:8705:Dygma_Raise_Consumer_Control",
"name": "Dygma Raise Consumer Control",
"vendor": 4617,
"product": 8705,
"type": "pointer",
"libinput": {
"send_events": "enabled",
"natural_scroll": "disabled"
}
},
{
"identifier": "4617:8705:Dygma_Raise_Consumer_Control",
"name": "Dygma Raise Consumer Control",
"vendor": 4617,
"product": 8705,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled",
"natural_scroll": "disabled"
}
},
{
"identifier": "1390:269:ELECOM_TrackBall_Mouse_HUGE_TrackBall",
"name": "ELECOM TrackBall Mouse HUGE TrackBall",
"vendor": 1390,
"product": 269,
"type": "pointer",
"libinput": {
"send_events": "enabled",
"accel_speed": 0.0,
"accel_profile": "adaptive",
"natural_scroll": "disabled",
"left_handed": "disabled",
"middle_emulation": "disabled",
"scroll_method": "none",
"scroll_button": 274
}
},
{
"identifier": "1390:269:ELECOM_TrackBall_Mouse_HUGE_TrackBall",
"name": "ELECOM TrackBall Mouse HUGE TrackBall",
"vendor": 1390,
"product": 269,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled",
"accel_speed": 0.0,
"accel_profile": "adaptive",
"natural_scroll": "disabled",
"left_handed": "disabled",
"middle_emulation": "disabled",
"scroll_method": "none",
"scroll_button": 274
}
},
{
"identifier": "1452:4362:Apple,_Inc._USB-C_to_3.5mm_Headphone_Jack_Adapter",
"name": "Apple, Inc. USB-C to 3.5mm Headphone Jack Adapter",
"vendor": 1452,
"product": 4362,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
},
{
"identifier": "0:3:Sleep_Button",
"name": "Sleep Button",
"vendor": 0,
"product": 3,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
},
{
"identifier": "0:1:Power_Button",
"name": "Power Button",
"vendor": 0,
"product": 1,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
},
{
"identifier": "0:1:Power_Button",
"name": "Power Button",
"vendor": 0,
"product": 1,
"type": "keyboard",
"xkb_layout_names": [
"English (US)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "English (US)",
"libinput": {
"send_events": "enabled"
}
}
]
Hi.
I just did fresh swappy install and it takes incredibly long to start each time (cca 20s).
Either I do something like:
grim -g "$(slurp)" - | swappy -f -
or swappy -f name_of_image.png
in the terminal the wait is the same.
Once it starts it functions OK, saves, clipboard work, drawing works etc.
PC is not topping out with resources and while waiting on swappy, I can open terminals, browsers and other applications instantly.
Operating System: Arch Linux (using sway)
Kernel: Linux 5.13.8-arch1-1
Architecture: x86-64
Would is be possible to add a close button?
As with many sway installs, a title bar is mostly non-existent. I think a close button would be beneficial.
The way the render works is to re-render all the paints every time. This makes the tool become more and more laggy as more things are being drawn. Some paints are heavier than others, for example, the new blur tool is quite intensive. Once a blur has been rendered, no need to re-render it every time, only for some undo/redo, or clear.
Need to find a better to not re-render every time. For example use the last drawn cairo surface as base for new paints and flag the rendered paints.
When I try to use swappy with input through stdin (e.g. the output of grim or simply just cat
-ing a png file) under PowerShell Core (my default shell), I get the following error:
** (swappy:9317): WARNING **: 12:59:14.433: error while loading png file: /tmp/swappy-stdin-O1S1N0.png - cairo status: out of memory
The same works perfectly with bash. Does anyone have any idea as to what could be causing this issue, or how it could be fixed? My only faint guess is that it might have to do with the fact, that pwsh
does not have the <
operator for file to stdin redirection, but piping usually works just the same.
(In the meantime as a workaround I can set up my hotkeys to run through bash, but ideally this extra step shouldn't be needed.)
Can you please add disable notify option in config?
Getting a core dump when feeding swappy with a empty input like so: swappy -f - -o -
, this also happens when using it with grim but pressing escape before selecting area
#0 0x00007ffff7cf5ba8 in g_log_structured_array () at /usr/lib/libglib-2.0.so.0
#1 0x00007ffff7cf5e76 in g_log_default_handler () at /usr/lib/libglib-2.0.so.0
#2 0x00007ffff7cf72b9 in g_logv () at /usr/lib/libglib-2.0.so.0
#3 0x00007ffff7cf7560 in g_log () at /usr/lib/libglib-2.0.so.0
#4 0x000055555555cf7d in pixbuf_init_from_file ()
#5 0x000055555555d5d5 in ()
#6 0x00007ffff7b4b658 in () at /usr/lib/libgio-2.0.so.0
#7 0x00007ffff7de2ddf in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#8 0x00007ffff7e0bfbd in () at /usr/lib/libgobject-2.0.so.0
#9 0x00007ffff7dff2db in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#10 0x00007ffff7e00210 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#11 0x00007ffff7ba9d27 in () at /usr/lib/libgio-2.0.so.0
#12 0x00007ffff7bab00a in () at /usr/lib/libgio-2.0.so.0
#13 0x00007ffff7bab19a in g_application_run () at /usr/lib/libgio-2.0.so.0
#14 0x0000555555559092 in main ()
I often want to take a screenshot, copy it in somewhere then immediately delete it from disk to keep things tidy. When using Swappy as my "screenshot GUI", my usual workflow currently looks like this:
grim
and opens the resulting file in SwappyI think it would be nice to add a "Delete" button when Swappy is launched with the -f
argument pointing to a file. The button could have a trash can icon and be placed to the left of the copy button. When pressed, Swappy would exit, delete the file and display a notification saying "Screenshot deleted".
As an extra convenience, it could have a keyboard shortcut bound to the delete key by default.
When the image is passed via STDIN, the button would be hidden or greyed out.
This would simplify the previous workflow a lot:
grim
and opens the resulting file in SwappyIn addition to opening a file with swappy -f "~/Desktop/my-gnome-saved-file.png"
, which is great, you could also create a /usr/share/applications/swappy.desktop
entry, and register opening png / jpg files, e.g. like this:
MimeType=image/jpeg;image/jpg;image/png;
Hello,
first thing first, thank you so much for this amazing app, I use it daily and it's a time saver!
If I can suggest a very small addition would be allowing to close the app using CTRL+q or an option to remap the keys in the config.
I use sway and CTRL+q is the keybind that closes app almost everywhere so I keep hitting it in swappy but nothing happens, then I remember it's CTRL+w.
A very minor annoyance for an amazing app, thanks again and keep up the great work!
While you can preselect with slurp, there are situations where more refinement is useful. A cropping tool would be most handy.
Swappy should show info about selected tool in the top bar, when the toolbar is closed:
Hi,
I get
The Meson build system
Version: 0.52.1
Source dir: /tmp/nix-build-swappy-2020-02-26.drv-0/source
Build dir: /tmp/nix-build-swappy-2020-02-26.drv-0/source/build
Build type: native build
Project name: swappy
Project version: 1.0.0
C compiler for the host machine: /nix/store/1kn7fi3hhi33jms3113riyzwyn2yqpqd-gcc-wrapper-9.2.0/bin/cc (gcc 9.2.0 "gcc (GCC) 9.2.0")
C linker for the host machine: GNU ld.bfd 2.31.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /nix/store/w6pfcj87889hgz0f77blq59z85mdrsh8-pkg-config-0.29.2/bin/pkg-config (0.29.2)
Run-time dependency cairo found: YES 1.16.0
Run-time dependency pango found: YES 1.44.7
Library m found: YES
Library rt found: YES
Run-time dependency gtk+-3.0 found: YES 3.24.13
Run-time dependency wayland-client found: YES 1.18.0
Run-time dependency wayland-cursor found: YES 1.18.0
Run-time dependency wayland-protocols found: YES 1.18
Run-time dependency libnotify found: YES 0.7.8
Found pkg-config: /nix/store/w6pfcj87889hgz0f77blq59z85mdrsh8-pkg-config-0.29.2/bin/pkg-config (0.29.2)
Program wayland-scanner found: YES (/nix/store/iy3kwxmv486mjm9qd9mszrh7by92bjch-wayland-1.18.0/bin/wayland-scanner)
Program scdoc found: YES (/nix/store/6fl4pl3l742in7pzndxw2syg1hrzykhf-scdoc-1.10.1/bin/scdoc)
Program sh found: YES (/nix/store/1iaxkm0941nj1m4m5g4fxgg4cq5jckf0-bash-4.4-p23/bin/sh)
Build targets in project: 5
Found ninja-1.10.0 at /nix/store/5x6l9s9idzf44np1wz1kv8pyq246q98h-ninja-1.10.0/bin/ninja
meson: enabled parallel building
building
build flags: -j4 -l4
[17/31] Compiling C object 'swappy@exe/src_buffer.c.o'.res_swappy.c.o'.ed_wlr-screencopy-unstable-v1-protocol.c.o'.
FAILED: swappy@exe/src_buffer.c.o
/nix/store/1kn7fi3hhi33jms3113riyzwyn2yqpqd-gcc-wrapper-9.2.0/bin/cc -Iswappy@exe -I. -I.. -I../include -Ires -I/nix/store/a92yhf0icjl9lh553s4qjchdsm8lyzsy-cairo-1.16.0-dev/include/cairo -I/nix/store/1zlkr4x0bvxw3mn65chw9v3b48n8jh52-freetype-2.10.1-dev/include/freetype2 -I/nix/store/1zlkr4x0bvxw3mn65chw9v3b48n8jh52-freetype-2.10.1-dev/include -I/nix/store/5ad0cyv6lxpkk2m1prcrasdp2pysz73q-glib-2.62.4-dev/include -I/nix/store/5ad0cyv6lxpkk2m1prcrasdp2pysz73q-glib-2.62.4-dev/include/glib-2.0 -I/nix/store/vwvjrh97byihk40gwl26f0lnb3w405cv-glib-2.62.4/lib/glib-2.0/include -I/nix/store/sm843466f7cvhf1b804jjlay1nv7fyq0-pango-1.44.7-dev/include/pango-1.0 -I/nix/store/70yjv9sr9mhf75bliwmmxgyr37mx9lac-harfbuzz-2.6.4-dev/include/harfbuzz -I/nix/store/i5yw4gdhknqahzhkaqjfbgc9ydb2885w-gtk+3-3.24.13-dev/include/gtk-3.0 -I/nix/store/vmm5hrcbqrb7b605dnir17qbiz85x17n-atk-2.34.1-dev/include/atk-1.0 -I/nix/store/4w16ai3cx8sp7av9kc432w34r4fpdmfp-gdk-pixbuf-2.40.0-dev/include/gdk-pixbuf-2.0 -I/nix/store/i1mssjnbih9czf12fcda1883pvkirgss-libnotify-0.7.8-dev/include -I/nix/store/iy3kwxmv486mjm9qd9mszrh7by92bjch-wayland-1.18.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Werror -std=c11 -Wno-unused-parameter -DHAVE_LIBNOTIFY -DHAVE_WAYLAND_PROTOCOLS -MD -MQ 'swappy@exe/src_buffer.c.o' -MF 'swappy@exe/src_buffer.c.o.d' -o 'swappy@exe/src_buffer.c.o' -c ../src/buffer.c
../src/buffer.c: In function 'randname':
../src/buffer.c:12:3: error: implicit declaration of function 'clock_gettime' [-Werror=implicit-function-declaration]
12 | clock_gettime(CLOCK_REALTIME, &ts);
| ^~~~~~~~~~~~~
../src/buffer.c:12:17: error: 'CLOCK_REALTIME' undeclared (first use in this function)
12 | clock_gettime(CLOCK_REALTIME, &ts);
| ^~~~~~~~~~~~~~
../src/buffer.c:12:17: note: each undeclared identifier is reported only once for each function it appears in
../src/buffer.c: In function 'create_shm_file':
../src/buffer.c:45:7: error: implicit declaration of function 'ftruncate'; did you mean 'strncat'? [-Werror=implicit-function-declaration]
45 | if (ftruncate(fd, size) < 0) {
| ^~~~~~~~~
| strncat
cc1: all warnings being treated as errors
[20/31] Compiling C object 'swappy@exe/src_render.c.o'.'.
ninja: build stopped: subcommand failed.
Hey, just a quick question, I saw your commit 57c707a describing how to build i18n, and I want to make sure I'm doing everything correctly for your package once I moved it to Arch [community], but I never worked with i18n before - what is supposed to happen if I change ninja -C build
to ninja -C build swappy-pot
? Or in other words, how can I test that everything is good? I don't see any changes to the package, that's why I'm a bit confused 🤔
PKGBUILD is pretty much how you made it for AUR: https://github.com/archlinux/svntogit-community/blob/dbc2f1633d5abf5c112f17f03e12c1ec335259f4/trunk/PKGBUILD#L22-L23
Hi! Thank you for great tool!
Would be great if there would be possibility to draw only straight lines, eg shift + Brush draws only horizontal or vertical line as you move the pointer.
Hi again 🙂
I'm on HiDPI screen (scaling factor 2.5), and I noticed that sometimes the window size is completely off, like the height of swappy window would be two times bigger than the height of my screen.
Turns out this is caused by comparing different units when deciding on window size.
Lines 555 to 569 in f3a4ae9
My screen is 3840x2400px
. I'm opening a 1237x2397px
image with swappy -f image.png
and here's what is logged:
** INFO: 23:26:13.993: size of image: 1237x2397
** INFO: 23:26:14.024: size of monitor at window: 1536x960
** INFO: 23:26:14.024: size of window to render: 1152x2232
Size of image is used as-is, while size of monitor is divided by scale value of 2.5
, so comparing those values is wrong.
As you can imagine, swappy window is now 2232*2.5=5580px
in height!
I wasn't sure which way is proper to fix the issue, but I hope this gives you enough information to come up with a quick patch.
Thanks!
P.S. Have I already mentioned how awesome your tool is? It is! 😄
P.P.S. Excited about your rust refactoring branch 😉
The current name format is nice, but I would love to be able to change it through the config file.
Thanks!
Hi Jeremy,
Your friendly local Fedora packager here.
I'm having problems with verifying the 1.3.0 tarball:
$ gpg2 --keyring=$PWD/6A6B35DBE9442683.gpg --verify swappy-1.3.0.tar.gz.sig swappy-1.3.0.tar.gz
gpg: Signature made Thu 18 Feb 2021 11:57:39 AEST
gpg: using RSA key F44D05A50F6C9EB5C81BCF966A6B35DBE9442683
gpg: BAD signature from "Jeremy Attali [email protected]" [unknown]
I notice that the 1.3.0 release does not have a 'Verified' button next to it (1.2.0 does have that button and it points to public key 6A6B35DBE9442683
Am I using the right public key?
Thanks
Hi!
It seems that the following dependencies are not listed in the README:
Maybe you wanna update that file.
(Context: I'm packaging this for nixos).
See description.
Config:
cat .config/swappy/config ~
[Default]
save_dir=$HOME/screenshots
save_filename_format=%Y-%m-%d-%H:%M:%S.png
show_panel=true
line_size=5
text_size=20
text_font=sans-serif
When I click on save in swappy, it creates a file named like this instead:
'Swappshot Mon Jan 25 14:18:05 2021.png'
Hi,
First thanks for this cool project !
Cool you please add the basic blur tool in swappy?
Best regards
Example:
date_format=%Y-%m-%d_%H-%M-%S-%N
file_output_name=Swappshot-$date_format.png
Filename: Swappshot-2020-11-09_17-12-56-924287207.png
I was experimenting with the save_file_fmt config and it appears re-using the same placeholder twice makes the save fail.
config parameter:
save_filename_format=%Y-%m-swappy-%Y%m%d-%H%M%S.png
Result:
** (swappy:1600448): CRITICAL **: 04:36:19.122: unable to save drawing area to pixbuf: Failed to open “/home/jinks/Pictures/Screenshots/2021-01-swappy-20210120-043619.p��e �\u007f” for writing: Invalid or incomplete multibyte or wide character
With scdoc 1.11.0 I get:
[ 4s] ninja: Entering directory `build'
[ 4s] [1/19] glib-compile-resources ../res/swappy.gresource.xml --sourcedir ../res --internal --generate --target res/swappy.h
[ 4s] [2/19] /usr/bin/sh -c '/usr/bin/scdoc < ../swappy.1.scd > swappy.1'
[ 4s] FAILED: swappy.1
[ 4s] /usr/bin/sh -c '/usr/bin/scdoc < ../swappy.1.scd > swappy.1'
[ 4s] Error at 17:58: Cannot nest inline formatting (began with * at 17:53)
[ 4s] [3/19] glib-compile-resources ../res/swappy.gresource.xml --sourcedir ../res --internal --generate --target res/swappy.c --dependency-file res/swappy
.c.d
[ 4s] [4/19] cc -Iswappy@exe -I. -I.. -I../include -Ires -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/uuid -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/l
ibmount -I/usr/include/blkid -I/usr/include/gtk-3.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/wayland -I/usr/include/libxkbcomm
on -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -fdiagnostics-color=a
lways -pipe -D_FILE_OFFSET_BITS=64 -Werror -std=c11 '-DSWAPPY_VERSION="1.2.0"' -Wno-unused-parameter -DHAVE_LIBNOTIFY '-DGETTEXT_PACKAGE="intltest"' -O2 -Wall
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -pthread
-MD -MQ 'swappy@exe/src_algebra.c.o' -MF 'swappy@exe/src_algebra.c.o.d' -o 'swappy@exe/src_algebra.c.o' -c ../src/algebra.c
[ 4s] [5/19] /usr/bin/meson --internal msgfmthelper ../src/po/swappy.desktop.in src/po/swappy.desktop desktop /home/abuild/rpmbuild/BUILD/swappy-1.2.0/src/
po
So:
[ 4s] /usr/bin/sh -c '/usr/bin/scdoc < ../swappy.1.scd > swappy.1'
[ 4s] Error at 17:58: Cannot nest inline formatting (began with * at 17:53)
Following #17, the blur is not effective enough on scaled displays. Even smashing all the way to 500, the user has to do many passes to effectively blur sensitive texts on terminal or code editor.
Example trying to blur the following text on black background will lead to:
blur times (level 500) | secret password
----------------------------------------
0 | passzero
1 | passone
2 | passtwo
5 | passfive
10 | passten
Ideas:
When I use the "copy to clipboard" function, the PNG contents are copied to the clipboard, but wl-clipboard assumes the data is text:
wl-paste -l
text/plain
text/plain;charset=utf-8
TEXT
STRING
UTF8_STRING
as a result the content cannot be pasted anywhere usefully. specifiying -t image/png
to wl-copy on the command line should solve this issue.
As for #61 (comment)
Is there a way to add an optional custom dir button in the editor panel ?
When saving & generating the new image, are painted over areas completely lost? I don't plan on using this for work or anything with a lot at stake. But if I wanted to maintain some anonymity when sharing things like screenshots, could the original portions of the image that were painted over be recovered? Thanks.
Right now it's impossible to resize the window, to make it fullscreen or non-floating (if you do, you can't draw inside, for example).
When resizing a window, the image inside should be scaled appropriately.
This would have been a workaround for #56, but I'm also thinking that sometimes it could be convenient to just open swappy window in full screen for comfortable editing.
This is on fedora:
gcc -Iswappy@exe -I. -I.. -I../include -Ires -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/gtk-3.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Werror -std=c11 '-DSWAPPY_VERSION="1.1.0"' -Wno-unused-parameter -DHAVE_LIBNOTIFY -O2 -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard -pthread -MD -MQ 'swappy@exe/src_config.c.o' -MF 'swappy@exe/src_config.c.o.d' -o 'swappy@exe/src_config.c.o' -c ../src/config.c
In file included from /usr/include/glib-2.0/glib.h:62,
from ../include/swappy.h:3,
from ../include/config.h:1,
from ../src/config.c:1:
../src/config.c: In function ‘load_config_from_file’:
../src/config.c:118:11: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘guint64’ {aka ‘long long unsigned int’} [-Werror=format=]
118 | "line_size is not a valid value: %ld - see man page for details",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119 | line_size);
| ~~~~~~~~~
| |
| guint64 {aka long long unsigned int}
../src/config.c:118:46: note: format string is defined here
118 | "line_size is not a valid value: %ld - see man page for details",
| ~~^
| |
| long int
| %lld
In file included from /usr/include/glib-2.0/glib.h:62,
from ../include/swappy.h:3,
from ../include/config.h:1,
from ../src/config.c:1:
../src/config.c:135:11: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘guint64’ {aka ‘long long unsigned int’} [-Werror=format=]
135 | "text_size is not a valid value: %ld - see man page for details",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136 | text_size);
| ~~~~~~~~~
| |
| guint64 {aka long long unsigned int}
../src/config.c:135:46: note: format string is defined here
135 | "text_size is not a valid value: %ld - see man page for details",
| ~~^
| |
| long int
| %lld
cc1: all warnings being treated as errors
This patch fixes it (but is obviously not 'smooth'):
diff -Nur swappy-1.1.0-orig/src/config.c swappy-1.1.0/src/config.c
--- swappy-1.1.0-orig/src/config.c 2020-06-23 13:05:18.000000000 +1000
+++ swappy-1.1.0/src/config.c 2020-06-30 15:36:59.110245105 +1000
@@ -115,7 +115,11 @@
config->line_size = line_size;
} else {
g_warning(
+#if defined(__arm__) || defined(__i686__)
+ "line_size is not a valid value: %lld - see man page for details",
+#else
"line_size is not a valid value: %ld - see man page for details",
+#endif
line_size);
}
} else {
@@ -132,7 +136,11 @@
config->text_size = text_size;
} else {
g_warning(
+#if defined(__arm__) || defined(__i686__)
+ "text_size is not a valid value: %lld - see man page for details",
+#else
"text_size is not a valid value: %ld - see man page for details",
+#endif
text_size);
}
} else {
I've recently discovered this tool and implemented it into my daily workflow. However for some reason the images when copied to clipboard or saved are cut off or zoomed in. Here is an example
This picture is a screen shot straight from grim into wl-copy
This is the "same" screen shot which goes into swappy then into my clipboard:
I'm running sway 1.0 with wlroots 0.10.0 (latest on arch)
Let me know if there is anything else that you may need to debug!
I'm getting the following error when trying to use swappy.
** (swappy:103534): WARNING **: 13:22:12.535: error while loading png file: /data/downloads/avatar.jpg - cairo status: out of memory
I used the following commands
$ swappy -f /data/downloads/avatar.jpg
$ grimshot | swappy -f -
Both of them produce the same error message.
Some information which might be helpful.
OS - Arch Linux 5.10.13
Swappy Version - 1.2.1
Terminal - Kitty, QTerminal
Shells - Bash, Fish
Display Server - Wayland
Window Manager - sway version 1.5.1
See: https://bugzilla.redhat.com/show_bug.cgi?id=1941697 which I copy here for convenience.
Description of problem:
the swappy desktopfile is useless:
TryExec=swappy
Exec=swappy -f %F
Terminal=false
Type=Application
If the app is started with this desktopfile, it starts this way:
"swappy -f "
which results in:
Mär 22 15:47:46 fedorapine sm.puri.Phosh.desktop[68835]: Für -f wird ein Argument benötigt
German for "you need an argument for -f option" .
Swappy is meant to be started after an image is taken i.e. by grim and then given to swappy as argument.
Solution:
Add a dependency for "grim" and "slurp", so those get installed along side swappy.
Change the "Exec=" to "Exec=swappy-wrap" and create: /usr/local/sbin/snappy-wrap
like this:
# cat /usr/local/sbin/swappy-wrap
#!/bin/bash
grim -g "$(slurp)" - | swappy -f -
Now Snappy works as indented, which is also flawed, but thats a different story / bugreport.
Version-Release number of selected component (if applicable):
Name : swappy
Version : 1.3.1
Release : 1.fc35
Architecture: aarch64
I prefer to store screenshots in a specific directory that isn't $XDG_CONFIG_HOME/Desktop. Can you add support for specifying an output dir and filename on save?
Related, can the output be sent back to stdout so I can send it to something like pngquant? My current workflow involves sending from grim to pngquant, and I'd like to insert swappy in between so I can annotate the screenshots before sending them back to stdout.
Hello again!
This tool keeps putting a smile on my face every workday and I would like to thank you again for creating it.
My main use case is highlighting specific parts of a screenshot - because I'd use grim/slurp directly if it wasn't. Therefore, I almost always need to bring up the paint panel (then select rectangle/arrow because I don't want to annoy people with shitty mouse drawings). It would be pretty cool if I could force-enable the paint panel in the config file - and probably even the default tool selection.
What do you think about adding such a feature?
Relates to #1
Some users would like to chain swappy
into other other tools. Let's add some piping love.
grim -g "$(slurp)" - | swappy -f -
Produces the following output when I try to save the file:
(swappy:3089974): Gdk-CRITICAL **: 18:42:54.734: gdk_pixbuf_get_from_surface: assertion 'width > 0 && height > 0' failed
(swappy:3089974): GdkPixbuf-CRITICAL **: 18:42:54.734: gdk_pixbuf_savev: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(swappy:3089974): GLib-GObject-CRITICAL **: 18:42:54.736: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
I get a notification that the file has been saved, but it doesn't exit on the disk.
And swappy -f hello.png
fails with:
** (swappy:3077837): WARNING **: 18:38:36.490: error while loading png file: hello.png - cairo status: file not found
swappy --version
-> swappy version 1.2.1-8e5b959 (Aug 3 2020, branch 'master')
I run Arch Linux and I have gtk3, glib2 and glibc installed.
The command chain grim -g "$(slurp)" - | swappy -f - -o -
no longer produces any output for me.
I believe this started today, so maybe something in 320dae0 broke it?
Saving pictures regularly seems to be unaffected
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.