Git Product home page Git Product logo

nextshot's Introduction

Nextshot logo

Quickly take screenshots on Linux—sharing instantly with Nextcloud

GitHub release AUR version Build Status GitHub issues License


Nextshot enables quick and easy capture of the desktop, a window or selection—either instantly or after a delay. Images can be copied directly to clipboard, or shared automatically via Nextcloud (the default) so you can paste the public link in chats.

Compatibility

From the start, the primary goal has been to work with both i3 and Sway. Since the release of 1.0, this has largely been achieved. While Nextshot will work on Sway and likely most X11-based environments, the nature of Wayland means extra work will be required for eventual compatibility with compositors other than Sway.

TL;DR: YMMV

Table of Contents

Installation

Arch Linux

NextShot can be installed from the AUR as nextshot, though its dependencies vary based on your environment:

# To use in i3 (or other X11-based environments)
sudo pacman -S --asdeps imagemagick slop xclip xdotool yad

# To use in Sway
sudo pacman -S --asdeps grim slurp wl-clipboard yad

For more information on dependencies, run nextshot --deps after install. Note that Nextshot will not automatically
install any keyboard shortcuts. A set of recommended keybindings is provided below for users of i3 and Sway.

Manual Install

For other distributions, install dependencies as above then run the following to install Nextshot:

git clone -b master https://github.com/dshoreman/nextshot.git
cd nextshot && sudo make install

Recommended Shortcuts

To have Nextshot's primary functions bound to the Print Screen key on i3 and Sway, add the following to your config file in ~/.config/i3 and/or ~/.config/sway respectively:

bindsym Print exec --no-startup-id "nextshot -m"
bindsym Mod4+Print exec --no-startup-id "nextshot -w"
bindsym Shift+Print exec --no-startup-id "nextshot -a"

bindsym Ctrl+Print exec --no-startup-id "nextshot -mc"
bindsym Ctrl+Mod4+Print exec --no-startup-id "nextshot -wc"
bindsym Ctrl+Shift+Print exec --no-startup-id "nextshot -ac"

These bindings will have PrtScr capture the current screen, Shift+PrtScr capture an area, and Super+PrtScr capture a window—each uploading automatically to Nextcloud and copying the share link to your clipboard.

When combined with ctrl, the raw image will be copied to clipboard instead of uploading to Nextcloud.

Usage

Nextshot can be used in a few ways, but it's most flexible when run in a terminal. Some of the more common usage examples are listed below. For details on all available CLI options, run nextshot --help.

Screenshot Modes

The following examples will upload a screenshot to Nextcloud and copy the share link. To bypass Nextcloud and instead copy the image to clipboard, add the -c or --clipboard option.

  • Capture an area/selection

    nextshot -a or nextshot --area

  • Capture a specific window

    nextshot -w or nextshot --window

  • Capture the active display

    nextshot -m or nextshot --monitor

  • Capture all outputs

    nextshot -f or nextshot --fullscreen

Image capture can also be delayed by passing the -d, --delay option followed by a TIMEOUT, for example nextshot -d3.5 or nextshot --delay 2m to delay 3.5 seconds or 2 minutes respectively.

To abort selection in the --area or --window modes, press the Escape key.

Upload Modes

There are two modes that support uploading an existing image to Nextcloud.

  • Share an image from the clipboard

    nextshot -p or nextshot --paste

  • Share an image from the local filesystem

    nextshot --file kittens.jpg

    Note: The --file option bypasses the rename prompt and may overwrite existing files if it is already in Nextcloud. To avoid issues, first rename or copy the image to ensure a unique filename in Nextcloud.

Tray Menu

If you have Yad installed, you can use Nextshot via its tray icon. A normal click will trigger Nextshot's --area screenshot mode, while right clicking will open a menu with quick access to most of Nextshot's functions.

Preview of Nextshot tray menu

The Nextshot tray menu can be started with nextshot -t, which you can add to .xinitrc or your i3/Sway config to have it automatically started when you login.

Configuration

The first time you run Nextshot, one of two things will happen. If you don't have Yad, you'll be prompted to open an example config ready for editing in your $EDITOR. See below for details on all available options.

If you do have Yad, a GUI will open for you to enter your settings. Follow the instructions and click Ok. You'll now see a preview of the config - correct any mistakes and click Save when you're done.

