<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Eyes-free Linux Ninja!</title><link>http://eyesfreelinux.ninja/</link><description>Linux installation and use for the visually impaired</description><atom:link href="http://eyesfreelinux.ninja/rss.xml" type="application/rss+xml" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 22 Sep 2017 20:57:19 GMT</lastBuildDate><generator>https://getnikola.com/</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arch Linux on the Raspberry Pi and the  bsdtar Fix</title><link>http://eyesfreelinux.ninja/posts/raspberry-pi-arch-and-the-fix.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;A couple of years ago, or more, I wrote a script to get the latest
&lt;a href="https://www.raspberrypi.org/"&gt;Raspberry Pi&lt;/a&gt; filesystem archive from the
&lt;a href="https://archlinuxarm.org/"&gt;Arch LinuxARM&lt;/a&gt; site, create, partition
and mount a new &lt;code&gt;.img&lt;/code&gt; file and extract the &lt;code&gt;.tar.gz&lt;/code&gt; file into the
mounted partitions.&lt;/p&gt;
&lt;p&gt;But a while ago, about December 2016 or so I started to get &lt;code&gt;bsdtar&lt;/code&gt;
errors when extracting the archive.&lt;/p&gt;
&lt;p&gt;Note here that it is documented on the Arch Linux ARM
site that &lt;code&gt;GNU tar&lt;/code&gt; will not work with this operation and it must be
&lt;code&gt;bsdtar&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In the last couple of days my need to find a solution has grown more
pressing and I went looking for the answer. I turned up &lt;a href="https://archlinuxarm.org/forum/viewtopic.php?f=64&amp;amp;t=11396"&gt;this post in the Arch Linux ARM forums&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On page two of the thread it says that version 3.3+ is required.&lt;/p&gt;
&lt;p&gt;As my main machine is &lt;code&gt;Debian Stretch&lt;/code&gt; my version was not
that high.&lt;/p&gt;
&lt;p&gt;Below is a script which will get, make and install a
sufficiently current version:&lt;/p&gt;
&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# Get, build and install the version of bsdtar needed by the Raspberry Pi Arch Linux root file-system get and &lt;/span&gt;
&lt;span class="c1"&gt;# extract&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;whoami&lt;span class="sb"&gt;`&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'root'&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Script must be run as root, try: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;exit&lt;/span&gt; 1
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="nb"&gt;set&lt;/span&gt; -e

wget https://www.libarchive.org/downloads/libarchive-3.3.1.tar.gz
tar xzf libarchive-3.3.1.tar.gz
&lt;span class="nb"&gt;cd&lt;/span&gt; libarchive-3.3.1
./configure
make
make install
&lt;span class="nb"&gt;exit&lt;/span&gt; 0
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Now:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;bsdtar --version
&lt;/pre&gt;


&lt;p&gt;Should show a version &amp;gt; 3.3.&lt;/p&gt;
&lt;p&gt;Here is how to clone my repo and use the script:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;git clone https://github.com/cromarty/rpi-stuff
&lt;/pre&gt;


&lt;p&gt;Now:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;cd rpi-stuff/make-rpi-arch
&lt;/pre&gt;


&lt;p&gt;Execute the script with one argument, which is the version
architecture:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;sudo ./make-rpi-arch.sh &amp;lt;architecture&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Where &lt;code&gt;&amp;lt;architecture&amp;gt;&lt;/code&gt; is one of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;armv6 for the older Pi versions&lt;/li&gt;
&lt;li&gt;armv7 for the Pi2&lt;/li&gt;
&lt;li&gt;armv8 for the Pi3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note I have never run an &lt;code&gt;armv8&lt;/code&gt; image.&lt;/p&gt;
&lt;p&gt;The script also needs &lt;code&gt;bsdtar&lt;/code&gt; (as discussed above), &lt;code&gt;kpartx&lt;/code&gt;, and
&lt;code&gt;parted&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><category>Arch</category><category>bsdtar</category><category>Raspberry Pi</category><guid>http://eyesfreelinux.ninja/posts/raspberry-pi-arch-and-the-fix.html</guid><pubDate>Fri, 22 Sep 2017 20:29:56 GMT</pubDate></item><item><title>Internationalising Shell Scripts with Gettext</title><link>http://eyesfreelinux.ninja/posts/internationalising-shell-scripts-with-gettext.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;As part of my work for the &lt;a href="http://f123.org/"&gt;F123 Project&lt;/a&gt; I've had to learn how to prepare &lt;code&gt;bash&lt;/code&gt; shell 
scripts for translation into multiple languages using &lt;code&gt;gettext&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is a little workflow document I have written on the subject.&lt;/p&gt;
&lt;h3&gt;Shell Internationalisation Workflow&lt;/h3&gt;
&lt;p&gt;To provide translations for shell scripts we use the gettext package.&lt;/p&gt;
&lt;h3&gt;Preparing a Shell Script for Translation&lt;/h3&gt;
&lt;p&gt;Shell scripts contain &lt;code&gt;echo&lt;/code&gt; commands to provide user feedback.&lt;/p&gt;
&lt;p&gt;We need for the strings displayed by an &lt;code&gt;echo&lt;/code&gt; command to be displayed in the language the user of 
the machine is using.&lt;/p&gt;
&lt;p&gt;In the top of the script we put these lines:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;export TEXTDOMAIN=myscript
export TEXTDOMAINDIR=/usr/share/locale

