LightDM background image


Recently my old laptop, due to some unknown configuration, it shows a background image in the LightDM login. It is annoying, and it is user specific. Meaning, if I choose another user, the background image will be changed to black background.

Searched for the solution on Internet, most of links are about gsettings, or edit the image in /etc/lightdm/lightdm.conf. But none of the related to my issue.

Finally, I found the solution. The problem is not LightDM itself, but related to AccountsService.

To solve the issue, edit the /var/lib/AccountsService/users/[username], there is a line

[org.freedesktop.DisplayManager.AccountsService]
BackgroundFile='/path/to/custom/image.jpg'

That’s the culprit. Remove or comment out the BackgroundFile, then the problem solved.

Advertisements

Patch Wine and supports both 64-bit and 32-bit


We can build Wine that supports both 64-bit and 32-bit.

The below shows the example that involves patch of a specific Wine version. Sometimes official or latest Wine just doesn’t work. And the patches can be found in the bug report attachment.

Download a patch from Wine bug report, and download the source code. Extract the source

tar xJf wine-4.2.tar.xz
patch -u -p1 < ../swshader_ivb.patch

To build Wine that can work on both 64-bit and 32-bit, we can follow this.

The following is the script to build wine.

#!/bin/bash

srcdir="$(pwd)"
mkdir build-64 build-32

cd "$srcdir/build-64"
../configure --prefix=$HOME/mywines/wine-4.2-sw-blend \
  --libdir=$HOME/mywines/wine-4.2-sw-blend/lib \
  --enable-win64 --with-x
make -j4
cd "$srcdir/build-32"
PKG_CONFIG_PATH=/usr/lib32/pkgconfig ../configure \
  --prefix=$HOME/mywines/wine-4.2-sw-blend \
  --libdir=$HOME/mywines/wine-4.2-sw-blend/lib32 \
  --with-wine64=$HOME/mywines/wines/wine-4.2/build-64 \
  --with-x
make -j4

cd "$srcdir/build-64"
make install
cd "$srcdir/build-32"
make install

Now, you can use the this Wine to run specific game.

A Wine wrapper script can be found here

NVIDIA with Nouveau and Wine


I updated my old laptop HP Pavilion dv3 (2238tx) recently, which was bought in year 2010, installed with Arch Linux.

Because of Linux kernel version, the NVIDIA driver is not officially supported by Arch Linux (detail).

There are two options to resolve this: install (i) Nouveau or (ii) NVIDIA driver from AUR. The former is open source, the latter is closed source from NVIDIA official site. Furthermore, using the latter theoretically allows the usage of CUDA, which is important if I am using it to do some neural networks training.

Now, since this old laptop, 说好不好,说坏不坏, I tried to install games. Unluckily, the Windows 7 (it is dual boot) is 32-bit, which I don’t plan to re-install new version of Windows with 64-bit. So, I am trying to figure out Linux Wine whether it can work or not.

Firstly, I tried PlayOnLinux to install 64-bit Wine. But I found that 64-bit Wine in PlayOnLinux can run only 64-bit programs. Then after some study, I found that Arch Linux official Wine package supports both 64-bit and 32-bit.

So, I wrote a Bash script to do something like PlayOnLinux which can be found here, so that I can isolate the WINEPREFIX for different programs, and allows to use different versions of compiled Wine.

After some trial and errors, I make an almost 9 years old laptop to run a 64-bit game released in 2018, though the performance is not very good.

The followings are the setup/configuration:

  • Nvidia G98M (GeForce G 105M)
  • Nouveau and related packages like “mesa”
  • Wine 4.13
  • VirtualGL (Not sure whether it is required)
  • Winetricks and installed “d3dx9” (Not sure whether this is required)

Godot and hobby project


Game engine

Previously I found a game engine LOVE (Lua language). Then I planned to learn about it. But then I read about Godot, which uses GDScript with similar syntax like Python. So, I choose Godot over LOVE because I have better experience in Python.

I planned to work on edutainment project since long time ago. Since I have extra time recently, so I invested little time on my hobby project. Using Godot, I revived my old project.

Godot provides a fantastic IDE. It allows to edit the UI, adjust any UI components easily. It provides almost everything I wanted: scene graph, everything is node, audio, video, texture, input, etc. The below is the screencasting of the auto play (with manual input) of the Tetris game.

