May 3rd, 2020


Tech tips

These are several tech tips I accumulated.

Tip: Releasing / Uncapturing the keyboard input focus when using a KVM / virt-manager VM

In order to release the keyboard input focus when using KVM (Kernel-based Virtual Machine) and virt-manager one can press "left control" and "left alt" together (not "left shift"). This was described in this post from StackExchange, where it shows how to set it to a different key combination.

This was another post emulating Lisha Sterling's old "know where the ledge is" blog (which seems to have disappeared).

Tip: Vim: Setting a different Connection

If you are using Vim or neovim and wish to set a different connection (e.g: for copy+paste), you can use :let $DISPLAY = 'myremotehost.tld:0.0'. Other environment variables can be changed or set in a similar way using the dollar-sign notation.

Tip: GFile type in python3 / gi / Gio / Gtk+

The GFile type in python can be retrieved using the following idiom:

import gi
from gi.repository import Gio

FILE_TYPE = Gio.File.__gtype__


Tip: Search for file paths by pattern using DNF (on Fedora / CentOS / etc)

Using DNF one can search for file paths which are contained in uninstalled packages (similar to apt-file on Debian / Ubuntu / etc. or urpmf on Mageia) using dnf whatprovides '/usr/bin/start*'.


Copyright by Shlomi Fish, 2020.

You can reuse this entry under the Creative Commons Attribution 4.0 Unported licence, or at your option any later version of it. See the instructions on how to comply with it.

Whatever code given here is provided under the MIT / Expat licence.