Map AltGr to Alt on Linux

All I wanted was to make my AltGr key to work the same as my Alt key…

As my poor hands continue to struggle with RSI, I’ve been looking at ways to make my typing more efficient. One thing that occurred to me was to fix something that had bugged me for ages: the fact that I never use AltGr on my keyboard. Things would be easier if it acted like Alt. It would certainly make it more comfortable to hit M-x and M-g in Emacs

And so I searched and searched for ways to do this. The simplest way I found was to type the following command into the terminal:

setxkbmap -option altwin:meta_alt

But how to run that at startup?

My Arch Linux setup uses the i3 window manager, which is called from ~/.xinitrc. Adding setxkbmap -option altwin:meta_alt to the beginning of ~/.xinitrc did the trick.

That doesn’t work on Ubuntu 16.04, however. The easiest way there is to use dconf editor.

sudo apt-get install dconf-editor if you’ve not already got it, then navigate to org|gnome|desktop|input-sources and choose xkb-options.

Insert the following in the value box: ['altwin:meta_alt']

… and that’s it.

RSI, Tendonitis, Carpal Tunnel Syndrome…

I suppose it was inevitable that after so much time spent writing stories and articles and programming, I would suffer from Repetitive Strain Injury.

I’ve taken care of myself over the years: making sure I set up my work station properly, doing exercises, buying a suitable chair, using an ergonomic keyboard. Even so, things are getting more uncomfortable…

So now I’ve taken three further steps, as follows:

i3wm

I’ve installed the i3 tiling window manager on my Ubuntu setup. (Here’s an article on why you should use a tiling window manager)

I’ve used i3 for some time on my Arch Linux setup, mainly for speed and simplicity. As it has become apparent that using the mouse gives me the greatest amount of pain, it seems sensible to do anything to reduce its use. The i3 desktop is the perfect solution. It allows you to do nearly everything using the keyboard, which has the added bonus of increasing productivity.

I now deliberately push the mouse away from the keyboard so as to lead me not into temptation whilst I work. Doing this has encouraged me to learn the shortcut keys for applications such as Chrome and even things like VLC and Spotify. If I’m honest, it’s only laziness that’s stopped me learning them in the past: I could have searched for the Chrome shortcuts at any time, but it was easier just to use the mouse.

i3wm sits nicely on top of Ubuntu. Installing on Ubuntu is a great way to get used to using it, as you have the fallback of logging into Unity when you need it.

Evil Mode

If you read my blog, you’ll know I’m an Emacs user. However, as I said in this blog entry, you have to admit that vi has a great set of key bindings. I do my planning and structural editing in Emacs – there’s nothing faster – but When it comes down to plain text editing I find the vi commands easier on my poor hands. That’s why I use evil-mode.

