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.

Verify a KDE-Neon iso with a sig file

You have first of all to install the public-key of KDE-Neon:

  • downloading it (it is a text file such as armored-keys.asc)
  • and installing it gpg –import [your-downloaded-public-key-file]

Then you have to go into the folder where are both iso and sig files and give this command

gpg --verify [your-iso-file-name].iso.sig

You should see something like:

gpg: assuming signed data in 'neon-user-20200813-1119.iso'
gpg: Signature made �� 16:40:21 PKT �� 13 �������� 2020
gpg:                using RSA key 348C8651206633FD983A8FC4DEACEA00075E1D76
gpg: Good signature from "KDE neon ISO Signing Key <neon@kde.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 348C 8651 2066 33FD 983A  8FC4 DEAC EA00 075E 1D76

Here more.

How to switch a php variable according to the server address

I managed to switch my websites links (containing a php variable: $root) according to the server address. If they are in localhost the variable begins with: http://localhost , if they are on remote the variable is the remote address.

The php code is quite simple:

if ($_SERVER['SERVER_NAME'] == "localhost")
{$root_yourwebsiteA = "http://localhost/your path/yourwebsiteA/";
 $root_yourwebsiteB = "http://localhost/your path/yourwebsiteB/";
 $root_yourwebsiteC = "http://localhost/your path/yourwebsiteC/";
}
else 
{$root_yourwebsiteA = "http://remote path/yourwebsiteA/";
 $root_yourwebsiteB = "http://remote path/yourwebsiteB/";
 $root_yourwebsiteC = "http://remote path/yourwebsiteC/";
}

embed a div from another page

The way with less code is a jquery script. Like the following:

<p id="new"></p>

<script>
$( "#new" ).load( "/your-path/your-file.php #your-div" );
</script>

The only security limit is that you cannot use an absolute path, beginning with https:// .

But you can use a php variable to set your javascript value so that it may be available from any folder (sub-folder) of your website. See here how to pass a php variable to javascript.

permission denied

If you get rhis error message even you have all the rights, probably you are trying to run the command on a mounted partition that had the “noexec” flag on.
So change partition, .f.e. try your /home.

avidemux too slow

It’s better use (one of) the following codecs for encoding

  • x264
  • libavcodec MPEG-1/MPEG-2
  • libavcodec MPEG-4
  • Xvid 

so Avidemux will be able to optizmize the CPU usage and will be much faster. And the CPU temperature will be lower.
Cfr.here.

share (embedding) text between odt documents (librewriter)

Impossible use cross-reference or dde-link for more than a paragraph.
So the only way (to share more than a paragraph) are sections:

  1. define the area you want share in the file A as a bookmark;
  2. in the file B insert -> section -> as link – choose the file and the bookmark
  3. the text boormarked in A will be visible in B

n.b.
It is not necessary a master document.