Git Product home page Git Product logo

escrotum's People

Contributors

404d avatar aanatoly avatar aignas avatar arkoinad avatar dequis avatar incertia avatar jyc avatar phaeilo avatar roger avatar sammyshp avatar traneptora avatar trinaldi avatar vchimishuk 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

escrotum's Issues

Selection square remains on the screen

Hi. When I use escrotum -s -C and then capture a selection of my screen sometimes the selection square remains on the screen.
I use version 0.2.1 on Debian testing in AwesomeWM.
image

Unrecognized parameter “quality” passed to the PNG saver

After upgrading to python 3.9, I can't seem to make it work. Running with -C now fails silently with nothing copied to the clipboard and a 0 exit code and running with a filename produces a uniform black png with this output (and also a 0 exit code):

(escrotum:23207): GdkPixbuf-WARNING **: 10:00:03.461: Unrecognized parameter “quality” passed to the PNG saver.

Is there anything I can do to debug the issue deeper?

Support for --focused

scrot has an option --focused to select/use the focused window.

With escrotum you have to use something like escrotum --xid $(xdotool getactivewindow).

It would be nice if --focused was supported for compatibility and ease of use.

Doesn't work with Python 3.10.1

After reading this issue:
#68

I was able to get escrotum working on python 3.10.1 again, however the issues I was having prior to installing escrotum as a python package and also installing python-numpy from AUR as mentioned as fix actions.. my issues were identical to the issues given when python upgraded to 3.9.

Everything from the original post in #68 is identical and relevant to the issue upgrading from python 3.9 to 3.10(.1), I am also running Arch Linux and I received the same exact errors.

As noted, installing python-numpy and running pip install escrotum have fixed the issue in the meantime.

Upload new version to pypi

The pypi last uploaded version is 1.0.1, which is lacking of some additions to master, for example:

git diff 1.0.1..master -- setup.py

