Replacing Autokey in Wayland

Many Linux distros are leaving xorg (x11) for Wayland, as display server protocol. Unfortunately not all the applications are ready for Wayland.

In particular Autokey, a very useful application to expand text and automatize typing operations, is not (yet) compatible with Wayland.

A quite good replacement of Autokey is Espanso. But there are also some limitations:

  • Espanso has big problems in LibreWriter (abbreviations are often expanded with errors). Similar problems there were also with Autokey in LibreWriter, but Autokey was able to provide some workarounds.
  • Espanso, unlike Autokey, can provide a very small range of hotkeys (such as ctrl + alt + d): Espanso can use only hotkeys with ctrl (not with alt or shift) and a few letters. I.g. “x01” means “ctrl + a”. You can find the whole range of possible combinations here.

However, as long as the main typing operations are in LibreWriter, or Kate, you can use that applications possibilities to expand text.

in LibreWriter there are at least two possibilities (to expand an abbreviation):

  • tools – > autocorrect
  • tools -> autotext

In Kate you can use snippets to create something similar to Autokey.

I.g. to create a snippet to wrap selected text with the tag <h1>, you can add this code as snippet code:

${rangeCommand("<h1>%%1</h1>", "title")}

Choose the title as you prefer (obviously without spaces), and a key combination, i.g. ctrl+1.

Don’t forget to add, in the javascript section (the tab scripts) this code

function rangeCommand(command, def) {
    if (view.selectedText().length > 0) {
        return command.replace("%%1", view.selectedText());
    } else {
        return command.replace("%%1", def);
    }
}

In this way, you will be able to add a title <h1> to your selected text.

KDE user dictionary

You can find it i.g. in your home folder, as hidden file with a name such as .hunspell_it_IT.

If you have many PC you can share it between your devices.

folding code in Kate

Today I noticed that if I write [b]BEGIN[/b] in a row that row is the beginning of a collapsable section, until a row with [b]END[/b].
F.e. /* — BEGIN common tags — / as beginnning and / — END common tags — */ as end.
And I can have nested collpsable sections, even in an html file ( , f. e.)

kate snippets shortcuts not working

Succede se si copia katerc in una home con altro nome. Allora le scorcatoie da tastiera (shortcuts) non funzionano (not working).
Soluzione: aprire katerc, in cui sono immagazzinate le shortcuts e mettere a posto la directory della nuova home/nuovonome.

quale distro di linux: tra pclos e ubuntu

Abbiamo provato le ultime versioni di PcLinuxOs (la 2013.04) e Ubuntu (Kubuntu, per l’esattezza) 12, e tra le due scegliamo ancora pclinuxos: molto più completa e personalizzabile, anche se richiede qualche conoscenza tecnica in più.
Il grosso problema è l’editor html: c’è da piangere, e appunto per questo siamo rimasti con pclos2009 fino a oggi, per avere ancora Quanta. Ma ormai non si può più attendere. Stiamo provando a vedere Kate, che prevede un interessante uso degli snippets… Ne riparleremo.

Intanto c’è una nota dolente, da KDE: la suite Kontact si è impoverita.
KMail anzitutto, pur avendo guadagnato da altri lati (in particolare può aggregare le email, per data,, o per sender o per thread) ha perso una funzione importantissima: il filtro in entrata alle email. Le può filtrare solo dopo averle scaricate dal server, mentre prima, vedendo gli headers uno poteva eliminarle direttamente sul server senza scaricarle. E’ chiaro che se ho una email urgente e dieci mails di spam da 40 mb l’una dovrò aspettare un po’ di tempo, perdere un po’ di tempo. Chissà che cosa è saltato in mente agli sviluppatori.
E poi che rottura dover digitare ogni volta che si apre kmail la password di wallet. Prima le passwords venivano immagazzinate e basta! Sarà anche per la sicurezza, va bene, però…
Ma anche kaddressbook ha perso funzionalità importanti: non aggrega più i contatti per gruppi o mailing list. Anche qui: che peccato! E che stupidità!

Per il resto KDE vede miglioramenti vari. Ne riparleremo.