phw / peek

Simple animated GIF screen recorder with an easy to use interface
GNU General Public License v3.0
10.24k stars 319 forks source link

Start peek with the recording area spcified from a script/cli #544

Open TheMeaningfulEngineer opened 4 years ago

TheMeaningfulEngineer commented 4 years ago

Hi, am just curious if there is perhaps a workaround to do this with peek. I'd like to script a preparation of a screencast recording setup. The script will conceptually do the following:

  1. Open a terminal window at a specific location and size
  2. Start peek with the recording area set to the particular window

    As far as I saw in the peek --help-all there isn't a parameter to set this. However, peek does seem to remember the position/size of the last recording area which was set using the GUI. It seems like there is a state for that existing somewhere?

Could that state perhaps be manually modified. The script would than become:

  1. Open a terminal window at a specific location and size
  2. Edit the peed state file to set the recording area peek will start with
  3. Start just peek
brenopacheco commented 4 years ago

I was having the same issue. To me it looks like peek uses dconf to store window position and size, except it only reads the window's width and height from dconf and always positions it in the middle of the screen on startup. The solution I found was to use xdotool to move and resize the window where I want. Hope it helps.

thevasya commented 4 years ago

@brenopacheco thank you for the tip. I had a different problem (peek window positioned outside the visible screen area in dual-monitor setup) and with the help of xdotool I was able to move it to the center of the screen where it actually becomes usable. The CLI command for this is something like xdotool search --onlyvisible --classname "peek" windowmove %@ 300 300

sangwoo-joh commented 3 years ago

Wow, I had the very same issue, and thanks to you guys, I solved my problem! Thanks a lot