. gettext.sh
&lt;/pre&gt;


&lt;p&gt;In the above example &lt;code&gt;myscript&lt;/code&gt; is an example script name.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;TEXTDOMAINDIR&lt;/code&gt; above contains the usual path to localization for a typical Linux installation. 
It may be raplaced with:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="x"&gt;export TEXTDOMAINDIR=&lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;PWD&lt;/span&gt;&lt;span class="x"&gt;/locale&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;For testing a script's translation.&lt;/p&gt;
&lt;p&gt;The script author changes typical &lt;code&gt;cho&lt;/code&gt; of this syntax:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;echo 'Press any key to continue'
&lt;/pre&gt;


&lt;p&gt;With:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;echo $(gettext "Press any key to continue") ; echo
&lt;/pre&gt;


&lt;p&gt;We place an extra &lt;code&gt;echo&lt;/code&gt; with no arguments at the end because the &lt;code&gt;gettext&lt;/code&gt; function does not add a line-feed.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;gettext&lt;/code&gt; function is contained in the &lt;code&gt;gettext.sh&lt;/code&gt; script included at the top of the script.&lt;/p&gt;
&lt;p&gt;If an echoed string contains any shell variables they must be replaced.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;echo "Program name: $0"
&lt;/pre&gt;


&lt;p&gt;Becomes:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;PROGNAME&lt;/span&gt;&lt;span class="o"&gt;=$&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt;
&lt;span class="nt"&gt;echo&lt;/span&gt; &lt;span class="o"&gt;$(&lt;/span&gt;&lt;span class="nt"&gt;eval_gettext&lt;/span&gt; &lt;span class="s2"&gt;"Prog name: \$PROGNAME"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nt"&gt;echo&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;The &lt;code&gt;eval_gettext&lt;/code&gt; function is used instead of &lt;code&gt;gettext&lt;/code&gt; and the dolla-sign is &lt;code&gt;escaped&lt;/code&gt; with a 
back-slash.&lt;/p&gt;
&lt;p&gt;Again an extra &lt;code&gt;echo&lt;/code&gt; is put in after the command to echo a translated string.&lt;/p&gt;
&lt;h3&gt;Extracting Strings into a Portable Object Template (.pot)&lt;/h3&gt;
&lt;p&gt;Now we run &lt;code&gt;xgettext&lt;/code&gt; against our script to create a file of strings to translate.&lt;/p&gt;
&lt;p&gt;We do this in this fashion:&lt;/p&gt;
&lt;p&gt;xgettext -L Shell -o myscript.pot myscript&lt;/p&gt;
&lt;p&gt;This reads all the &lt;code&gt;echo&lt;/code&gt; commands which contain references to the &lt;code&gt;gettext&lt;/code&gt; and &lt;code&gt;eval_gettext&lt;/code&gt; functions and writes them to a &lt;code&gt;.pot&lt;/code&gt; (portable object template) file.&lt;/p&gt;
&lt;p&gt;Here is a simple example of the contents of a &lt;code&gt;.pot&lt;/code&gt; file for a script which contains only one &lt;code&gt;echo&lt;/code&gt; command:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nt"&gt;SOME&lt;/span&gt; &lt;span class="nt"&gt;DESCRIPTIVE&lt;/span&gt; &lt;span class="nt"&gt;TITLE&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nt"&gt;Copyright&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;C&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nt"&gt;YEAR&lt;/span&gt; &lt;span class="nt"&gt;THE&lt;/span&gt; &lt;span class="nt"&gt;PACKAGE&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nt"&gt;S&lt;/span&gt; &lt;span class="nt"&gt;COPYRIGHT&lt;/span&gt; &lt;span class="nt"&gt;HOLDER&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nt"&gt;This&lt;/span&gt; &lt;span class="nt"&gt;file&lt;/span&gt; &lt;span class="nt"&gt;is&lt;/span&gt; &lt;span class="nt"&gt;distributed&lt;/span&gt; &lt;span class="nt"&gt;under&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;same&lt;/span&gt; &lt;span class="nt"&gt;license&lt;/span&gt; &lt;span class="nt"&gt;as&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;PACKAGE&lt;/span&gt; &lt;span class="nt"&gt;package&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nt"&gt;FIRST&lt;/span&gt; &lt;span class="nt"&gt;AUTHOR&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;EMAIL&lt;/span&gt;&lt;span class="k"&gt;@ADDRESS&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;,&lt;/span&gt; &lt;span class="nt"&gt;YEAR&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;fuzzy&lt;/span&gt;
&lt;span class="nt"&gt;msgid&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;span class="nt"&gt;msgstr&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;span class="s2"&gt;"Project-Id-Version: PACKAGE VERSION\n"&lt;/span&gt;
&lt;span class="s2"&gt;"Report-Msgid-Bugs-To: \n"&lt;/span&gt;
&lt;span class="s2"&gt;"POT-Creation-Date: 2017-04-19 22:52+0100\n"&lt;/span&gt;
&lt;span class="s2"&gt;"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"&lt;/span&gt;
&lt;span class="s2"&gt;"Last-Translator: FULL NAME &amp;lt;EMAIL@ADDRESS&amp;gt;\n"&lt;/span&gt;
&lt;span class="s2"&gt;"Language-Team: LANGUAGE &amp;lt;LL@li.org&amp;gt;\n"&lt;/span&gt;
&lt;span class="s2"&gt;"Language: \n"&lt;/span&gt;
&lt;span class="s2"&gt;"MIME-Version: 1.0\n"&lt;/span&gt;
&lt;span class="s2"&gt;"Content-Type: text/plain; charset=UTF-8\n"&lt;/span&gt;
&lt;span class="s2"&gt;"Content-Transfer-Encoding: 8bit\n"&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;myscript&lt;/span&gt;&lt;span class="nd"&gt;:10&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;sh-format&lt;/span&gt;
&lt;span class="nt"&gt;msgid&lt;/span&gt; &lt;span class="s2"&gt;"Hello world: $PROGNAME"&lt;/span&gt;
&lt;span class="nt"&gt;msgstr&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;In the above example there are values in upper-case at the top in the comments which should be filled out with the details of the package-name, and the author details etc.&lt;/p&gt;
&lt;p&gt;And this line:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="s2"&gt;"Content-Type: text/plain; charset=CHARSET\n"&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Should be changed to read:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="s2"&gt;"Content-Type: text/plain; charset=UTF-8\n"&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Or whichever character-set we are using.&lt;/p&gt;
&lt;h3&gt;The Translation Process&lt;/h3&gt;
&lt;p&gt;The first-cut &lt;code&gt;.pot&lt;/code&gt; file should be passed to a translator with the name changed to drop the ending &lt;code&gt;t&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;cp myscript.pot myscript.po
&lt;/pre&gt;


&lt;p&gt;Now give the &lt;code&gt;.po&lt;/code&gt; (portable object) file to a translator.&lt;/p&gt;
&lt;p&gt;After the line which reads:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;  "Content-Transfer-Encoding: 8bit\n"
&lt;/pre&gt;


&lt;p&gt;There will be entries of the form:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;  msgid "Some string in the original language"
  msgstr ""
&lt;/pre&gt;


&lt;p&gt;A translator places the translation of the string in the &lt;code&gt;msgid&lt;/code&gt; entry in the &lt;code&gt;msgstr&lt;/code&gt; entry between the    quotes.&lt;/p&gt;
&lt;p&gt;The translator &lt;em&gt;MUST&lt;/em&gt; preserve any shell variable reference that is in the original string. For example:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="x"&gt;msgid "Attention! &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;ERRORCODE&lt;/span&gt;&lt;span class="x"&gt;"&lt;/span&gt;
&lt;span class="x"&gt;      msgstr "Achtung! &lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;ERRORCODE&lt;/span&gt;&lt;span class="x"&gt;"&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;In this way a translator goes right through the file and translates the strings, leaving the &lt;code&gt;msgid&lt;/code&gt; entries as-is, and placing their translations in the corresponding &lt;code&gt;msgstr&lt;/code&gt; entries.&lt;/p&gt;
&lt;h3&gt;Creating &lt;code&gt;Machine Object&lt;/code&gt; Files&lt;/h3&gt;
&lt;p&gt;The files which will actually be used when a script runs, to provide translated strings is a &lt;code&gt;.mo&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;We create this from a &lt;code&gt;.po&lt;/code&gt; file like this:&lt;/p&gt;
&lt;p&gt;msgfmt -o myscript.mo myscript.po&lt;/p&gt;
&lt;p&gt;Which will create &lt;code&gt;myscript.mo&lt;/code&gt; from &lt;code&gt;myscript.po&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Merging New Strings&lt;/h3&gt;
&lt;p&gt;Of course the development of a complex script is never static and it may be necessary to add new strings, or to remove old ones. We can use another utility to &lt;code&gt;merge&lt;/code&gt; strings from a new &lt;code&gt;.pot&lt;/code&gt; file into our &lt;code&gt;.po&lt;/code&gt; file and re-create our &lt;code&gt;.mo&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;For this we use &lt;code&gt;msgmerge&lt;/code&gt;, like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;msgmerge -U myscript.po myscript.pot
&lt;/pre&gt;


&lt;p&gt;This will search the &lt;code&gt;.pot&lt;/code&gt; file for new or deleted strings and merge them into the &lt;code&gt;.po&lt;/code&gt; file. In this way previous translation work is not lost when things change.&lt;/p&gt;
&lt;p&gt;And again we then create a new &lt;code&gt;.mo&lt;/code&gt; file from the update &lt;code&gt;.po&lt;/code&gt; file.&lt;/p&gt;
&lt;h3&gt;Installing a Translation&lt;/h3&gt;
&lt;p&gt;Using our &lt;code&gt;myscript&lt;/code&gt; example from above, the &lt;code&gt;.mo&lt;/code&gt; file is installed in:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;  /usr/share/locale/&amp;lt;LANG&amp;gt;/LC_MESSAGES/myscript.mo
&lt;/pre&gt;


&lt;p&gt;Where &lt;alang&gt; is the language into which the script has been translated.&lt;/alang&gt;&lt;/p&gt;
&lt;p&gt;For example, for Brazilian Portuguese:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;/usr/share/locale/pt_BR/LC_MESSAGES/myscript.mo
&lt;/pre&gt;


&lt;h3&gt;The Worklow in Short&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Script is written and tested, including gettext support.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;xgettext&lt;/code&gt; to extract all &lt;code&gt;echo&lt;/code&gt; strings into a &lt;code&gt;.pot&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;Rename the &lt;code&gt;.pot&lt;/code&gt; file to &lt;code&gt;.po&lt;/code&gt; and pass to translator.&lt;/li&gt;
&lt;li&gt;When step 3 is done, run &lt;code&gt;msgfmt&lt;/code&gt; to create the &lt;code&gt;.mo&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;Install the &lt;code&gt;.mo&lt;/code&gt; file (after testing).&lt;/li&gt;
&lt;li&gt;If something new is written in the script, go to step 2 and repeat to step 5.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Notes/Suggestions&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;.po&lt;/code&gt; files to be translated should probably either be contained in a directory structure which clearly defines the language, or should contain the language in the file-name, although the completed &lt;code&gt;.mo&lt;/code&gt; file cannot.&lt;/p&gt;
&lt;p&gt;So, for &lt;code&gt;myscript&lt;/code&gt;, perhaps:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;myscript/
    en/myscript.en.po (English)
            fr/myscript.fr.po (French)
                        pt_BR/myscript.pt_BR.po (Brazilian Portuguese)
&lt;/pre&gt;&lt;/div&gt;</description><guid>http://eyesfreelinux.ninja/posts/internationalising-shell-scripts-with-gettext.html</guid><pubDate>Fri, 21 Apr 2017 15:03:48 GMT</pubDate></item><item><title>How to Generate a Table of Contents in a Kramdown Document</title><link>http://eyesfreelinux.ninja/posts/how-to-generate-a-table-of-contents-in-a-kramdown-document.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;Here's how to generate a table of contents in &lt;code&gt;kramdown&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

# Heading
{:.no_toc} 

## Table of Contents
{:.no_toc}

* TOC 
{:toc} 

&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;kramdown gem&lt;/code&gt; converts a kramdown file into html. It generates the id tags for each heading and 
uses them to generate a table of contents for a document. This becomes obvious if you take a file 
written in kramdown and convert it to html.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;kramdown input-file.md &amp;gt; output-file.html
&lt;/pre&gt;


&lt;p&gt;The ids are put on the generated html for all headings.&lt;/p&gt;
&lt;h3&gt;How To Automatically Generate A Table of Contents&lt;/h3&gt;
&lt;p&gt;Typically, you will want to have a numbered list for your table of contents or a bulleted list of 
entries. This is done by either writing &lt;code&gt;1. TOC&lt;/code&gt; or &lt;code&gt;* TOC&lt;/code&gt; at the place in your file where you want 
the table of contents to be located. Underneath this line, specify the
table of contents itself:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

{:toc}

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can have either a numbered list of items or a bulleted list, in
the normal way for lists:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

1. TOC 
{:toc} 

* TOC 
{:toc} 

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you do not want a heading to be included in the table of 
contents, put:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

`{:.no_toc}

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Underneath the entry you want to exclude from the table of contents, often your top-level heading.&lt;/p&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;p&gt;I have noticed that there is either a bug or an accidental omission in the 
generation of the toc. For example,, given headings like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

# First level one heading
## First level two heading 
## Second level two heading 
## Third level two heading
# Second level one heading

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I would expect the second level one heading to be a member of the list of level one headings, but it 
is left hanging in between two lists of second level headings, and is a member of no list. This bug 
makes sub-lists and then a return to a lower level further down impossible.&lt;/p&gt;
&lt;p&gt;So you will need to have all headings which go to make up a table of
contents the same level.&lt;/p&gt;
&lt;p&gt;A bit annoying but it beats constantly scrolling up and down a
document as you write it to try to remember the order of the headings
and their names.&lt;/p&gt;&lt;/div&gt;</description><category>kramdown</category><category>markdown</category><guid>http://eyesfreelinux.ninja/posts/how-to-generate-a-table-of-contents-in-a-kramdown-document.html</guid><pubDate>Sat, 01 Apr 2017 20:15:59 GMT</pubDate></item><item><title>Tool for Installing Talking Arch</title><link>http://eyesfreelinux.ninja/posts/tool-for-installing-talking-arch.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;I've written a &lt;code&gt;bash&lt;/code&gt; script that will install the Talking Arch distro non-interactively.&lt;/p&gt;
&lt;p&gt;To use it follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Boot Talking Arch&lt;/li&gt;
&lt;li&gt;Set up your partitions&lt;/li&gt;
&lt;li&gt;`wget http://www.raspberryvi.org/Downloads/ta-tools-1.0.0.tar.gz&lt;/li&gt;
&lt;li&gt;tar zxf ta-tools-1.0.0.tar.gz&lt;/li&gt;
&lt;li&gt;Make sure the contained script is executable and run it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It will do the first &lt;code&gt;pre-chroot&lt;/code&gt; of the install and write a &lt;code&gt;here&lt;/code&gt; script into the &lt;code&gt;chroot&lt;/code&gt; and 
mark it executable.&lt;/p&gt;
&lt;p&gt;After the &lt;code&gt;chroot&lt;/code&gt;, run the newly created script to create the installation.&lt;/p&gt;
&lt;p&gt;Here is the full script:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

#!/bin/bash
#
# Talking Arch setup
#

# Change the commenting of the variables below
REGION=Europe
#REGION=America

CITY=London
#CITY=Chicago

LOCALE=en_UK
#LOCALE=en_US

KEYMAP=uk
#KEYMAP=us

DEVICE=${1}

HOSTNAME=arch

ROOTPASSWORD=root

USER=user
PASSWORD=password

# This MUST be a full path to where the script must be in the chroot
HERE_SCRIPT=/mnt/root/001-ta-tools.sh

# Crash out on any error
set -e

echo 'Mounting the disk partition(s)...'
mount ${DEVICE} /mnt

echo 'Pacstrapping the new system in what will be the chroot...'
pacstrap /mnt git base espeakup alsa-utils openssh acpi wget base-devel nmap lynx

echo 'Setting up fstab...'
genfstab -U -p /mnt &amp;gt;&amp;gt; /mnt/etc/fstab

#
# Write a 'here' script into the chroot before we chroot
#
cat  ${HERE_SCRIPT}
#!/bin/bash

set -e

echo 'Setting up localisation stuff...'
sed -i 's:#${LOCALE}.UTF-8 UTF-8:${LOCALE}.UTF-8 UTF-8:' /etc/locale.gen
echo "LANG=${LOCALE}.UTF-8" &amp;gt; /etc/locale.conf
export LANG=${LOCALE}.UTF-8
locale-gen

echo 'Removing /etc/localtime if it exists before replacing it...'
[ -f /etc/localtime ] &amp;amp;&amp;amp; rm /etc/localtime
ln -s /usr/share/zoneinfo/${REGION}/${CITY} /etc/localtime

echo 'Setting up keymap...'
echo "KEYMAP=${KEYMAP}" &amp;gt; /etc/vconsole.conf

echo 'Setting the hardware clock...'
hwclock --systohc --utc

echo 'Setting the hostname...'
echo ${HOSTNAME} &amp;gt; /etc/hostname

echo 'Setting the password for root...'
echo -e "${ROOTPASSWORD}\n${ROOTPASSWORD}\n" | passwd root

echo 'Adding an ordinary user...'
useradd -m -g users -G wheel,storage,power,audio -s /bin/bash ${USER}
echo -e "${PASSWORD}\n${PASSWORD}\n" | passwd ${USER}

echo 'Editing /etc/sudoers to grant the usual privileges...'
sed -i 's:# %wheel ALL=(ALL) ALL: %wheel ALL=(ALL) ALL:' /etc/sudoers

echo 'Installing grub...'
pacman -S --noconfirm --noprogress grub-bios

echo 'Setting up grub...'
grub-install --target=i386-pc --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

echo 'Setting some stuff in /etc/hosts.allow...'
echo 'SSHD: ALL' &amp;gt;&amp;gt; /etc/hosts.allow

echo 'Enabling the sshd service...'
systemctl enable sshd.service

echo 'Enabling the dhcpcd service...'
systemctl enable dhcpcd.service

echo 'Enabling the espeakup service...'
systemctl enable espeakup.service

echo 'About to exit chroot...'
exit

echo 'un-mounting hard-disk partitions from virtual mount point...'
 umount /mnt/home
 umount /mnt

EOF

# Mark the created here script executable
chmod +x ${HERE_SCRIPT}


echo 'All done'
exit 0

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description><category>install</category><category>Talking Arch</category><guid>http://eyesfreelinux.ninja/posts/tool-for-installing-talking-arch.html</guid><pubDate>Sat, 01 Apr 2017 10:13:51 GMT</pubDate></item><item><title>Installing `yaourt` on Arch Linux</title><link>http://eyesfreelinux.ninja/posts/yaourt.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;You can install yaourt from the AUR:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;git clone https://aur.archlinux.org/package-query.git
cd package-query
makepkg -si
cd ..
git clone https://aur.archlinux.org/yaourt.git
cd yaourt
makepkg -si
cd ..
&lt;/pre&gt;


&lt;h3&gt;Examples&lt;/h3&gt;
&lt;p&gt;Search and install:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;yaourt Sync database, upgrade packages, search aur and devel (all packages based on dev
&lt;/pre&gt;


&lt;p&gt;version) upgrades:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;yaourt -Syu --devel --aur Build package from source:
yaourt -Sb Check, edit, merge or remove *.pac* files:
yaourt -C Get a PKGBUILD (support splitted package):
yaourt -G Build and export package, its sources to a directory:
yaourt -Sb --export Backup database:
yaourt -B Query backup file:
yaourt -Q --backupfile
&lt;/pre&gt;


&lt;h3&gt;Notes&lt;/h3&gt;
&lt;p&gt;Yaourt gives an opportunity to edit the PKGBUILD and if the answer is 'y' it asks which editor to 
use if none is selected by your environment. Type in 'nano'. When getting tclx for use with 
emacspeak you will need to add armv7 if it is for a Pi2.&lt;/p&gt;&lt;/div&gt;</description><category>aur</category><category>yaourt</category><guid>http://eyesfreelinux.ninja/posts/yaourt.html</guid><pubDate>Sat, 04 Mar 2017 20:05:10 GMT</pubDate></item><item><title>Libre Office Writer Shortcut Keys</title><link>http://eyesfreelinux.ninja/posts/libre-office-writer-shortcut-keys.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;Here is a link to &lt;a href="https://help.libreoffice.org/Writer/Shortcut_Keys_for_Writer"&gt;the shortcut keys for Libre Office Writer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are loads of shortcut keys and the folks at Libre Office have thought with great attention to 
accessibility.&lt;/p&gt;
&lt;p&gt;There is the odd dialog where you may need to use screen review mode and move the mouse cursor and 
click with the keyboard to get focus into a control, but these instances are few and far between.&lt;/p&gt;&lt;/div&gt;</description><category>Keyboard shortcuts</category><category>Libre Office</category><category>Writer</category><guid>http://eyesfreelinux.ninja/posts/libre-office-writer-shortcut-keys.html</guid><pubDate>Fri, 22 Jul 2016 13:53:53 GMT</pubDate></item><item><title>Nikola plugin for kramdown</title><link>http://eyesfreelinux.ninja/posts/kramdown-plugin.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;!--
.. title: Nikola plugin for kramdown
.. slug: kramdown-plugin
.. date: 2016-02-04 17:44:49 UTC
.. tags: kramdown, markdown
.. category: 
.. link: 
.. description: A Nikola plugin for kramdown posts and pages
.. type: text
--&gt;

&lt;p&gt;I’m not surprised that &lt;a href="http://daringfireball.net/"&gt;markdown&lt;/a&gt; has become so successful and ubiquitous.  But one of the 
things I think it lacks is syntax for creating tables.&lt;/p&gt;

&lt;p&gt;For this reason, I have been using a &lt;a href="http://txt2tags.org/"&gt;txt2tags&lt;/a&gt; plugin for a while.  My sites all have a 
lot of tabular data, both as a function of the nature of the sites and also because I just like 
tables.&lt;/p&gt;

&lt;p&gt;But I recently discovered &lt;a href="http://kramdown.gettalong.org/"&gt;kramdown&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;kramdown has a super-set of markdown syntax, including simple, but powerful table-creation syntax.&lt;/p&gt;

&lt;p&gt;So I’ve written a &lt;a href="https://plugins.getnikola.com/"&gt;plugin&lt;/a&gt; for &lt;a href="http://getnikola.com/"&gt;Nikola&lt;/a&gt; along the lines of the txt2tags plugin to 
compile HTML posts and pages from kramdown files.  For which I have started using the .kd extension.&lt;/p&gt;

&lt;p&gt;This post is written in kramdown.&lt;/p&gt;

&lt;p&gt;So this post is somewhat by way of a test of my kramdown plugin for Nikola.&lt;/p&gt;

&lt;h3&gt;Third-level Heading&lt;/h3&gt;

&lt;p&gt;The above heading is marked with two hash characters and in the same way that markdown posts have 
their heading demoted by one level I have done the same with kramdown.&lt;/p&gt;

&lt;p&gt;Here is a table of silly data:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style="text-align: right"&gt;Date&lt;/th&gt;
      &lt;th style="text-align: left"&gt;Weather&lt;/th&gt;
      &lt;th style="text-align: left"&gt;Activity&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style="text-align: right"&gt;01-Feb-2016&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Rain&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Stayed in&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style="text-align: right"&gt;02-Feb-2016&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Dry and cloudy&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Stayed in again&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style="text-align: right"&gt;03-Feb-2016&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Cold, -4C&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Had to go out for most of the day&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style="text-align: right"&gt;04-Feb-2016&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Even colder than yesterday&lt;/td&gt;
      &lt;td style="text-align: left"&gt;Stayed in and wrote a kramdown plugin for Nikola&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3&gt;Lists&lt;/h3&gt;

&lt;p&gt;Lists are the same as in markdown&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;unordered list item one&lt;/li&gt;
  &lt;li&gt;Unordered list item two&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Links&lt;/h3&gt;

&lt;p&gt;The links in the above text are all done like references are done in markdown, with the actual URI 
of each link at the bottom of the text file.&lt;/p&gt;&lt;/div&gt;</description><category>kramdown</category><category>markdown</category><guid>http://eyesfreelinux.ninja/posts/kramdown-plugin.html</guid><pubDate>Thu, 04 Feb 2016 17:44:49 GMT</pubDate></item><item><title>Atom.io Editor Totally Inaccessible</title><link>http://eyesfreelinux.ninja/posts/atomio-editor-totally-inaccessible.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;I've just tried the &lt;em&gt;atom.io&lt;/em&gt; editor.&lt;/p&gt;
&lt;p&gt;I did this because there was to be a talk about it at the Portsmouth LUG, which I went to last 
Saturday.&lt;/p&gt;
&lt;p&gt;It's totally inaccessible on Linux, Debian with the Mate desktop.&lt;/p&gt;
&lt;p&gt;Apparently it is an editor written in Javascript and, if I have this correct, it renders the screen 
with the Chrome browser, or sub-system.  There's also something called &lt;em&gt;node.js&lt;/em&gt; involved.&lt;/p&gt;
&lt;p&gt;These are technologies I know little about, except that it doesn't make a sound with Orca.&lt;/p&gt;
&lt;p&gt;So there's another editor we can't use.&lt;/p&gt;
&lt;p&gt;Back to good old &lt;em&gt;Emacs&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;</description><guid>http://eyesfreelinux.ninja/posts/atomio-editor-totally-inaccessible.html</guid><pubDate>Mon, 23 Nov 2015 13:37:44 GMT</pubDate></item><item><title>Transmission Command-line Bit-torrent Programs</title><link>http://eyesfreelinux.ninja/posts/transmission-command-line-bit-torrent-programs.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;I was after a method of downloading and seeding bit-torrents exclusively from the command-line.&lt;/p&gt;
&lt;p&gt;I tried &lt;code&gt;aria2&lt;/code&gt; but found it unreliable.  I don't know if it was because I was doing something wrong 
but none of the torrent files I downloaded were not corrupted in some way.&lt;/p&gt;
&lt;p&gt;And anyway I wanted something to run in the background.&lt;/p&gt;
&lt;p&gt;I tried &lt;code&gt;transmission-cli&lt;/code&gt;.  Better results but again this was not something that just ran in the 
background.&lt;/p&gt;
&lt;p&gt;So I installed a pair of related programs: &lt;code&gt;transmission-daemon&lt;/code&gt; and &lt;code&gt;transmission-remote&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;Daemon&lt;/em&gt; part of this program is exactly that, a &lt;code&gt;daemon&lt;/code&gt; that runs, as all daemons do, in the 
background.&lt;/p&gt;
&lt;p&gt;And the &lt;em&gt;Remote&lt;/em&gt; part is a command-line program to control it.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;remote&lt;/code&gt; part is included in the &lt;code&gt;transmission-cli&lt;/code&gt; package.&lt;/p&gt;
&lt;p&gt;So:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;$ sudo apt-get install transmission-daemon transmission-cli
&lt;/pre&gt;


&lt;p&gt;Will install them both on Debian or Debian derivatives.  Although why you're running a derivative 
when you could run &lt;strong&gt;Debian&lt;/strong&gt; I don't know.&lt;/p&gt;
&lt;p&gt;The default installation of &lt;code&gt;transmission-daemon&lt;/code&gt; is configured for the user it runs to be set to 
&lt;code&gt;transmission&lt;/code&gt; and the password is also set to &lt;code&gt;transmission&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;And by default it is only possible to access the daemon and the management web page from the local 
machine (&lt;code&gt;localhost&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;This led to a tedious situation, any command entered to make &lt;code&gt;transmission-remote&lt;/code&gt; do anything 
with the daemon meant this was the command-line:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;$ transmission-remote localhost --auth transmission:transmission &amp;lt;command&amp;gt;
&lt;/pre&gt;


&lt;p&gt;I don't want to have to type that in every time.&lt;/p&gt;
&lt;p&gt;So I set up an alias in &lt;code&gt;.bash_aliases&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;alias trem='transmission-remote localhost --auth transmission:transmission'
&lt;/pre&gt;


&lt;p&gt;Now I can just type:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;$ trem &amp;lt;command&amp;gt;
&lt;/pre&gt;


&lt;p&gt;For example, to add a torrent:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;$ trem --add &amp;lt;torrent&amp;gt;
&lt;/pre&gt;


&lt;p&gt;To list all the current torrents and their status:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;$ trem --list
&lt;/pre&gt;


&lt;p&gt;To remove and delete a torrent:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;$ trem -tN --remove-and-delete
&lt;/pre&gt;


&lt;p&gt;(where N is the number in the list returned by the &lt;code&gt;--list&lt;/code&gt; command).&lt;/p&gt;
&lt;p&gt;To start a torrent:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;$ trem -tN --start
&lt;/pre&gt;


&lt;p&gt;And to stop one:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;trem -tN --stop
&lt;/pre&gt;


&lt;p&gt;There are loads of other commands but these are the ones I use the most, and mostly &lt;code&gt;--add&lt;/code&gt; and 
&lt;code&gt;--list&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note also that &lt;code&gt;transmission&lt;/code&gt; will handle the &lt;code&gt;magnet&lt;/code&gt; links found on the &lt;em&gt;Pirate Bay&lt;/em&gt; download 
site.&lt;/p&gt;&lt;/div&gt;</description><category>bit-torrent</category><category>command-line</category><guid>http://eyesfreelinux.ninja/posts/transmission-command-line-bit-torrent-programs.html</guid><pubDate>Thu, 20 Aug 2015 11:19:00 GMT</pubDate></item><item><title>Capturing Regions of the Screen</title><link>http://eyesfreelinux.ninja/posts/capturing-regions-of-the-screen.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;Here are some nice keystrokes that work in Debian, and probably other distros as well as these are 
essentially Gnome actions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PrintScreen -- Takes a screenshot of your entire desktop and saves it 
to the Desktop folder&lt;/li&gt;
&lt;li&gt;Alt + PrintScreen -- Saves a screenshot of the focused window to the 
Desktop Folder&lt;/li&gt;
&lt;li&gt;Shift + PrintScreen -- Lets you select an area of the screen, and saves to the 
Desktop Folder&lt;/li&gt;
&lt;li&gt;Ctrl + PrintScreen -- Takes a screenshot of your entire desktop and copies it to 
the clipboard&lt;/li&gt;
&lt;li&gt;Ctrl + Alt + PrintScreen -- copies a screenshot of the focused window to the 
clipboard&lt;/li&gt;
&lt;li&gt;Ctrl + Shift + PrintScreen -- Lets you select an area of the screen, and copies it to 
the clipboard&lt;/li&gt;
&lt;li&gt;Ctrl + Shift + Alt + R -- Records a Screencast) of your entire desktop and saves it 
to your Videos folder&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The 'Desktop' folder may be different on other flavours, like 'Pictures' on 
Fedora.&lt;/p&gt;
&lt;p&gt;The commands which allow selection of an area are not much use when you can't see but the others 
are nice. I particularly like the idea of a &lt;em&gt;screen-cast&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Thanks to the guys on the &lt;a href="http://surrey.lug.org.uk/"&gt;Surrey Linux User Group&lt;/a&gt; email list for these.&lt;/p&gt;&lt;/div&gt;</description><guid>http://eyesfreelinux.ninja/posts/capturing-regions-of-the-screen.html</guid><pubDate>Wed, 05 Aug 2015 18:40:12 GMT</pubDate></item></channel></rss>