forked from LibrePCB/LibrePCB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bash scripts for capturing screenshots
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Helper script to capture screenshots of LibrePCB windows. | ||
# Requirements: sudo apt-get install wmctrl shutter imagemagick | ||
# Note: Enable round corners in shutter preferences! | ||
|
||
set -euo pipefail | ||
|
||
WIDTH=800 | ||
HEIGHT=500 | ||
X1=100 | ||
X2=280 | ||
X3=460 | ||
Y1=100 | ||
Y2=250 | ||
Y3=400 | ||
|
||
# capture screenshots | ||
wmctrl -a "Control Panel" && wmctrl -r "Control Panel" -e 0,$X1,$Y1,$WIDTH,$HEIGHT | ||
shutter -w="Control Panel" -o control_panel_small.png -d 3 -c -e | ||
wmctrl -a "Board Editor" && wmctrl -r "Board Editor" -e 0,$X2,$Y2,$WIDTH,$HEIGHT | ||
shutter -w="Board Editor" -o board_editor_small.png -d 3 -c -e | ||
wmctrl -a "Schematic Editor" && wmctrl -r "Schematic Editor" -e 0,$X3,$Y3,$WIDTH,$HEIGHT | ||
shutter -w="Schematic Editor" -o schematic_editor_small.png -d 3 -c -e | ||
|
||
# merge screenshots together | ||
convert -page +$X1+$Y1 control_panel_small.png \ | ||
-page +$X2+$Y2 board_editor_small.png \ | ||
-page +$X3+$Y3 schematic_editor_small.png \ | ||
-background transparent -layers merge +repage overview_small.png | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Helper script to capture screenshots of LibrePCB windows. | ||
# Requirements: sudo apt-get install wmctrl shutter imagemagick | ||
# Note: Enable round corners in shutter preferences! | ||
|
||
set -euo pipefail | ||
|
||
function capture_screenshot { | ||
echo "----- NEXT WINDOW: $1 -----" | ||
sleep 5 | ||
wmctrl -a "$1" && wmctrl -r "$1" -e 0,100,100,1100,650 | ||
shutter -w="$1" -o "$2" -d 3 -c -e | ||
convert -thumbnail 770x455 "$2" "thumbs/$2" | ||
} | ||
|
||
capture_screenshot "Control Panel" "control_panel.png" | ||
capture_screenshot "Board Editor" "board_editor.png" | ||
capture_screenshot "Schematic Editor" "schematic_editor.png" | ||
capture_screenshot "Add Component" "add_component_dialog.png" | ||
capture_screenshot "Library Manager" "library_manager.png" | ||
#capture_screenshot "Library Editor" "library_editor.png" | ||
|