Kazam should let you speficy a default region to record

Bug #1155294 reported by Olav Andreas Lindekleiv
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Kazam Screencaster
Confirmed
Wishlist
Unassigned

Bug Description

Overall, Kazam looks like a solid application, but there's one thing I'm missing. Instead of having to click "Area" and then select an area, I'd like to be able to specify recording region from the command line.

Something like "kazam --area 1280x720+100+100" to record a 1280x720 region, with a 100px offset on the x and y axis. An option to enable this in the preferences would also be nice, but a command line flag is probably enough, as not everyone needs this.

Tags: wishlist
David Klasinc (bigwhale)
Changed in kazam:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
eltimbalino (eltimbalino-org) wrote :

For people who find this bug while looking for the same solution, I managed a useful workaround. This enables you to preset the location of the area selector when you first select an area. It does not affect anything else, and you can still choose a different area if you like. To use it, simply choose to select an area, and then press enter to select your default area.

Note: I did this in Ubuntu 18.04 your file locations may vary.

To preset the Kazam Screen Area

sudo cp '/usr/lib/python3/dist-packages/kazam/frontend/window_area.py' '/usr/lib/python3/dist-packages/kazam/frontend/window_area_Original.py'
sudo gedit '/usr/lib/python3/dist-packages/kazam/frontend/window_area.py'

Note: You can save the window_area.py while you're working on it, then restart Kazam and select an area to see how it is working. When I had a mismatch of values, pressing enter failed to close and accept.

Find the values you are after by selecting the area using Kazam that you want.
Note the width and height values that it shows you. We'll call them W1 and H1
Grab the resize option from the bottom right of your selected area and drag it to the top left of your screen
Note the width and height values that it shows you. We'll call them W2 and H2

        # Position and size
        self.startx = W2
        self.starty = H2
        self.endx = W1+W2
        self.endy = H1+H2
        self.g_startx = W2
        self.g_starty = H2
        self.g_endx = W1+W2
        self.g_endy = H1+H2
        self.height = H1
        self.width = W1

Change the values in the code starting around line 57 to be the ones you've calculated:

        # Position and size
        self.startx = 42
        self.starty = 140
        self.endx = 1904
        self.endy = 1079
        self.g_startx = 42
        self.g_starty = 140
        self.g_endx = 1904
        self.g_endy = 1079
        self.height = 939
        self.width = 1862

I used these settings on 1920x1080 screen.

Save your file.
Open Kazam and test.
If it works, close your saved file.
If it fails and you can't make it work, delete window_area.py
and then rename window_area_Original.py to be window_area.py

If posting this here is not approptriate, please copy and paste it to where it is appropriate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.