Category: Linux

  • Citrix Receiver UK Keyboard Layout Issue on Linux and Chrome OS

    I have this weird issue where my employer’s remote virtual desktop is configured in English (UK), and it works well in Windows with UK keyboard layout. However, if I try to connect to the same instance from Linux (or Chrome OS), with the same hardware, it would appear as if I’m typing from a US keyboard. To make it more bizarre, if I configure a US keyboard in the remote Windows session and switch to it, it would appear as if I’m typing with the UK keyboard layout.

    Googling this yields a few frustrating customers, but probably the combination of using a UK keyboard in Linux and accessing a Windows VDA is not that common? I’m surprised that hacks need to be applied… The bizarre symptoms made me wonder what if I just tell the Citrix receiver (or workspace) application to simply use whatever the keyboard layout the remote VDA configured? Bingo! That solves the problem (for me at least). Changing the keyboard layout to (Server Default) in the [WFClient] configuration section did the trick for me in Linux. The configuration file should be in ~/.ICAClient/wfclient.ini

    However, I have yet to find where the configuration is stored for Chrome App (in Chrome OS), nor whether it’s even possible to update the default setting there. In the meantime, I found a workaround by editing the ICA file. Open it with a text editor, and add

    KeyboardLayout=(Server Default)

    to the [WFClient] section.

    Reference: https://support.citrix.com/article/CTX328177/keyboardlayoutserver-default-cannot-take-effect-on-citrix-workspace-app-for-linux

  • Home Assistant Core Setup on Banana Pi M5

    There is no support for BananaPi M5 from Home Assistant OS, which leaves me either the container or the core version. Originally I was going to use the container image, however, it needs too much disk space (7GB was not enough as it maxed out my onboard storage). I went for Home Assistant Core instead, and this post records my journey setting it up.

    1. Install uv (a Python environment manager)
    2. Install latest Python (3.13 at the time of writing), because Home Assistant Core has deprecated the support for older versions of Python
    3. Install Home Assistant Core (official documentation as a reference). I’m using uv to manage the virtual environment (note that I’ll enable ISAL for better performance).
    cd /srv/homeassistant/
    uv venv pyenv --python 3.13
    source pyenv/bin/activate
    uv pip install homeassistant==2024.12.3
    uv pip install isal  # ISAL for faster gzip and zlib
    1. Install and configure Cloudflare Zero Trust Tunnel (official documentation for remote tunnel). To expose my Home Assistant access to the public Internet, so that I can access it everywhere. Besides, some cloud-based services require that access because they use callbacks (the alternative is to pay for Nabu Casa which is a subscription-based service). Configure the access control in Cloudflare Zero Trust so that only verified emails from a restricted list have access (additional policies can be set for a new application that bypasses any control for cloud services callbacks)
      • Worth noting that the cloudflared add-on cannot be used because Home Assistant Core doesn’t support add-ons.
    2. Setup a new service in systemd for Home Assistant’s hass so that it starts on boot and restarts on failures. I created this file /etc/systemd/system/ha@homeassistant.service (systemctl enable and systemctl start afterwards):
    [Unit]
    Description=Home Assistant
    After=network-online.target
    After=network.target
    
    [Service]
    Type=simple
    User=homeassistant
    ExecStart=/srv/homeassistant/pyenv/bin/hass
    Restart=on-failure
    RestartSec=5s
    
    [Install]
    WantedBy=multi-user.target
    
  • Chrome OS Flex on Samsung Galaxy Book Pro 360 Dual Boot

    Happy Chinese New Year (Year of Dragon/Loong) to you all!

    A New Year’s surprise from Google. The latest version of Chrome OS Flex finally supports Samsung Galaxy Book Pro 360 to an extent that can be used as a daily driver.

    (more…)
  • Flatpak Wine 微信安装手记

    这两天花了一点点时间来优化我的KDE Plasma 5桌面,顺便想起来Wine这个软件而且发现居然已经上架Flathub了!微信很长一段时间都能用Wine在Linux上跑起来,结合网上的一些优化教程,这里总结写一个2024版本的手记。

    任何非Ubuntu发行版估计都已经自带支持flatpak而且配置好了flathub源了,flatpak简单来说就是Linux桌面软件的一种分发形式,相较于AppImage的最大区别就是有沙盒(sandbox)一定程度上保护宿主系统。

    如果你只是对微信感兴趣,是否通过flatpak安装wine并不重要,我只是喜欢sandboxed wine, wine这个软件每次安装都是东一块西一块弄得文件系统很乱。废话不多说,首先安装好Wine

    flatpak install flathub org.winehq.Wine
    

    如果不通过flatpak那就用你发行版的apt、dnf、pacman、zypper之类的安装好wine, 我安装的是flathub上23.08这个版本。flatpak发行的wine有一个麻烦的点就是,之后运行wine都要通过flatpak run org.winehq.Wine这个命令。而且文件系统结果和常规安装的wine会很不一样!所有和wine相关的东西基本都在$HOME/.var/app/org.winehq.Wine这个目录下。

    Wine的中文字体显示问题,我直接从Windows那边把微软雅黑的三个字体文件拷贝过来然后点击打开KDE自带的字体管理程序安装到Linux系统了。然后运行winecfg

    flatpak run org.winehq.Wine winecfg
    

    在Desktop Integration那里把所有的字体都替换成了微软雅黑。

    好了, 现在可以下载微信Windows版的安装包一路Next安装好。启动运行先检查是不是字体显示正常没有方块。

    最近的微信版本有一个WeChatAppEx.exe这个程序,在Linux下通过wine运行会占用大量CPU甚至导致桌面卡死……按照网上的建议,在winecfg里Libraries选项卡手动打入wechatappex.exe 然后Edit选择Disabled禁用掉。

    然后一直以来一个很烦人的点就是微信Windows版实现的窗口阴影在Linux下会导致一个置顶的模糊窗口,不仅看起来很烦而且会导致GUI交互问题。这里有一个KDE桌面环境专属福利,安装并启用这个KWin Script就可以了!

    Flatpak安装的Wine不能创建桌面启动项,这里我们可以自己捏一个wechat.desktop文件放在~/.local/share/applications下,供参考这是我的文件内容:

    [Desktop Entry]
    Exec=flatpak run org.winehq.Wine 'C:/Program Files (x86)/Tencent/WeChat/WeChat.exe'
    GenericName=WeChat PC Client
    Icon=wechat
    Name=WeChat
    NoDisplay=false
    Path=/home/simeon/.var/app/org.winehq.Wine/data/wine/drive_c/Program Files (x86)/Tencent/
    StartupNotify=true
    StartupWMClass=wechat.exe
    Terminal=false
    Type=Application
    X-KDE-SubstituteUID=false
    

    最后祝大家2024新年快乐!

    2024-02-26更新: 找到个更好用的flatpak:WineZGUI, 各位不妨试试

  • FydeOS上手体验

    距离上次写与Chrome OS/Chromium OS相关的帖子又有一段时间了。之前提到了怎么用Brunch项目来运行原味的Chrome OS,奈何Brunch的内核和我的新笔电(Samsung Galaxy Book Pro 360)一直不是很兼容,主要两个痛点:

    1. 声卡和麦克风识别时有时无
    2. 笔电折叠后不会自动切换到平板模式

    网上有人提到了FydeOS,于是这个周末抽了点时间来试试。剧透一下,感觉真不错!

    (more…)
  • Banana Pi M5 Pro Quick Review

    My old ODROID-U3 has been giving me quite some headaches. Its old USB 2.0 ports and 100Mbps Ethernet port are also very limiting in 2023. Its power supply is not the best (not an uncommon issue with HardKernel’s products, certainly not uncommon among the older generation of single board computers). A hardware upgrade is therefore necessary.

    I don’t really use it for anything else other than a humble home server to stream videos, music, and sometimes photos. Generally used as a private file share system at home. I already bought an 1 TB USB 3.0 HDD, so I definitely need a device that supports USB 3.0 at least. To not have a limiting network I/O, it should also have 1Gbps Ethernet port.

    Why not buying a popular Raspberry Pi 4? Well, I tried, but it’s out of stock everywhere. That’s why I turned to its alternatives, initially I was going to buy another HardKernel’s ODROID product, but its pricing in Europe is just way too high than the price on its website. Unfortunately, (not sure if this has anything to do with Brexit), there is a minimum order requirement to ship to the UK. I’m building a cluster or something, so looking again…

    Ta-da! I found Banana Pi, the name is a bit.. knock-off, and the manufacturer is in China, I’ll let you connect the dots. Banana Pi M5 is not the newest model, but it’s comparable to Raspberry Pi 4 and ticks all of my boxes. Long story short, I bought it from Ali-Express where it’s much cheaper than Amazon or other local retailers here. They were also running some sales on bundles, so I ended up buying it with a metal case, yet paying less.

    On paper, it provides even better performance than Raspberry Pi 4! More importantly, it’s readily available! One thing I did pay extra attention to is the availability of upstream Linux images, having suffered quite a bit there with HardKernel’s products. Thankfully, Banana Pi has Armbian support (rated platinum for Banana Pi M5, whatever platinum means). To save even few more pennies, it comes with an onboard 16GB eMMC storage!

    It’s been faithfully serving its purpose on the shelf next to the router for a couple of weeks now. Reliable little machine that’s fast and responsive! If you’re thinking of buying a single-board computer like Raspberry Pi, but couldn’t find available stocks, Banana Pi might fit in.

  • Chrome OS, Linux Containers and Application Launchers

    So I installed the great brunch framework on my laptop after a hiatus of a couple of months. I still dislike the fact that the Linux containers are running under a VM on Chrome OS. Sure it is more secure as the containers won’t be able to access the host hardware directly etc. It is also slightly inefficient. So I tried both chromebrew and brioche. Note that brioche only supports brunch (thus half of this post won’t apply to official Chrome OS builds).

    (more…)
  • A New Termux Mirror

    TL; DR. https://termux.librehat.com is a new Termux packages mirror! Maintained by me, synchronised every six hours, located in the United Kingdom, hosted by Oracle Cloud.

    In the full article below, I’ll write up how to set up a Termux mirror (or in general, a Debian packages repository mirror).

    (more…)
  • Building Qt for Termux Android

    This is by all means, not the first blog post about Termux. It serves as a journal for myself, as well for anyone who’s interested in cross building Qt or Qt-related projects for Termux (which is a native Linux environment for Android) from their x86_64 machines.

    We already have @xeffyr who has done a great amount of work on building Qt for Termux. The work I’ve done recently would be 10 times harder, if not for what’s achieved by them already.

    If you’re new to cross building for Termux, I recommend you to start with Developer Wiki.

    (more…)
  • Fedora Linux with MATE Desktop on Android

    I know some of you geeks have already done something like that, running a GNU/Linux distribution on top of an Android device. It’s an interesting time, with projects like proot we don’t need root privilege on our Android devices to run a containerized Linux environment. Here in this post, I’ve written down the steps that I’ve taken to have a usable desktop environment up running on my Galaxy Tab S5e (this blog post has been written up purely within such environment).

    (more…)