(The new project is not open source.)

 

I am outdated

I like to play games (I believe everyone likes to play games). But most modern games are beyond my capability. There are several reasons:

  1. I am primarily using Linux.
  2. Not enough time to play game.
  3. I don’t have gaming computer.
  4. Though I like play story focused games like JRPG, I don’t like to invest time to collect items, level-up, etc, so I get used to use cheat engine (that’s why I created [memory editor](https://github.com/allencch/med)).
  5. Mobile games are mostly money-draining AND time-draining.

Because of the above reasons, I feel that it would be better for me to create my own game that fits my taste. Gaming of the 私, by the 私, for the 私.

The games that I love most are Dai Koukai Jidai 2 (大航海时代2) and Taikou Risshiden 5 (太阁立志传5). The reasons I love these two games:

  1. Not resource hungry like modern 3D games.
  2. Good story with the realistic history and background.
  3. Combination of JRPG, simulation (business), sandbox.
  4. Player can choose a protagonist from several characters. Each has its own story line, and they are in the same world.
  5. Realistic game play. E.g., earn interest from bank (Koukai2), monthly meeting and send gift to make friends (Taikou5), etc

I can’t find any other game that can fulfil the above conditions.

 

Vivo Y17 and Wunderlist


Recently changed to new phone Vivo Y17. Installed all the apps needed. Then I discovered an issue with Wunderlist.

Wunderlist widget keep showing “loading”, and I cannot change the list to be viewed.

The reminder doesn’t show notification in time.

Then I tried to migrate Wunderlist to Microsoft To-Do, and it has same issue as well.

Searching the solution and I finally get this page.

To summarise the solution, go to Settings > Permission Management > Autostart, then enable Wunderlist or Microsoft To-Do.

Chinese (and CJK) fonts


I am using Arch Linux, and recently I found that my fonts are little different after upgrade.

In DBeaver, the monospace font shows this:

This causes the monospace doesn’t follow the same width. And I found that, the default “Monospace” doesn’t use DejaVu Sans Mono anymore after the recent upgrade.

After looking some solutions, I tried edit ~/.conf/fontconfig/fonts.conf according to this this one.

<match target="pattern">
  <test qual="any" name="family"><string>monospace</string></test>
  <edit name="family" mode="assign" binding="same"><string>DejaVu Sans Mono</string></edit>
</match>

The above solution solves the monospace in most applications like Mousepad and DBeaver.

But then, I found CJK issue in Mousepad when using monospace font, like this,

The Simplified Chinese font and Traditional Chinese font are different.

If open with “charmap” and choose Monospace font, we can check what are the fonts being rendered, like this

I right-clicked the character, found that two fonts are being used in Monospace for these Chinese characters: Meiryo and KaiTi. Meiryo was installed with “ttf-vista-fonts” package, and KaiTi I installed directly to ~/.local/share/fonts.

After some study, I found that the above fontconfig is not good enough. Lastly, I changed my setting to

<alias>
  <family>sans</family>
  <prefer>
    <family>DejaVu Sans</family>
    <family>WenQuanYi Zen Hei</family>
  </prefer>
</alias>
<alias>
  <family>monospace</family>
  <prefer>
    <family>DejaVu Sans Mono</family>
    <family>WenQuanYi Zen Hei</family>
  </prefer>
</alias>

After saving the changes, the application must be restarted in order to see the effect.

And this finally solved the font issues.

Script to notify myself


Sharing a simple script I recently used. Because recent development, I need to run a build command which needs about 2-3 minutes. I run it in the background so that I can continue my other work.

But switching the window in order to check whether the build is completed, it is frustrating. To make it easy, I wrote the following script,

#!/bin/bash

notify-send -t 1500 -i applications-utilities "$@"
aplay /usr/share/orage/sounds/Knock.wav &> /dev/null

notify-send comes from the libnotify package. By running this command, you will see a popup notification on your desktop.

/usr/share/orage/sounds/Knock.wav comes from orage package. I just simply searched for a wave file that sounds good to me.

So, once I run the command such as,

build_my_project && /path/to/script/notify_me.sh

Once the project is built, my desktop will notify me with popup notification and play a sound.