Example nextshot.conf

The nextshot.conf file should be stored in the ~/.config/nextshot directory, which is created automatically when you first run Nextshot. It's sourced as a Bash script, so config options are assigned much the same way as you would define any regular Bash variables:

server='https://example.com/nextcloud'
username='jenBloggs'
password='rcPn0-zyKC9-Dt0Vn-LG9Cn-Aa3EE'
savedir='Screenshots'
rename=false

Available Options

server - required

This is the base URL to your Nextcloud instance, including http[s]:// but excluding the trailing /. It may be for example https://nc.example.com or https://example.com/nextcloud depending on whether you use a subdomain specific to Nextcloud or simply host it in a folder on your main website.


username - required

The username you use for Nextcloud, used to authenticate with the API when uploading screenshots.


password - required

This is not your Nextcloud account password but an App Password that you create specifically for Nextshot, to be used in conjunction with your username for API authentication.

You can create an App password by going to Settings > Personal > Security in your Nextcloud UI.

Assuming your Nextcloud is hosted at nc.example.com:

  1. Head to https://nc.example.com/settings/user/security
  2. Enter Nextshot in the App name input
  3. Click Create new app password and enter your account password to confirm
  4. Copy the resulting App Password to your config, then click Done

The app password will be 5 blocks of alphanumeric characters, separated by dashes.


savedir - required

The name of a folder on your Nextcloud instance which should be used to upload screenshots.

This is relative to your Nextcloud root. To have your screenshots uploaded to a Screenshots folder inside the root-level Photos directory, you would set savedir='Photos/Screenshots' in your config file.

Note that this folder is not created automatically, so it must exist in Nextcloud before running Nextshot.


link_previews - optional

When set to true, Nextshot will append /preview to generated share links. With this option enabled, clicking the link will take you directly to the full-size image rather than Nextcloud's default share UI.

Defaults to false


pretty_urls - optional

When disabled (set to false), this will insert /index.php in share links, after the Server URL.
Leave this set to true (enabled) if your Nextcloud server has Pretty URLs enabled.

Defaults to true


format - optional

Set the default image format and file extension for saving screenshots.
Supported values are png, jpg or jpeg.

Defaults to png.


rename - optional

