An open API service indexing awesome lists of open source software.

https://github.com/200ok-ch/okshot

Take and annotate screenshots in Linux with standard tools.
https://github.com/200ok-ch/okshot

Last synced: 5 months ago
JSON representation

Take and annotate screenshots in Linux with standard tools.

Awesome Lists containing this project

README

          

#+begin_example
_ _ _
___ | | _____| |__ ___ | |_
/ _ \| |/ / __| '_ \ / _ \| __|
| (_) | <\__ \ | | | (_) | |_
\___/|_|\_\___/_| |_|\___/ \__|
#+end_example

#+html:

* NAME

=okshot= - Take and annotate screenshots in Linux with standard tools.

* SYNOPSIS

#+begin_example
Usage: okshot [options]
-C, --copy-to-clipboard Copy PNG file from clipboard and upload
-s, --simple Take a screenshot without annotation and upload. This is thedefault.
-c, --copy-from-clipboard Copy PNG file from clipboard and upload
-i, --inkscape Use inkscape to edit the screenshot and upload
#+end_example

* DESCRIPTION

=okshot= takes a screenshot, optionally annotates it and then saves it
either to the clipboard or uploads it to a FTP server and copies a web
accessible URL to your clipboard.

This gem is inspired by the lack of good screenshot tooling in Linux.
However, Linux has all the tools available that can easily be strung
together to get the ultimate screenshot tool.

For uploading the files via FTP, it needs these environment variables set:

- OKSHOT_HOST
- OKSHOT_USER
- OKSHOT_PASSWORD
- OKSHOT_URL_PREFIX

For example, you can do this in your shell config file (=~/.bashrc=,
=~/.zshrc=) or via [[https://200ok.ch/posts/contextual-helpers-with-zsh-hooks.html][sourceme]]. For example:

#+begin_example
export OKSHOT_HOST=ftp.some-server.ch
export OKSHOT_USER=your_user
export OKSHOT_PASSWORD=your_password
export OKSHOT_URL_PREFIX=https://okshot.your_domain.ch
#+end_example

* INSTALLATION

=okshot= is implemented in [[https://www.ruby-lang.org/en/][Ruby]] and can be installed as a [[https://rubygems.org/][gem]].

#+begin_example
gem install okshot
#+end_example

It uses the following standard Linux tools. For all flags, it requires:

| Program | Rationale |
|-------------+------------------------------------------------------------------|
| [[https://imagemagick.org/][imagemagick]] | Takes the actual screenshot as a PNG file. |
| [[https://linux.die.net/man/1/uuidgen][uuigen]] | Adds a partial UUID to the screenshot name to ensure uniqueness. |
| [[https://linux.die.net/man/1/xclip][xclip]] | Copies the public screenshot URL to the clipboard. |
| [[http://manpages.ubuntu.com/manpages/xenial/man1/notify-send.1.html][notify-send]] | Creates a desktop notification that the URL is in the clipboard. |

Without the flag =-C= (=--copy-to-clipboard=), the file is uploaded to
an FTP server and requires:

| Program | Rationale |
|-------------+------------------------------------------------------------------|
| [[https://linux.die.net/man/1/ftp][ftp]] | Uploads the final screenshot to a FTP server. |

For the flag =-i=, it additionally requires:

| Program | Rationale |
|----------+-------------------------------------|
| [[https://inkscape.org/][inkscape]] | Annotate the image in all the ways. |
| [[https://linux.die.net/man/1/wmctrl][wmctrl]] | Starts Inkscape in full screen. |

Install dependencies:

#+begin_src shell
apt-get install imagemagick ftp inkscape wmctrl uuid-runtime xclip libnotify-bin
#+end_src

* DEVELOPMENT

=okshot= is implemented in [[https://www.ruby-lang.org/en/][Ruby]], dependencies are managed with [[https://bundler.io/][bundler]].

After checking out the repo, run =bin/setup= to install dependencies.
You can also run =bin/console= for an interactive prompt that will
allow you to experiment.

To install this gem onto your local machine, run =bundle exec rake
install=. To publish a new version, update the version number in
=version.rb=, and then run =bundle exec rake publish=, which will
create a git tag for the version, push git commits and tags, and push
the =.gem= file to [[https://rubygems.org][rubygems.org]].

# * TESTS

# Tests are implemented with [[https://rspec.info/][RSpec]] and can be run with =bundle exec
# rspec spec=.
* DEMO

[[https://github.com/200ok-ch/okshot/wiki/videos/demo.gif]]