~ubuntu-branches/ubuntu/quantal/ubuntu-docs/quantal

« back to all changes in this revision

Viewing changes to collect-screenshots-without-mouse.sh

  • Committer: Package Import Robot
  • Author(s): Matthew East
  • Date: 2012-05-07 20:57:02 UTC
  • Revision ID: package-import@ubuntu.com-20120507205702-gy8hqfqxurw5jfvj
Tags: 12.10.1
No-change upload from precise, bump version number only

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# Prerequisites
 
4
# sudo apt-get install gstreamer0.10-fluendo-mp3 imagemagick shutter xdotool
 
5
#
 
6
# Save this script in ~/.ubuntu-help (this is also where the screenshots will be kept)
 
7
# The hidden directory is so that they don't clutter the File Browser screenshot
 
8
#
 
9
# Open Shutter and set the delay (in the bottom right corner) to 3, make sure 
 
10
# "Include cursor" isn't checked
 
11
#
 
12
# Open System Settings>Privacy. Delete all history
 
13
# Switch to the Files tab and add the .ubuntu-help directory to the don't record list.
 
14
#
 
15
# Make sure that /etc/default/apport has enabled=0 . This
 
16
# will turn off the automatic bug report window that will just get in the way of screenshots.
 
17
#
 
18
# Finally press Alt+F2 and run .ubuntu-help/collect-screenshots-without-mouse.sh
 
19
 
 
20
function error {
 
21
  echo -e $1
 
22
  exit 1
 
23
}
 
24
 
 
25
## prerequisites installed? Needs more work
 
26
#for pkg in gedit gstreamer0.10-fluendo-mp3 shutter xdotool imagemagick ; do
 
27
#  if dpkg --get-selections | grep -q $pkg ; then error "Error: $pkg isn't installed. To install it, run: \n sudo apt-get install $pkg#"; fi
 
28
#done
 
29
 
 
30
lang=$(basename $LANG .UTF-8)
 
31
echo "lang: $lang"
 
32
dir=$HOME/.ubuntu-help/$lang/figures
 
33
downdir=$HOME/.downloads
 
34
echo "dir: $dir"
 
35
mkdir -p $dir
 
36
mkdir -p $downdir
 
37
 
 
38
long_pause="sleep 5"
 
39
mid_pause="sleep 3"
 
40
short_pause="sleep 1"
 
41
 
 
42
wget -c -O $downdir/EmblemDivide.pdf http://emblemdivide.files.wordpress.com/2009/12/chapter0.pdf
 
43
wget -c -O $downdir/standard-tube-map.pdf http://www.tfl.gov.uk/assets/downloads/standard-tube-map.pdf
 
44
wget -c -O $downdir/richard-stallman-young.jpg http://upload.wikimedia.org/wikipedia/commons/f/f7/Richard_Matthew_Stallman.jpeg
 
45
wget -c -O $downdir/Echoes\ In\ Time.mp3 http://people.ubuntu.com/~jbicha/Echoes%20In%20Time.mp3
 
46
 
 
47
# Set the screen resolution
 
48
xrandr -s 1024x768
 
49
$long_pause
 
50
xdotool mousemove 1024 350
 
51
 
 
52
# Change the time to match the version number
 
53
# This needs to be updated for different locales
 
54
gsettings set com.canonical.indicator.datetime time-format "custom"
 
55
gsettings set com.canonical.indicator.datetime custom-time-format "12:04 %p"
 
56
gsettings set org.gnome.Evince.Default show-sidebar false # This doesn't seem to work
 
57
gsettings set com.canonical.Unity form-factor "Netbook"
 
58
 
 
59
xdotool key Super
 
60
$mid_pause
 
61
xdotool key u p d a
 
62
$short_pause
 
63
xdotool key Down Down Return
 
64
$long_pause
 
65
 
 
66
xdotool key Super
 
67
$mid_pause
 
68
xdotool key m a h j
 
69
$short_pause
 
70
xdotool key Down Down Return
 
71
$mid_pause
 
72
 
 
73
xdotool key Super
 
74
$mid_pause
 
75
xdotool key g e d i
 
76
$short_pause
 
77
xdotool key Down Down Return
 
78
$mid_pause
 
79
 
 
80
xdotool key Super
 
81
$mid_pause
 
82
xdotool key e v i n
 
83
$short_pause
 
84
xdotool key Down Down Return
 
85
$mid_pause
 
86
 
 
87
xdotool key Super
 
88
$mid_pause
 
89
xdotool key e o g
 
90
$short_pause
 
91
xdotool key Down Down Return
 
92
$mid_pause
 
93
 
 
94
pkill update-manager
 
95
pkill mahjongg
 
96
evince $downdir/standard-tube-map.pdf &
 
97
$mid_pause
 
98
pkill evince
 
99
touch $downdir/index.html
 
100
gedit $downdir/index.html &
 
101
$mid_pause
 
102
pkill gedit
 
103
evince $downdir/EmblemDivide.pdf &
 
104
$mid_pause
 
105
pkill evince
 
106
eog $downdir/richard-stallman-young.jpg &
 
107
$mid_pause
 
108
pkill eog
 
109
 
 
110
shutter -f -e -o dir/unity.png
 
111
$short_pause
 
112
convert $dir/unity.png -resize 250x188 $dir/unity.png
 
113
if [ $dir -eq ".ubuntu-help/en-US/figures" ] # English only
 
114
  then
 
115
    convert $dir/unity.png -crop 65x180+0+25 +repage $dir/unity-launcher.png
 
116
    $short_pause
 
117
    convert $dir/unity-launcher.png -crop 65x123+0+57 +repage $dir/unity-launcher-apps.png
 
118
fi
 
119
 
 
120
nautilus &
 
121
$long_pause
 
122
xdotool getactivewindow windowsize 650 325
 
123
shutter -a -e -o $dir/nautilus.png
 
124
$long_pause
 
125
convert $dir/nautilus.png -resize 250x125 $dir/nautilus.png
 
126
xdotool key Alt+F4
 
127
 
 
128
xdotool key Super
 
129
$short_pause
 
130
xdotool key BackSpace
 
131
$short_pause
 
132
shutter -f -e -o $dir/unity-overview-original.png
 
133
convert $dir/unity-overview-original.png -crop 230x130+0+0 +repage $dir/unity-dash-sample.png
 
134
$short_pause
 
135
convert $dir/unity-overview-original.png -resize 75% $dir/unity-overview.png
 
136
rm $dir/unity-overview-original.png
 
137
 
 
138
xdotool key Ctrl+Tab
 
139
shutter -f -e -o $dir/unity-dash.png
 
140
convert $dir/unity-dash.png -crop 525x227+0+0 +repage $dir/unity-dash.png
 
141
 
 
142
xdotool key Escape
 
143
 
 
144
# Change things back to normal
 
145
gsettings reset com.canonical.indicator.datetime time-format
 
146
gsettings reset com.canonical.indicator.datetime custom-time-format
 
147
gsettings reset com.canonical.Unity form-factor
 
148
 
 
149
# This is supposed to set a laptop's screen resolution back to default
 
150
xrandr --output LVDS1 --auto