I’ve set up my .emacs file (see below) so that I can turn evil-mode on or off by pressing F6. I’ve also added code which I found on Stack Overflow that causes evil-mode to go to Emacs mode when I press any insert command. Switching between modes allows me to get the best of both editors. For example, I much prefer vi’s ma and `a to set a mark and jump to it, rather than Emacs’s rather cumbersome C-x r SPC a. Points marked in vi are remembered no matter how often you turn on and off evil-mode in a session.

Dictation Software

Lastly, I’ve taken the plunge and bought voice recognition software, the software used to dictate this blog entry, as a matter of fact. On the plus side, it saves using my hands, on the minus side, Dragon Naturally Speaking only comes in a Windows version. I suppose I should have a look at installing it on Linux using Wine.

I’m finding using Windows 10 extremely depressing experience. Still, I’m only there long enough to dictate notes. After that it’s back onto Linux and Emacs where I use my precious hands to do the editing. I’m currently clocking myself on Emacs, comparing my typing rate with my dictation rate. It will be interesting to see which is faster. I’m having to get used to thinking my thoughts then speaking them rather than just typing and thinking at the same time. I wonder if it will have an effect the creative process? More on that another time…

.emacs and evil-mode

(require 'evil) ;; installed using Elpa

;;  The following ensures j,k for up and down follow visual-line-mode 
(define-key evil-normal-state-map (kbd "<remap> <evil-next-line>") 'evil-next-visual-line)
(define-key evil-normal-state-map (kbd "<remap> <evil-previous-line>") 'evil-previous-visual-line)
(setq-default evil-cross-lines t)

;; i a o etc go to emacs mode 
(defalias 'evil-insert-state 'evil-emacs-state)

;; Turn on and off evil-mode
(global-set-key (kbd "<f6>") 'evil-mode)
(global-set-key (kbd "C-M-z") 'evil-mode)

Goodbye Evernote, Hello Simplenote

Simplenote launched a client for Linux at the end of March, 2016. As a longstanding Evernote premium user, frustrated initially by the fact there’s no Linux client, and then frustrated even more by the fact I could no longer get the Windows client to run under WINE, I thought I’d give it a look.

As the name implies, Simplenote is simpler than Evernote. No notebooks, no reminders, no support for pictures.

In fact the only thing Simplenote handles is text, and that’s its great strength. Sticking to tiny text files means that notes load and sync quickly. Also, the whole experience doesn’t seem as cluttered as Evernote has become with its "all things to all people" approach.

Sticking to text means that Simplenote does a few things extremely well. It has Markdown support built in, for example. I write most of my Evernote notes using markdown format, but Evernote has a habit of adding extra hidden formatting that only becomes obvious when those notes are opened in Draft or Stackedit (it also throws in odd whitespace characters when I copy notes across to Emacs)

Simplenote allows you to download a zip file of all your notes, and its at this point the advantage of sticking to text only really hits home: the files downloaded are text files. That sounds obvious, but it means that rather than picking your way through xml or whatever, you can open an individual note in your favourite text editor and start editing. It’s that simple.

Keeping things text also reduces memory usage, which in turn allows Simplenote to add a history feature – pull back a slider and see previous versions of your notes.

There are some things that aren’t quite there… For example, although you can tag notes in Simplenote, I’ve yet to find a way to filter multiple tags, something that is essential if you want to replicate Evernote’s notebook stacks, which I do.

In summary then, Simplenote does a lot of things better than Evernote, but it’s not a full Evernote replacement.

So which will I be using in future?

No question. Simplenote, for the sole reason that it has the Linux client. It’s not just a question of what to do when there’s no internet connection, it’s also a question of speed. Chrome is so big nowadays it takes an appreciable amount of time to load. Add to that the occasional hiccup when changing between notes on a web browser and the benefits of having a client become obvious.

I wrote this blog entry on Evernote. It may be the last one I do…

Microbits. Really?

The BBC likes to think it single handedly ignited the 80’s UK programming boom thanks to its BBC B micro. Well, maybe so. If you were the sort of kid who’s parents could afford one. Most of us learned our chops on cheaper machines like Spectrums, Vic 20s and even Dragon 32s. (Remember them?) – and were grateful for the opportunity.

Well, now the BBC is back to save the world (or at least that part of it that concerned with educating British children) with the Microbit. Another spectacular example of Auntie knows best.

Now don’t get me wrong. The Microbit is a lovely piece of kit. It’s cheap, it’s flexible, it comes with a well thought out website to help program it. Boxes of the things are being sent out, free of charge, to schools up and down the country.

The thing is, I never asked for them. Are Microbits the best way to teach kids programming? I’m a teacher and I don’t remember being asked for my opinion. The trouble with this sort of thing is that they’re always proposed and built by tech-heads; by people who are very good at IT. They get it, they enjoy it. They always found it easy.

… exactly the wrong sort of person to understand what the average 12 year old non techy finds interesting or difficult. I’m not saying that you can’t motivate kids to learn computing. That’s my day job. But you don’t do it this way. I’m sure that Microbits are going to be featuring in the pages of most local newspapers over the next few months. Expect to see lots of photographs of smiling school children talking about how they’re learning to program. You can’t argue with that. Except the lessons won’t stick, there’ll be no progress for the majority and in a year’s time the Microbits will be sitting in the bin next to the video conferencing kits, the control equipment and the ghosts of the Learning Grids.

No doubt a group of manufacturers are currently sitting round, patting each other on the back as they congratulate each other on doing their bit for education. Frankly, I’d rather the money had been spent giving me a bit more preparation and marking time.

There’s a teacher shortage in this country, there are too many people saying what needs to be done and precious few actually prepared to get their hands dusty at the chalkface. You want to help, get in the classroom and get teaching. Otherwise, shut up, and stop wasting my time.

Learning the C Button Accordion Part Two

I’ve been playing the C button accordion for two months now. Here’s what I’ve noticed

  1. I’m really good at the piano accordion. This isn’t me showing off, more a realisation that having played the piano for something like 40 years now, my fingers go where they should without me having to think about it. I never really registered the fact that I just have to look at piece of music for my fingers to play it, nor that they can form the shape of, for example, a diminished chord all by themselves. Learning another instrument has been a pleasant reminder of what I can do. That doesn’t mean I’ll stop noticing my mistakes all the time, of course. I’ll always feel inadequate compared to better players.
  2. The fact that I already play the piano accordion has been a big help in learning the button accordion. I don’t have to think about the left hand or moving the bellows
  3. The button accordion patterns make sense very quickly. There are only three shapes to playing any major scale on three rows. Or any minor scale. Or any scale at all, for that matter.
  4. I find the crossover from little finger to thumb fiddly.
  5. The books I mentioned on my previous blog entry are excellent. I’m now using book 2 of Maugain Manu’s Methode d’Accrodeon. I’m still on book 1 of the HOHNER FERRERO MEDARD – METHODE D’ACCORDEON CHROMATIQUE COMPLETE. I’ve put links to the books at the end of this post.
  6. I am nowhere near ready to perform on the button accordion.

The books I’ve been using:

Methode d’Accordeon Vol1 by Maugain Manu

and the HOHNER FERRERO MEDARD – METHODE D’ACCORDEON CHROMATIQUE COMPLETE Educational books Accordion

(Click on the images to be taken to Amazon)

Swearing in a Suit

Last week I headed into Manchester to do some writing, as I often do on Wednesdays. An hour in a coffee shop to go through my notes and get my ideas in order, and then off to the library for four or five hours of writing, free of the distractions presented by music and the internet.

All pretty routine, with one exception. I was going to a meeting that evening, so I was wearing a suit. The full works: shirt, tie, jacket, trousers, dress shoes. Nothing unusual. I wear a suit for the day job. I felt perfectly at ease.

Until I began updating my swearword list.

You haven’t got a swearword list? I started one when I wrote COSMOPOLITAN PREDATORS – a list of the different swearwords used by the inhabitants of Eunomia, the asteroid world where the action takes place. It made sense to me that an international community would have a cosmopolitan collection of swearwords. My swearword list contains the word, its meaning and its language of origin. I found it so useful I’ve been keeping it updated for the novel I’m currently writing.

It’s fun using swearwords from different languages, but not, I discovered, when wearing a suit.

Sitting in a cafe in a shirt and tie, copying down lists of rude words, I suddenly felt a little bit childish. Not just a little bit. I felt like there must be better ways to spend my time. I found that I was turning my laptop so that people couldn’t read the screen, that I was checking that no one was watching me.

Thinking about it, this shouldn’t have been surprising. My writing has always been affected by my environment. If not, I wouldn’t carry a notebook with me in order to capture live emotions. But even so, I didn’t realise that environment extended to what I was wearing.

Apparently it does.

So if you find yourself in a coffee shop in Manchester, and you notice a man in a suit blushing as he types away, come over and say hello. Just don’t take offence if I close the laptop first.

EXIF: WordPress Images Appear Rotated

I recently encountered a problem with images appearing rotated whilst updating the latest posting in the How Writers Write feature on this WordPress powered website.

The images looked fine whilst I was editing the page, but when previewed they appeared rotated.

Searching online showed this to be a known problem, all to do with EXIF data. You can read more about EXIF data by following this link to How-To Geek

The WordPress problem seems to be that the images are recorded with one orientation and then displayed with the rotation stored in the EXIF data added to them.

The easiest way I’ve found to get the images displaying properly is to first strip the EXIF data and then to rotate them appropriately before uploading. There are instructions on the How-To Geek link above on how to strip EXIF data in Windows.

It’s a lot simpler in Ubuntu or similar.

First, install exiftool

sudo aptitude install exiftool

Exiftool allows you to look at the EXIF data in an image as follows

exiftool someImage.jpg

We want the data stripped. Copy your images to a directory (I just copy them to my pristine desktop) and then run the following command

me@comp:~/Desktop$ exiftool -all= -overwrite_original -ext jpg .

And that’s it. Time for a cup of tea.

Shorthand

A few years ago I was travelling back to Manchester by train. I couldn’t help overhearing the phone conversation of the person sitting opposite me. He was an aspiring actor, travelling back from an audition in London, and he was recounting the experience so loudly the whole carriage couldn’t help but overhear.

He was a interesting character; it quickly become obvious that every setback in his life was someone else’s fault, that the main thing holding him back was people’s inability to see his natural talent.

So I started to take notes: I’ve written elsewhere about how important I think it is to capture conversation live. In those days I used to write notes in the back of the paperback I was reading, and that’s what I did…

… until the aspiring actor noticed what I was doing, and took offence. He’d read my words upside down.

Which is a roundabout introduction to the real reason I learned shorthand: so I could quickly take notes without other people knowing what I was doing.

I was reminded of this on reading the following article on the BBC website: is the art of shorthand dying out?

Perhaps it is. I don’t use shorthand as much as I used to, I now mainly capture notes straight to Evernote on my phone (although I wish there was an app that understood Teeline).

But I don’t regret learning shorthand. It still comes in useful occasionally, capturing conversations, getting ideas down fast, and giving me something to do in boring meetings.

Anyway, isn’t life all about learning new things?

Learning the C Button Accordion

This Christmas I took the plunge and began learning the button accordion. As I spent quite a frustrating time on the internet trying to find a suitable tutorial I thought I’d share my experience here in case other learners find it useful.

I should point out that I can already play the piano accordion, so my advice may not be suitable for a complete beginner to the instrument.

In the absence of a teacher, the quickest way to learn a new instrument is with a suitable tutorial. Looking around online two books were mentioned

Methode d’Accordeon Vol1 by Maugain Manu

and the HOHNER FERRERO MEDARD – METHODE D’ACCORDEON CHROMATIQUE COMPLETE Educational books Accordion

(Click on the images to be taken to Amazon)

Both books are only available in French. This shouldn’t be too much of a problem to someone who can already read music as the fingering is clear. If you can’t read music, you’ll need another book to explain note lengths and values.

I ordered both books. As the Methode d’Accordeon Vol1 by Maugain Manu was the first to arrive that’s the one I’ve mainly been learning from. It’s the more modern of the two books, and proceeds at a slower pace. If you can afford both books, buy them. Otherwise, If you’ve never played the accordion before the Maugain Manu is the one for you as it takes its time introducing the left hand. If you are already a confident piano accordion player and just want to learn the fingering of the right hand then the Ferrero Medard book may be more to your taste.

I’ve been learning for a week now and everything I’d read appears to be true… the button accordion does appear a more natural way to play. It’s not that great a step up from the piano keyboard, particularly given that my left hand is already used to using buttons, albeit in a stradella layout. I do have a tendency to get lost with the right hand still, and it’s difficult at the moment to play by ear, but that’s improving as I learn the scales (and there are only three fingerings to learn for the major scales… ).

Sadly, the button accordion is going to have to go back in its case for a few days whilst I practice for a gig on the piano accordion, but I’m already looking forward to getting it back out again…

Upgraded to Windows 10 and Ubuntu 15.10

… and that’s it.

Absolutely no problems at all. I didn’t even have to reinstall GRUB as some sites warned me I’d have to.

That’s a dual boot machine, partitioned flash drive.

I don’t know what else to say, I almost feel cheated. Both upgrades took about 15 minutes.

Looks like I’ve got no excuses for not filling in my tax return now.