25. June 2021

How to disable automatic screen dimming on Windows Lenovo T14 with Intel UHD Graphics

Windows 10 on Lenovo T14 with Intel UHD Graphics has one very annoying behavior. The system automatically dims dark screens like a terminal window which becomes barely readable and the system brightens white screens like a web browser.

Here’s how you can disable this automatic dimming.

Press Windows key and type: Intel Graphics Command Center

Click icon with 4 squares a.k.a. System. Select Power tab, scroll down to Power Settings, uncheck Display Power Savings.

One other option is to dial down Power Efficiency to value like 1.

Option Enhanced Power Saving – Dims bright images for power saving – does not have effect.

Facebook Comments

25. May 2021

Windows Terminal – How to add a custom shell to dropdown menu with JSON Fragment Extension

Windows Terminal allows you to use and manage shells for CMD, PowerShell or WSL2 in one window.

Windows Terminal also allows registering custom shells to the application. One option is to edit the profile manually via Settings.

It’s also possible to use the so-called JSON Fragment Extension which lets you drop a JSON file into a directory and Windows Terminal will load information from the file. The major advantage is that you can move the file between computers without worrying about damaging HJSON format of the original configuration file.

The instructions on the Microsoft site are not very clear on how to add the JSON and I had to use debugger to determine the proper location.

First of all create a directory for your application (e.g. IPython) with following PowerShell command:

mkdir "$env:LocalAppData\Microsoft\Windows Terminal\Fragments\IPython\"

Open a file with .json file extension and specify there following content (e.g. fragment.json with full path “$env:LocalAppData\Microsoft\Windows Terminal\Fragments\IPython\fragment.json”):

{"profiles":
  [
    {
      "name":"IPython",
      "startingDirectory":"C:/",
      "commandline":"ipython"
    }
   ]
}

Save the file, close Windows Terminal, open new Windows Terminal, and IPython will be visible in the list of available terminals.

Select the IPython and you’ll get a new tab with the interpreter.

Facebook Comments

20. May 2021

Xcode: How to quickly filter only errors from the build

The best software practice tells you that you should not have build warnings in the projects. It’s easier to spot a potential problem.

Sometimes it’s necessary to import larger portion of code which generates many warnings and it’s very hard to find the error which blocks compilation of iOS or macOS application in Xcode.

The quick way to filter out warnings and see only errors in Xcode is to click X icon at the bottom of Issue Navigator with the title “Show only errors”:

Facebook Comments

13. May 2021

Windows on Lenovo T14 is sluggish after resuming from sleep? Simple solution.

One thing that you might notice on Lenovo T14 with Windows is that sometimes the whole system is sluggish, UI is not responsive. One solution is to reboot the computer and then it works without problem.
The problem occurs more often when you turn on “Night light” feature which changes the color of the whole UI.
The issue seems to be caused by some power management. To workaround, the issue clicks the battery icon and dial-up Power mode to Best Performance.

The Best Performance setting does not apply just to situations when the computer is on battery, it also changes behavior when the computer is connected to a power supply. Best Performance will also enable fans to operate at a higher speed so the computer will be noisier, but it will give you an extra nuget of CPU power.

Facebook Comments

7. May 2021

How to speed up Linux on WSL2? Common mistake when upgrading from WSL1

According to Microsoft WSL2 is way faster than WSL1 for running Linux images. So, why even after upgrade to WSL2 is Linux running slow and with the same IO inefficiency like it was on WSL1?

The reason is simple. Even though the WSL2 was added to the operating system, the old images are running on WSL1. You can verify it by command:

wsl -l -v

Output:

  NAME                   STATE           VERSION
* openSUSE-Leap-15.2     Stopped         1
  Ubuntu                 Stopped         1
  docker-desktop-data    Stopped         2

As you can see both Ubuntu and openSUSE has set version to 1 which means that these images runs on WSL1. It’s necessary to explicitly change the version by following commands:

wsl --shutdown
wsl --set-version "Ubuntu" 2
wsl --set-version "openSUSE-Leap-15.2" 2 

The conversion will take some time. Output:

Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.

Now you can verify the version of WSL for the image:

wsl -l -v
  NAME                   STATE           VERSION
* openSUSE-Leap-15.2     Stopped         2
  Ubuntu                 Stopped         2
  docker-desktop-data    Stopped         2

Simply start the shell of the distribution and you’ll experience better performance.

It’s also possible to set version for future images by command:

wsl --set-default-version 2
Facebook Comments