When you set this option to true, Nextshot will prompt you to enter a custom filename before uploading to Nextcloud. Be sure to include the extension as it will not be added automatically. Triggering Nextshot from the [#tray-menu](tray menu) or a #recommended-shortcuts will require Yad for the rename prompt.

Defaults to false.


hlColour - optional

Set this to customise the highlight colour when selecting an area or window to screenshot.

It should be specified as comma-separated RGB so that Nextshot can parse the individual colour values and pass them along to either Slop or Slurp, depending on whether you use X11 or Wayland.

Defaults to 255,100,180.

Troubleshooting

Nextshot is detecting the wrong environment

In some cases it may be that Nextshot's environment detection doesn't quite work as expected. One example of this might be if your system has both X11 and Wayland. If you were to start a tmux session under X11 then switch to Wayland and run Nextshot from within tmux, it will think you're running under the X11 environment when that's not really the case.

To fix this you can bypass the default detection method:

nextshot --env=wayland ...

For a more permanent fix, you can set or export the NEXTSHOT_ENV environment variable:

export NEXTSHOT_ENV=wayland
nextshot ...

# or

NEXTSHOT_ENV=wayland nextshot ...

Likewise if you're running from X11 but Nextshot detects Wayland, you can set --env or NEXTSHOT_ENV to x11. For more details and possible values, see nextshot --help.

Everything goes blurry when trying to take a screenshot

If you're using Slop, it works by creating a window the size of the screen. If you also happen to use Picom with background blurring enabled, you might struggle to see anything.

This can be fixed by excluding the Slop window in your ~/.config/picom/picom.conf:

blur-background-exclude = [
    "name = 'slop'"
]

The tray icon shows up, but right-click doesn't do anything!

There was a bug introduced to Yad in v1.0 that breaks context menus in the tray icons it creates.

This issue was fixed in v1cont/yad@06de51c, which was released as part of Yad v5.0. If you're still running an older version, update to v5 or greater and the tray menu will be working again. If you still have problems, please create an issue.

Known Issues

Contributing

If you find Nextshot useful and would like to contribute, there are a few ways you can help:

  • Vote for the nextshot package on the AUR
  • Report any bugs you find while using Nextshot
  • Submit a feature request if there's something you'd like added
  • Send a PR if you know some Bash! Check the open issues for ideas
  • Finally, donate via PayPal or Liberapay (but only if you can afford to)

Nextshot camera icon provided by Icons8.

nextshot's People

Contributors

boppy avatar dshoreman avatar sstutz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nextshot's Issues

Need better handling of config on first run

If yad isn't available and there's no config file, NextShot should generate one automatically after prompting the user. Once created, it should then open it for editing in the default editor.

Something like this:

if $userSaidYes; then
    echo "$theConfig" > "$_CONFIG_FILE" && $EDITOR "$_CONFIG_FILE"
else
    exit 1
fi

Use slop for selections

They're much more configurable than ImageMagick's import command, and they look nicer.

Should also fix issues where sometimes the selection lines glitch out and end up part of the screenshot.

Cache screenshots

While storing screenshots temporarily at /tmp/nextshot.png isn't an issue as such, it doesn't provide any redundancy if anything ever went wrong.

Store images in $XDG_CACHE_HOME/nextshot instead. Preferably using the "real" saved filename, although this might need a rename after the zenity dialog has been displayed. Unless files are named by date (#2), in which case it can be written directly to its actual name without need for mv after.

Check MIME types for --file mode

Goes without saying, really. We don't want to be blindly uploading a massive .tar.gz (for example) and disguising it as a png when it's clearly not.

At least until the main pipeline's been rewritten for better error handling, it'd be best to add the check within parse_opts(). We can use file --mime-type <FILEPATH> to check. Add the -b flag and it'll suppress the filename too, which we don't particularly need.

Rename shouldn't trigger Yad in terminal

While Yad works for setting a custom filename, it shouldn't be required if Nextshot is being run directly in a terminal window.

Code to detect whether or not we're in a terminal will be required for #42, so build on that and use read -p instead of Yad when Nextshot is called interactively.

Tray icon is sometimes a green flask

If Nextshot is started from ~/.xinitrc or with an exec line in the i3 config, the icon uses Yad's default:

image

Quitting the menu and manually running nextshot -t in a terminal will fix it, but only until logout/reboot.

Clipboard check always looks for xclip

If you run nextshot -p to paste from clipboard, it calls check_clipboard to check there's an image to paste.

This function relies on is_wayland which is only set in parse_environment after options are parsed. This is a problem here because check_clipboard is called during arg-parsing, thus NEXTSHOT_ENV isn't set yet (if autodetection is being relied on).

No config option for cloud without "pretty URLs"

Nextshot will not work correctly on Nextcloud instances without pretty URLs. For example - enabling these short URLs is still not possible on snap Nextcloud installations. Right now Nextshot use share links like this:
https://example.org/s/string

Without pretty URLs we need also "index.php" in URL, so like this:
https://example.org/index.php/s/string

For now, I just slightly changed the part of the script responsible for the URL, but it would be great if option for change this were also in the configuration. :)

Config can be specified with missing options

Currently NextShot only checks for the existence of the config file. As long as it's there, it could be completely empty and NextShot will happily try to run with it.

Add checks using parameter substitution with error messages to make sure required options are indeed set before attempting to do anything else.

Wayland check fails on Wayland

Running on Wayland results in attempting to copy via xclip.

The is_wayland() check returns 1 when it's not Wayland, but fails to return anything when it is. As a result, even on a Wayland machine the script thinks it's running on X11.

Uploading duplicate files doesn't return link

When uploading an image that already exists in Nextcloud, either by renaming a screenshot or by using the --file option, Nextcloud returns a 204 response code.

Need to do some more testing to see whether this overwrites or simply fails without doing anything. If it does overwrite it could simply be a matter of adding 204 to the checked responses and sharing anyway.

If it fails, we should rename the file (e.g. append -1, -2 etc.) and retry. That said, it may be better to check if the file exists first and automatically rename regardless of whether it overwrites or not.

Area selection not working in Wayland

While NextShot is able to copy share links via wl-copy, it is highly likely that import is either only capable of capturing XWayland windows or simply won't work at all.

We'd probably need to use a different tool depending on the WM/DE being used, because each compositor has their own way of doing things. Or so I gather...

  • For GNOME(-Shell), there's gnome-screenshot.
  • Sway used to have swaygrab built in, but that got removed. The wiki suggests using grim.
  • For Sway, slurp can replace slop/maim. gnome-screenshot has the -a flag to select an area

Add configurable overwrite defaults

Now that #50 is fixed so that duplicate uploads return a link, we could really do with a way of preventing Nextshot from overwriting existing files.

Nextcloud automatically overwrites, so we would need to ping the webdav API prior to sending the upload request. If a file exists with the same name, the user should be able to decide how to proceed.

Rename/overwrite/abort prompt is taken care of with #83, leaving only config/runtime args:

Config Option

There should be an option in nextshot.conf to define the default behaviour.
Something like overwrite=<action> could work, with possible values of:

  • overwrite=always - overwrite automatically without asking (previous behaviour)
  • overwrite=append - automatically append iterator/timestamp to the filename
  • overwrite=rename - never overwrite, ask for a new filename each time
  • overwrite=prompt - ask whether to overwrite or rename at runtime (current behaviour)
  • overwrite=cancel - always abort the upload(?)

The best option to set by default if the config isn't set would probably be prompt. The idea of Nextshot is to minimise interaction though, so perhaps always would be the better default here.

Runtime Args

While a config option should cover most cases, there should also be ways of overriding it on a case-by-case basis.

  • --no-overwrite would be useful if config is set to always
  • --overwrite could likewise be handy for bypassing prompts occasionally

How useful these would be though is questionable. Maybe skip them unless someone really wants it - the config option is still better than always overwriting without any choice in the matter.

Caveats

  • Appending to the filename automatically is good in theory, but in practice it's not so easy to implement. Extra care would need to be taken to avoid somefile-1-1-1-1-1.png or bumping to somefile-2.png only to find that also exists. Possibly leave this option for a later release.
  • Aborting upload really isn't the most useful option, so that can probably be ignored.

Add a `status` option or similar for listing dependencies

Output a list of dependencies and whether or not they're installed, similar to :call phpactor#Status() in vim. Option should be something like --status or --deps.

It could also show output of $(nextshot --version), but dependencies should be limited to the detected environment. In other words, don't show Wayland deps if X is detected, and vice versa.

Example Output

Current version: NextShot v1.2.3
Detected environment: Wayland

Dependencies
------------
✔ curl
✘ grim
✔ jq
✔ slurp
✔ wl-clipboard
✘ yad (optional)

Upload from clipboard

Add a --clipboard option to enable uploading to Nextcloud directly from the system clipboard. Would likely use xclip -selection c -o for X11, or wl-paste (provided by wl-clipboard) for Wayland.

Would be even better if we could simply use STDIN:

# On X11
alias pbpaste="xclip -selection c -o"
pbpaste | nextshot

# On Wayland
wl-paste | nextshot

Files without extensions don't get recognised by Nextcloud

If the entered filename is not ending in dot+format (so .png by default), the ext should be appended, because unrecognized images will not get displayed in the webview, nor do they get a preview (/preview in this case just renders []).

PR incoming...

Add a tray menu

We can use Yad's --notification option to add a tray icon, in conjunction with --listen in order to send menu items to its STDIN.

For the icon itself, the easiest option would be camera-photo-symbolic. While a png could be used, I'm not the most decisive person in the world so picking one is easier said than done. camera-photo is the same icon, but in "wireframe" format so it doesn't really show that well on a dark background.

The menu should contain at least the following options:

  • Capture selection
  • Capture window
  • Capture full screen

It could also be nice to have a menu item that opens the target folder in Nextcloud's files app using the default browser (xdg-open). Example link would be $server/apps/files/?dir=/$savedir

Option for plain image links

Nextcloud offers a /preview suffix on URLs which loads the raw image in the browser without any JS/UI cruft. Nextshot should have an option that appends this automatically for faster pasting.

Can't change slop colours

Gotta make them configurable somehow.

Probably enough to add a selectColour option to config and use that in place of the current hard-coded values.

xclip - No such file or directory

$ nextshot -ac
Waiting for selection...
Copying image to clipboard...
xclip: -t: No such file or directory

Aborted due to error

Manjaro KDE

what could be the problem?

Ability to paste from GNOME Files application

Could also affect other GUI file managers, no idea.

When you copy an image in Nautilus/GNOME Files, the result of xclip -selection c -o is something like this:

x-special/nautilus-clipboard
copy
file:///run/media/dshoreman/data/pictures/foo.jpg

To be able to paste from Nautilus we'd need some way of detecting and parsing that syntax. xclip doesn't seem to offer any image targets, and none of the given options are obviously distinct:

$ xclip -selection clipboard -o -t TARGETS
TIMESTAMP
TARGETS
MULTIPLE
text/uri-list
UTF8_STRING
COMPOUND_TEXT
TEXT
STRING
text/plain;charset=utf-8
text/plain

No way to capture a single display

Originally part of #5, most of which was added for 0.2.

Currently we can only capture the entire display. We could select one screen in --selection mode, but that's prone to errors. We should add an argument such as --only OUTPUT to enable specifying the output.

May be able to query Xrandr to get the screen's dimensions and offset in order to crop the full screen image, but that doesn't help with identifying the active output. Nor does it help in Wayland.

No distinct --window mode

While a window can currently be captured by clicking instead of dragging in --selection mode, the slightest movement could result in a selection screenshot.

Once we're using slop (#10) we'll be able to (and should) add a separate window mode. I forget the flag, but it has the option to set a tolerance of the drag to the point where it's essentially disabled.

Can't abort config once at confirmation step

If you fill out the Yad config form and get to the confirmation, there's no way to cancel. Even if you press escape, config will be written by NextShot.

Instead, output should be saved to a variable so that the exit status can be checked and NextShot can bail if needed. Much like the initial config form.

Make it possible to force Wayland mode

The current $WAYLAND_DISPLAY check should work in most cases, there is at least one where it will fail.

If you attempt to start Nextshot from within a tmux session that was started in X, the WAYLAND_DISPLAY environment variable will not be set regardless of whether you're currently using X or Wayland.

It may be possible to check the output of tty (which will either be /dev/ttyX or /dev/pts/X), but there's a good chance that could have the same issues as the env var.

File path checking is unreliable

Currently the --file mode checks for the given file relative to $PWD. This is fine when the image is in the same directory, and probably even up a level or two.

However, issues start to arise when passing root-relative paths or paths that go via a symlink. For instance, the following fails:

nextshot --file ~/pictures/kitten.jpg

because it's looking for /home/$USER/pictures/kitten.jpg when actually pictures is a symlink to /var/run/media/$USER/data/pictures.

Allow for switching between PNG and JPEG

This could either be a runtime argument or an option in the config file.

Runtime would make more sense, but it might also be a good idea to have an option for setting the default in config. This could then be overridden by the runtime argument.

Nextshot doesn't work correctly if locale does not use '.' as decimal separator

Hello,

I can't take a screenshot of an area or window if the numeric location isn't set to en_US.UTF-8 because BC doesn't seem to be able to do the calculation in a correct way:


$ nextshot -t
/usr/bin/nextshot: Line 343: printf: 1.00000000000000000000: Invalid Number.
/usr/bin/nextshot: Line 343: printf: .39215686274509803921: Invalid Number.
/usr/bin/nextshot: Line 343: printf: .70588235294117647058: Invalid Number.
Starting Nextshot tray menu...

If I start Nextshot using LC_NUMERIC="en_US.UTF-8" /usr/bin/nextshot -t everything works perfectly fine.

Colour config doesn't get applied in Wayland

Where Slop takes one colour option, Slurp takes three and they're in a different format too.

Slop uses decimal RGBA whereas Slurp uses Hex, so we'll need to add some translation layer (or duplicate the config option) to allow for a different selection colour in Wayland.

While not documented in slurp -h, Slurp has the following defaults:

    RRGGBBAA
-b #FFFFFF40    Background colour
-c #000000FF    Border colour
-s #00000000    Selection colour

Naming convention breaks upload

Hey,

if you could change the filename convention to:

filename="$(date "+%Y-%m-%d-%H-%M-%S").png"

by default, it would prevent issues caused by the backspace while uploading to NextCloud.

Kind regards,

vanBonzen

Add a `delay` option

To capture screenshots with context menus etc we need to add a delay. An option in config might be nice to have, but probably unnecessary.

For now, we can just add a --delay argument that takes an integer (or maybe decimal) value, defaulting to 0. Then we can do something like

sleep $(( delay * 1000 )); import ...

Copy image to clipboard

Would be nice if - instead of just getting the link - you could avoid Nextcloud and copy the screenshot directly to clipboard instead.

Useful for pasting in chat apps like Telegram, Twitter etc or even sites like StackOverflow that have "paste to upload image" functionality.

All it takes is adding -t image/png to the copy command so that xclip knows it's an image, but we'll also need an extra runtime arg to toggle between copying the link or image.

Add ability to take full-screen or windowed screenshots

Currently it can only capture a selected area using import from ImageMagick. It would be much nicer if it could capture the full screen or a selected window - similar to shotty but without the UI to get in the way.

Perhaps add command line flags to set the mode, eg:

  • --selection to select an area (current default)
  • --window to capture a selected window (implicitly supported by import)
  • --full-screen to capture all displays
  • --only-screen <display> to capture the entire output of a single monitor

Not sure if the last one is even possible, but it'd be nice.

Don't use actual account passwords!

It's bad. Very bad. No idea if Nextcloud has an API Key of sorts.

At the very least, README should suggest creating/using an App Password (/settings/user/security) instead of the real account one.

Missing packages should be caught early

$ nextshot -t
Starting Nextshot tray menu...
$ Waiting for selection...
/usr/bin/nextshot: строка 621: slop: команда не найдена

Aborted due to error

The error occurs when you are asked to take a screenshot

Make Nextcloud optional

Not everybody uses Nextcloud. If the respective config options aren't specified, we should default to -c, --clipboard mode so that getting started is easier.

This will likely require a slight reworking of the Yad config UI, or at the very least some added text stating that it's safe to leave certain things blank.

In an ideal world, you should be prompted as to whether you have or want to use Nextcloud before even given the option to configure it. That will also affect more generic options though (such as rename, which is currently the only one).

Add desktop notifications

When running NextShot through a keybind, it's impossible to know when the link is ready to be pasted.

Notifications should be added through libnotify. A simple "Link copied to clipboard" should be enough.

Could probably use the insert-link icon from the spec, but will need to try it out first as there are no examples given.

Related

Require Bash 4+

NextShot uses some expansions and other syntax (such as ${rename,,} to lowercase the boolean rename option) that is only available as of Bash v4.

You'd think most systems would be on Bash 4 already, but it might not always be the case. For instance OSX - while not (yet) supported by NextShot - is still running v3 out of the box.

If we detect a system running Bash < 4, NextShot should exit with an error message stating that fact.

Slop selections aren't particularly visible

...but it does have some formatting options. Gotta play about with some colours and see what makes it stand out. In particular, the window mode's selection border could be made much more obvious as the default is rather faint.

Arguments don't have short versions

Instead of --file etc, it'd be nice to have short versions like -f for added flexibility.

Should make use of getopt[s] which will also make it easier to add extra options later on.

Sharing continues after cancelling upload

If you kill the script with ^C during the upload to Nextcloud, it only exits that function.

Instead of NextShot exiting entirely, it continues to attempt sharing even though there's nothing there to share.

To fix this, we need to rework the main pipeline which will also make it easier to abort at other stages earlier in the process.

Window mode on Wayland should fall back to selection

There's no handling for --window in the shoot_wayland function, so it's currently defaulting to full screen.

There's no support for window selection in Slurp, but that could soon change if emersion/slurp#28 gets merged. Even then, it doesn't seem there'll be a way of specifically requiring "click" vs "drag" (like Slop's --tolerance 999999) in order to support dedicated window/selection modes in NextShot.

Falling back to --selection mode (as it did for X before --window was supported) isn't the best idea, as Slurp will exit if a user simply clicks in a window. Until Slurp gets window support, it may be worth seeing if we can parse a list of windows from swaymsg instead.

Cancelling selection doesn't kill the script

When running import from an interactive terminal, it can be aborted the usual way (i.e. ^C) just fine.

That doesn't work when it's running in the background though, such as when it's triggered by a keybinding in i3wm. As a result, you must take a screenshot once triggered, which isn't ideal if you hit it too soon.

Will either need to find another way of selecting an area of the screen, or simply prompt to confirm/retry before uploading to Nextcloud. A preview window could also be useful, but probably not necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.