diff --git a/setup.py b/setup.py
index 10a75f7..1998cbc 100644
--- a/setup.py
+++ b/setup.py
@@ -12,8 +12,9 @@ setup(
     include_package_data=True,
     zip_safe=False,
     install_requires=[
-      'gobject',
+      'PyGObject',
       'xcffib',
+      'pycairo',
     ],
     entry_points={
         'console_scripts': [

Why is important?

That makes impossible to me to install in a virtual environment

$ python -m venv venv; source venv/bin/activate;
$ pip install escrotum
$ ./venv/bin/escrotum
Traceback (most recent call last):
  File "/tmp/venv/./bin/escrotum", line 5, in <module>
    from escrotum.main import run
  File "/tmp/venv/lib/python3.10/site-packages/escrotum/main.py", line 9, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'

$ pip list
Package    Version
---------- -------
cffi       1.16.0
escrotum   1.0.1
gobject    0.1.0
pip        22.0.2
pycparser  2.21
setuptools 59.6.0
xcffib     1.5.0

Question - Select a window - Select a window with frame - Whole Screen?

Hi Roger,

First let me say thank you for making escrotum, I'm very happy to see something continue on from scrot.

I use Openbox 3.5.2 and with scrot these are the commands I'd use for the keyboard print screen.

# Select a window
bash -c "scrot -s /home/foo/ScreenShots/screenshot-$(date +%m-%d-%Y).png"
# Select a window with frame
bash -c "scrot -sb /home/foo/ScreenShots/screenshot-$(date +%m-%d-%Y).png"
# Whole screen
bash -c "scrot /home/foo/ScreenShots/screenshot-$(date +%m-%d-%Y).png"

To use escrotum, 'select a window' and 'whole screen' I have these commands below, but not sure about select a window with frame?

Select a window (is this correct)?
bash -c "escrotum -s /home/foo

Select a window with frame? (how can I do this)?
bash -c "scrot -sb /home/foo

Whole Screen (is this correct)?
bash -c "escrotum /home/foo

Thank you very much for your time and help and keep up the great work, I hope you'll continue developing escrotum for some time.

Wrong offset when capturing window

With the current version, when making a screenshot of a selected window, the captured area starts outside of the window decoration (window decoration is 1px in my case), but uses the dimensions of the window content. This means that the decoration at the left and top side is captured, but the bottom and right side are slightly cropped.

Slightly related to #9.

TypeError when using -s in i3wm

Hi,

I'm running debian, python2.7.12 and i3 as a window manager.

When I use escrotum -s to capture a region, it works fine. However, when I want to capture a whole window, here's what I get as an error :

/usr/local/lib/python2.7/dist-packages/escrotum/main.py:240: GtkWarning: IA__gdk_x11_colormap_foreign_new: assertion 'xcolormap != None' failed
  pb = pb.get_from_drawable(window, window.get_colormap(), x, y, 0, 0,
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/escrotum/main.py", line 241, in screenshot
    width, height)
TypeError: Gdk.Pixbuf.get_from_drawable() argument 2 must be gtk.gdk.Colormap, not None
^CTraceback (most recent call last):
  File "/usr/local/bin/escrotum", line 9, in <module>
    load_entry_point('escrotum==0.2.1', 'console_scripts', 'escrotum')()
  File "/usr/local/lib/python2.7/dist-packages/escrotum/main.py", line 382, in run
    gtk.main()

Any Idea what the problem could be ?

Command (--exec) not executed when using --clipboard

Example:

$ escrotum -e "echo hello"
2016-12-07-233226_3600x1080_escrotum.png
hello

$ escrotum -C -e "echo hello"
(no output)

With rm:

$ touch test && escrotum -e "rm ./test" && ls
2016-12-07-233534_3600x1080_escrotum.png
2016-12-07-233534_3600x1080_escrotum.png

$ touch test && escrotum -C -e "rm ./test" && ls
2016-12-07-233534_3600x1080_escrotum.png  test

Black image in selection mode

It only happens in selection mode. It works well when capturing the whole screen.

The environment is:

  • Distro: Ubuntu 23.10
  • Window Manager: I3
  • X11 or Wayland?: X11

man-page question

at the bottom of the man page, it is mentioned that the escrotum documentation is maintained as a texinfo page.
this is, as far as i can tell, a default thing that help2man adds in, but since this isn't actually true, shouldn't it be removed?

Help Wanted

I don't have a lot of time this days to work with this project, so I'm looking for people who wants to mantain it, currently is working as I want but could have some improvements, like finishing #25 or releasing new versions(the last one it's from 2014), also packaging on archlinux should have some improvements.

If anyone it's interested, please let me know.

escrotum broken after upgrade to python 3.9

I'm using arch linux, on a thinkpad x1 yoga, with the package escrotum-git 0.2.1.r47.abcab0e-1. This morning I upgraded using yay -Syu as normal, and python got upgraded from 3.8 to 3.9. Running escrotum in bash gave the following error:

Traceback (most recent call last): File "/usr/bin/escrotum", line 33, in <module> sys.exit(load_entry_point('escrotum==1.0.1', 'console_scripts', 'escrotum')()) File "/usr/bin/escrotum", line 22, in importlib_load_entry_point for entry_point in distribution(dist_name).entry_points File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution return Distribution.from_name(distribution_name) File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name raise PackageNotFoundError(name) importlib.metadata.PackageNotFoundError: escrotum

So that's how I learned that escrotum was a python package, and so I figured installing it with pip install escrotum might fix the problem. After doing so, and running escrotum again, I get the following error:

No numpy support, saving would be slower Traceback (most recent call last): File "/usr/bin/escrotum", line 33, in <module> sys.exit(load_entry_point('escrotum==1.0.1', 'console_scripts', 'escrotum')()) File "/home/ben/.local/lib/python3.9/site-packages/escrotum/main.py", line 534, in run Escrotum(filename=args.FILENAME, selection=args.select, xid=args.xid, File "/home/ben/.local/lib/python3.9/site-packages/escrotum/main.py", line 93, in __init__ self.start() File "/home/ben/.local/lib/python3.9/site-packages/escrotum/main.py", line 111, in start self.capture() File "/home/ben/.local/lib/python3.9/site-packages/escrotum/main.py", line 278, in capture self.capture_image(x, y, width, height, window) File "/home/ben/.local/lib/python3.9/site-packages/escrotum/main.py", line 294, in capture_image pb2 = self.mask_pixbuf(pb2, root_width, root_height) File "/home/ben/.local/lib/python3.9/site-packages/escrotum/main.py", line 368, in mask_pixbuf data = bgra2rgba(pixels, width, height) File "/home/ben/.local/lib/python3.9/site-packages/escrotum/util.py", line 111, in bgra2rgba data = array.array ("c", pixels) ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)

Anyway, I figure I can manually edit the main /usr/bin/escrotum script to call python3.8, instead of just python, but manually editing files that are part of packages seems like a bad idea?

Zoom

A square near the cursor showing exactly what pixel your mouse is over to select. As well as the selection's dimensions. Only features I really miss from ShareX.

-e: escape/use dollar sign

With scrot you can use $$ to have a literal $ in the -e expression, but it does not work with escrotum:

% escrotum -e 'echo $$PWD'
2019-01-16-025022_1920x1080_escrotum.png
19867PWD
% scrot -e 'echo $$PWD'
/tmp

region selection with compton gets extra shadow

Hi
I run openbox with compton. When I use escrotum to select a region with a mouse, the screenshot is dark.
Please see here http://aanatoly.github.io/ndnd/
My guess is this: escrotum opens a transparent window, compton adds a shadow and draws it onto root window, escrotum grabs a region from root window. So closing escrotum window before taking the shot may solve this

Images are not saved to clipboard

With the newest version, images are not saved to clipboard. Running e.g. escrotum -sC would normally do this - however, the clipboard is empty.

kernel version: 5.6.8-arch1-1
escrotum version: 0.2.1.r44.292766e-1

Notification support for countdown

Hi @Roger ,

Many thanks for escrotu! A great replacement for the rather limited Gnome Screenshot.

One request. My default command (mapped to Print key) use is as follows:

escrotum -d 10  -s -C

Since I don't see the CLI countdown timer, would it be possible to display a libnotify notification for the countdown timer?

Thanks in advance!

Robert

Crashes when taking a screenshot, then can't close

Installed today on Ubuntu 18.04 via pip running i13wm 4.17.1.

~ ❯ escrotum -s ~/scrot.png
Gtk-Message: 10:29:09.016: GtkDialog mapped without a transient parent. This is discouraged.
No numpy support, saving would be slower
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/escrotum/main.py", line 278, in capture
    self.capture_image(x, y, width, height, window)
  File "/usr/local/lib/python3.6/dist-packages/escrotum/main.py", line 294, in capture_image
    pb2 = self.mask_pixbuf(pb2, root_width, root_height)
  File "/usr/local/lib/python3.6/dist-packages/escrotum/main.py", line 368, in mask_pixbuf
    data = bgra2rgba(pixels, width, height)
  File "/usr/local/lib/python3.6/dist-packages/escrotum/util.py", line 111, in bgra2rgba
    data = array.array ("c", pixels)
ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)
^CTraceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/escrotum/main.py", line 184, in event_handler
    def event_handler(self, event):
KeyboardInterrupt
^C^C^C^C^C^C^CTraceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/escrotum/main.py", line 184, in event_handler
    def event_handler(self, event):
KeyboardInterrupt

^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^CTraceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/escrotum/main.py", line 184, in event_handler
    def event_handler(self, event):
KeyboardInterrupt

Had to sigkill the process.

Help gives an example whose result is inconsistent with the given command

Hello,
In version 0.2.1 of escrotum, the following example is given in the help message:

Example:
  	escrotum '%Y-%m-%d_$wx$h_escrotum.png'
  	Creates a file called something like 2013-06-17-082335_263x738_escrotum.png

However, running the example command actually yields a file called something like: 2013-06-17_263x738_escrotum.png

This can either be fixed by changing the command to the correct one, i.e.

escrotum '%Y-%m-%d-%H%M%S_$wx$h_escrotum.png'

or change the name of the file to the correct one, i.e.

2013-06-17_263x738_escrotum.png

If you're too busy for this, let me know which fix you'd prefer and I can make a quick pull request.

continues working after command execution

Here is the problem with clipboard.
Hotkey printSc executes escrotum -s -C and it is creates copies of himself after executing command:
image
So, in the terminal
image
Stops after executing another copy of app through hotkey, in my case here
How to kill copies?

Sorry for further terminological and language grammar mistakes

Did you mean print(".")?

Installed it with pip and got this error when executing the binary, whats wrong? Do I miss any dependence?

Clipboard doesn't return to prompt after paste

This might be by design, not sure if it's possible to keep an image in the clipboard after having closed the application, but the --clipboard option keep escrotum running until another instance of escrotum with --clipboard is executed.

Solution ideas:

  • Find a way to keep it in the clipboard after escrotum closes
  • Notify on command line "Screen-shot being hold in clipboard. Press any key to exit" and add to readme that taking another screenshot would also exit the first process instance; so you may want to fork it.

Recording holds wrong filename in $f

When executing

escrotum -sr '%M%S.webm' -e 'echo $f'

It seems like it captures the timestamp, this is used for saving the file, but the -e parameter does not hold the old value of the timestamp, and thus returns the current timestamp instead of the filename.

This results in a different filename being printed from the one that is actually saved, see image;
image

Tooltips are not captured on a screenshot when using escrotum with an x-window id

When I want to screenshot a webpage, for example, using the escrotum command works fine. But when I try and screenshot the webpage via its x-window's xid, and I use the command escrotum -x <window-id>, then any tooltips that are on that webpage don't show up. Why aren't tooltips captured in the screenshot when using escrotum with the x-window id?

I think this is a bug. Any reason why this is occurring? It would be great to get this fixed!

File doesn't saving using -C modifer

Kernel version: linux-5.10.14.arch1-1
Escrotum version: escrotum-git 0.2.1.r48.a41d0f1-1
Python version: python-3.9.1-2

Using this, file isn't saving and isn't going to clipboard
escrotum -s -C '~/Pictures/Screenshots/screenshot_%d.%m.%Y_%H:%M:%S.png'

That works okay
escrotum -s '~/Pictures/Screenshots/screenshot_%d.%m.%Y_%H:%M:%S.png'

Add support for Wayland

I used this tool all the time in i3, and I recently moved to Sway and noticed that the screenshots taken are completely black. That's when I realized escrotum only supports X. It would be nice to have support for Wayland though since it is getting more mainstream lately.

PyPi / PIP

I saw the setup.py, but it seems you didn't upload it to PyPi which would allow a simple "pip install escrotum" to install it.

I'd also suggest a very short how to install in the README. It's a nice tool.

Selection captures wrong area

escrotum -s

If the selection starts in the top left corner everything is fine. But if it starts somewhere else, the dimensions are fine, but the content is shifted/placed in the wrong area. Depending on the area/offset from the corner it might be completely black.

e7ed25d on Arch Linux.

Eventually moving to Rust

Have you ever considered rewriting this into Rust? I mean, Rust is a more memory-safe language and it has concurrency built-in, which will prevent you from any thread issue in the future. Also, you can compile it to different targets, so everybody can have their escrotum oxidated.

Screen capture one out of two displays

I am running two monitors in extended mode, how do I issue a screenshot of display #2? the Display name is HDMI-0 ?

I tried this: escrotum --xid=HDMI-0 ~/tmp/01.png

Tint Over Screenshot

When using escrotum to take a screenshot, it shows a tint to help you define the area where you're selecting to screenshot. However since I updated pip, the final screenshot taken includes that tint overlay making the images look darker. Is this a known bug or did something go awry when I updated pip? I have re-installed but the issue still persists.

Example:
http://i.imgur.com/pMO0nIr.png

exec does not work

escrotum exits from Escrotum.save_file before performing the check to exec commands

the call for normal exit in Escrotum.save_file should be moved to Escrotum.screenshot to resolve the issue

Video capture filename in --exec does not use the same time as the file

Occurred on Linux 5.15.7-xanmod1-tt-1 using xorg and i3wm

Steps to reproduce

  1. Start a video capture using the following command:
    escrotum -r '~/img/screenshots/%Y-%m-%d_%H-%M-%S.webm' -e 'echo $f'
  2. Wait 5 seconds and then end the video capture using Ctrl-Alt-s
  3. Notice that the echo'd video filename will have the seconds field be 5 seconds later than that of the actual saved file.

Possible cause

It seems as though the filename's substitutions are getting expanded once at the beginning of capture, and then expanded a second time when the command executes, which means that the strftime(2) evaluation will be different each time. By capturing the strftime once at the beginning of program execution we can ensure that this discrepancy will not exist.

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.