Saturday, December 17, 2022

High dpi displays better solution for laptops for Linux

 Instead of modifying each font size, it turned that adjusting only font scaling is enough.

In KDE it's "Fonts - System settings" -> "Force font DPI: 144" for 13 inch fullhd screen. Although in this way some apps may scale icons as well, e.g. LibreOffice. But still it's better than display scaling setting, which brakes some apps like Steam and games.

Saturday, December 10, 2022

Raku programming language

Source "star" bundle takes forever to compile and ends with errors. Better to install only rakudo + zef bundle from here:

 https://rakudo.org/downloads

Slower than Python, REPL consumes 130MB ram.

Friday, November 11, 2022

High dpi displays, laptops and scaling in Linux

As of November 2022 there's no proper/flawless support for "fractional" (125%, 150% etc) scaling of the GUI on the Linux desktop. Yes there is good support in KDE, but still some apps (e.g. darktable, steam) either ignore or wrongly position control elements on the screen. And there's no proper support for multiple displays with different dpi (as far as I know it's a limitation of X11).

If you have a laptop with small physical screen but higher pixel count (e.g. 13" 1920x1200), then i found the only working solution -- adjust fonts size and use some settings inside the applications to increase readability, e.g. set default zoom size to 150% in Firefox, set bigger fonts in the terminal emulator, set bigger fonts in the VSCode preferences etc, set 150% scaling in the Telegram app preferences... But this will not allow for different scaling for the external monitor.

If you plan to buy a laptop with small physical screen, look for either a 1280x800 screen or an integer multiplier of it, e.g. 2560x1600, it's what the Apple laptops have -- they do not support fractional scaling, but the display resolution is twice as large as a previously common one. By the way 16" macs with 4K displays have higher dpi than previous 2560x1600, so the texts are uncomfortably smaller and there's no solution to it at all.

If you plan to use a multiple display configuration, make sure that displays have the same or at least close DPI value.

Wednesday, October 19, 2022

android file transfer on linux (mtp)

mtp through kde is not working properly, so use:

 sudo apt-get install android-file-transfer

Sunday, September 18, 2022

Mercurial (hg), git, subversion (svn) repository size comparison

Compared git, mercurial, and subversion for local-only repository to use for local history of notes, and other personal non-shared files, e.g. financial log, for which the edit history is useful. 

 Mercurial turned out to be the most space efficient, especially for binary files. For subversion there's also overhead for local working copy tracking, which is a copy, so your working copy occupies 2x space + repository space. 

Empty repository sizes (with du command): 

116K .git/ 9 directories, 17 files 

28K .hg 3 directories, 3 files

empty svn repo du: 160K, 10 directories, 28 files 

140K .svn/ 

After adding a gimp .xcf 45M file, each new commit increases git's and svn's repositories to almost the same size, as if each commit contains an individual copy, while the hg repo increases slightly as if only a binary diff is stored. After two edits the repository sizes are: 

git: 91M

hg: 39M

svn: 129M 

So Mercurial is a clear winner here, and suitable for binary data without LFS-like hacks.

Saturday, August 27, 2022

Steam on Linux xbox controller troubleshooting

If the gamepad is not detected or controller buttons are not working as expected in the game  try to use the following settings.

Right click on game name in the list, choose CONTROLLER tab, click Controller General Settings, mark "Xbox configuration support", click "Back". In the OVERRIDE FOR <game name> select "Use default settings". In the list below: Xbox Controller Enabled, default setting.

In the GENERAL tab make sure "Enable the Steam Overlay while in-game" is enabled (click to trigger it off/on just to make sure it works).

Now games such as Blasphemous, Broforce will work with the gamepad as expected.

Saturday, June 25, 2022

neovim setup for development, beancount

https://neovim.io/ -- use tar with linux binaries or compile from source (not checked).

Install packer: https://github.com/wbthomason/packer.nvim

Setup lspconfig: https://github.com/neovim/nvim-lspconfig

run :PackerSync on changes to plugins.lua

setup https://github.com/matze/beancount-language-server

pip install neovim

Use CTRL-X-CTRL-O in insert mode.

Wednesday, May 11, 2022

flatpak: cannot add flathub repo on kubuntu 20.04 LTS: TLS support is not available

error: Can't load uri https://flathub.org/repo/flathub.flatpakrepo: TLS support is not available
 

Fix: need to set env. var:

 GIO_MODULE_DIR=/usr/lib/x86_64-linux-gnu/gio/modules/ flatpak -v remote-add --if-not-exists flathub
https://flathub.org/repo/flathub.flatpakrepo

Sunday, May 8, 2022

XMP metadata manipulation

Add a new tag into existing subject tags in the .xmp sidecar:

exiv2 -M 'set Xmp.digiKam.TagsList my-new-tag'  mo xxx.JPG.xmp

exiv2 -M 'set Xmp.dc.subject my-new-tag'  mo xxx.JPG.xmp

 

Print specific tag:

exiv2 -g TagsList pr xxx.JPG.xmp
 

Sunday, April 17, 2022

dlang vs rust comparison (based on alimg)

Comparing dmd, ldc, rust based on the same algorithm implementation:

https://github.com/exhu/alimg/tree/master/dmd

https://github.com/exhu/alimg/tree/master/bufdither-rust


rust version is the fastest (2.5 s) vs dmd's 5 secs, ldc's 2.9 s.

rust version also consumes less memory:

Maximum resident set size (kbytes): 3716

Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.50
 

DMD: 

Maximum resident set size (kbytes): 5380

Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.28

LDC: 

Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.91

Maximum resident set size (kbytes): 8044

 

The D programming language version turned out to be easy and quick to implement as it was very close to Java/C++.

The Rust version took very long time to implement, as it required considerably more time to learn Rust's basics.

Monday, April 11, 2022

Ventoy: multiple ISO images from usb to boot

Install Ventroy on a usb, normally copy ISO files to the drive, boot.

https://www.ventoy.net/en/index.html

Sunday, February 20, 2022

ubuntu snap apps lacking proper fonts

 https://askubuntu.com/questions/1224125/font-characters-displayed-as-squares-in-ubuntu-18-04

rm -rf ~/.cache/fontconfig 
sudo fc-cache -r -v 
 
Delete every found fontconfig folder from the snap cache, e.g. 
find ~/snap/chromium/ -name 'fontconfig'
rm -rf ~/snap/chromium/common/.cache/fontconfig/