## Maildroid does not save sent email to IMAP ‘Sent’ folder by default

This behavior is so frustrating. We don’t live in a time where IMAP storage space is at a premium anymore! Fairmail saves a copy of sent mail in the IMAP’s ‘Sent’ folder by default.

I did some research and it seems like MailDroid insists on ‘saving the sent mail in “Sent from device” folder (I tried disabling it thinking Maildroid will be smart enough to save it in the IMAP’s sent folder, but no, it doesn’t).

Fairmail’s Settings->Send->Message->[Last Item] On Replying to a message in user folder, save the reply in the same folder was disabled (should be, or else it’d be messy), but there’s a subtext that says “The email server could still add the message to the sent message folder”, which points me to think saving a copy to the Sent folder is an IMAP server managed behavior, so it doesn’t rely on email clients specifically telling it where (which folder) to save the sent email.

I was about to give up Maildroid and stick to Fairmail, and did a little research on “imap put sent mail in sent folder” and viola, Maildroid is the first one that came up. Seems like I wasn’t the only one perplexed by Maildroid’s weird design choices and it seems like most other email apps do not have this awkward behavior.

I did as what the dev for maildroid said and it turns out all of the email accounts in use says “Not specified”. When I clicked on one of the accounts, the root folder /Inbox shows up. I had to expand it with the ‘>‘ so the (IMAP) sub-folders show up.

This GUI was designed horribly and it’s clearly an afterthought. The reason I’m saying that instead of just assigning the IMAP sent folder right away after I tapped on it, the UI changes the textbook at the bottom of the screen (WTF) to what I’ve selected (despite there were no multiple choices) and click the DONE next to it. It’s so unintuitive in many levels.

30 total views

## How to get a CAP (cantonese IME /w swearwords) and coexist with mozc (Japanese IME) in Linux

I’ve been using CPIME for ages and I’m comfortable with Sidney Lau’s phonetic scheme. Jyutping is unnatural to Hongkongers because we do not consider ‘j’ a ‘y’ sound like Germans do.

However, since Windows 10, there aren’t much choices when it comes Cantonese IME that defaults to Sidney Lau’s and yet it accommodates common swearwords (including the most common ones that were technically incorrect) well. The only reasonable choice is Andrew Choi’s CAP, which I will write about how to get it working for Windows 10 on another blog post.

There aren’t much choices for Linux either. There’s RIME, but it’s super hard to install and Sidney Lau’s phonetic scheme is buried deep down that can only be changed with shortcut keys during the IME composition mode. The deal breaker is t.he lack of swearword support. Being able to type 林鄭我𨳒你老母 is essential for every self-respecting Cantonese speaker. 「屌」你老母 just won’t cut it. Lol.

CAP takes a quite bit of wrestling to get it to install in Windows (in another post) and quite a bit of wrestling to get it to function in Linux. Once you get it working, it’s a very powerful Cantonese IME that allows superfast typing unless you plan to play with words (玩食字). I just can’t praise the IME design enough and I was willing to deal with the quirks which curbs its wide adoption.

Andrew Choi made a few release at his blog page in 2012 (ibus), 2015 (ibus), 2018 (fcitx), 2019 (fcitx4) and 2021 (fcitx4). For the linux version, this blog post is only concerned with the 2021 version (latest at the time of writing).

For Linux CAP, installing the debian package is the easiest part:

sudo dpkg -i fcitx-cap_1.0.0_amd64.deb

The thorns are

1. get the CAP show up on the list of valid input methods
2. fend of fcitx5 which is trying to kill CAP
3. deal with IME settings state corruption (especially when working with other IME)
4. live with being unable to select characters from subsequent pages of selection candidates

## CAP is not immediately available as an IME out of the box (even after installing the .deb package)

.

You will need to add Chinese to “Install / Remove Language” under “Language Support” to get anything to show up there!

## Fend off fcitx5

fcitx5 was recently released and Ubuntu is aggressively trying to push it onto every user. However, its very existence kills the currently available CAP which is written for fcitx4 as of the 2021 release. This means you will have to give up fcitx5 if you want to use CAP!

Fcitx5 is considered as a replacement for fcitx4, so whenever Ubuntu sees that you have fcitx installed (which is likely fcitx4), it’ll tempt you into installing fcitx5. DO NOT ACCEPT THE INVITATION! However, fcitx5 do not coexist with fcitx4. Your fcitx4 will be removed the moment you installed fcitx4. To go back to fcitx4, you have first to remove fcitx5 completely then re-install fcitx.

What makes things more complicated is that Ubuntu’s gnome Language Support GUI keeps prompting you to install fcitx5 whenever you start it or do something with it such as installing new languages (which is required as the first non-obvious step). It’ll typically try to deceive you into installing fcitx5 with a dialog box like this:

but if you open up the details it’s fcitx5 which will cockblock CAP

However, when you try to perform the first step, if you already have fcitx (fcitx4) installed, adding new languages (required to get CAP) to work will come bundled with upgrades to fcitx5! It’d be super frustrating. So you can choose between the two paths

## 1) Concede to fcitx5 and downgrade to fcitx4

• install the languages first (with fcitx5 IMEs),
• remove fcitx5
• install fcitx4

## 2) Prevent fcitx5 in the first place

• remove fcitx4,
• install the languages (no fcitx IMEs)
• install fcitx4

## Remove fcitx4

sudo apt purge fcitx

## Remove fcitx5

sudo apt purge fcitx5*

## Install languages

If you already have fcitx installed (path #1), you’ll have to click yes and live with fcitx4 being upgraded to fcitx5 which you’ll have to destroy it later and reinstall fcitx4.

If you already removed fcitx, Language Support will only install IME for other systems such as ibus associated with installed languages

## Install fcitx4 AND activate it

sudo apt install fcitx

Remember to select the installed Fcitx 4 as your IME system (not ibus, etc, or none):

## Learn the new shortcut keys that are different from Windows

One default out of the box that’s hard to guess is moving from page to page. It used to be PageUp/PageDown but CAP follows fcitx’s global configuration moving between pages, which is the lower case of +/- keys which is basically =/- because + is upper case while it was intended to be lower case. I know, this is confusing!

IME switching follows the OLD windows shortcut keys (like Windows 98 and XP days), which

• Ctrl+Space means turning IME on/off (global sense),
• Ctrl+Shift changes IME languages (newer Windows use Alt+Shift by default)
• Shift to temporarily disable/enable the IME (i.e. English mode) but stay within the language state

## More customizations to get it closer to Windows IME behavior

CAP follows the global config settings in fcitx, unlike mozc (Japanese IME) which sometimes play by its own rules which behaves similar to its Windows’ counterpart.

If you are used to CPIME’s vertical lists, you can change it in ‘Appearance’ tab.

## CAP candidate selection quirks when used with mozc (bug?)

For some reason, when both CAP and mozc are freshly installed, the first time you use the candidate list in mozc by selecting space/tab, the candidate list will disappear!

I installed and uninstalled fcitx, mozc and CAP and realized narrowed the bug to this reproducible path. My suspicion is that there’s a setting regarding the candidate selection shortcut (usually by ‘1’~’9’+’0′) parameter state that’s not exposed in fcitx-configuration that was being changed my mozc. And this guess puts me closer as I was able to play around with mozc’s config and found a candidate selection shortcut option

Note that mozc only has a max shortcut of 9 items (instead of 10, that means the ‘0’ key is not available as shortcut key) despite fcitx-configuration’s Global Config has a different idea (which CAP can use the 10th key, aka ‘0’ as candidate selection shortcut)

I noticed that after switching ‘1’-‘9’ to ‘a’-‘l’ (or no shortcut) mode, activate it in mozc by using space key to expand selection (this is necessary or the change won’t happen), I get the ‘1’-‘9’+’0’ candidate selection shortcut when I go back to CAP. I also noticed if I messed with the maximum number of suggestions in mozc a few times, I can get into an undefined state in CAP where it shows the candidate selection shortcut for the first few but not the rest, such as this:

I also noticed CAP has one consistent bug that the candidate selection (not just the keys) ONLY WORKS FOR THE FIRST PAGE! I tried to use the candidate selection shortcuts or click on the character with mouse for subsequent pages, it only commit the current word choice disregarding the selection!

51 total views

## Taking screenshots in Ubuntu with Flameshot

I’m spoiled by Greeshot in Windows and I find the gnome-screenshot that came with Cinnamon lacking.

With Greenshot, Print Screen key by default selects an area (which should be the most versatile and productive mode which should be prioritized with least complicated keys) and prompts you on whether you want to copy to clipboard or save a file.

Gnome-screenshot went with the most traditional behavior where Print Screen keys captures the entire screen AND it saves to a default file in ~/Pictures folder with timestamped file names, which I don’t want (I prefer copying to the clipboard).

So natively in gnome, Ctrl is the modifier for copying to clipboard. Shift is the modifier for selecting a section of the screen. So the most common operation I want to do became a bit of finger gymnastics Ctrl+Shift+Print and there are no immediate access to image editor like Greenshot (don’t even bother with GIMP, it’s slow to load and convoluted).

I discovered a much neater app called Flameshot. It has a much quicker design that you can select a section of a screen and do the most common screenshot edits on the fly and copy to the clipboard or save to files, even faster than Greenshot, which opens the captured image into a separate editor and you have to click file->copy-to-clipboard after edits!

Turns out that Flameshot does not use the native gnome’s print screen categories,

so establishing the shortcut has to be done as just a simple shortcut for running the command:

/usr/bin/flameshot gui

and I chose to use Win/Super+Print for Flameshot

Again, the command is /usr/bin/flameshot gui (or where flameshot is located if it’s not under /usr/bin)

48 total views

## Ubuntu cannot ping Windows hostnames out of the box (resolving NETBIOS announcements)

Out of the box, Ubuntu cannot resolve hostnames announced by Windows out of the box.

The internet had many solutions from ditching NETBIOS (winbind, wins) but it involves replacing systemd-resolved with the old NetworkManager (systemd-resolved was an extra level of indirection to break VPN ties), which I illustrated in this now deprecated blog post.

Having router assign host names you specify often included a local domain name (must not choose one that conflicts with the internet) such as local or lan. So the computers are accessed in the format of myPC.local or myPC.lan depending on the local domain name you picked. However, it doesn’t take advantage of the hostname announced by Windows computers.

I decided to give the NETBIOS service a second research today and found the missing link to the common solution of installing winbind and adding wins entry to host search order in /etc/nsswitch.conf (you can put it at the end or earlier if you want). I put it at the end as I wanted it to be the last resort

hosts:          files {a bunch of things depending on your system} wins

Of course having a wins entry in the hosts search order involves installing winbind make sure the winbind service is running

sudo apt install winbind

The missing piece is editing /etc/samba/smb.conf to inject a name resolve order list after installing samba and winbind:

name resolve order = wins lmhosts bcast

You will need to install samba package first if you haven’t already installed it (for sharing folders with Windows)

sudo apt install samba

The post said the name resolve order section was commented out, but in newer version of samba, the line is simply non-existent. You’ll have to add it somewhere in /etc/samba/smb.conf, I chose to put it right at the beginning of [global] section.

Restart the services after editing to reflect the changes and you can start pinging!

sudo systemctl restart nmbd smbd winbind

So in the process above (installing samba and winbind and editing nsswitch.conf), you’ve also enabled linux to announce its hostname to Windows, which I’ve discussed in this blog post.

So to summarize the concepts,

1. You need to install winbind to add wins to host search list in nsswitch.conf, but it doesn’t do you anything yet!
2. Once you installed samba, your linux computer start announcing its hostname to Windows computers
3. To be able to use the hostnames announced by Windows, i.e. the other direction, you’ll need to add the name resolve order line to smb.conf (samba config file) and restart samba and winbind.

54 total views

## Getting Remote Desktop Server to work on Cinnamon Desktop

xrdp+xorg is a huge pain in the butt as it does not account for variations in systems properly (or automatically) so often it breaks out of the box.

First of all, if you are using cinnamon (including Ubuntu Cinnamon Remix, I suspect it is the same for Linux Mint too), you will run into this shit after successfully logging in:

This is a GNOME session crash. The information on the web points to some other modes of failure in ArchLinux and the like. That’s not the reason. By going through my own notes on xrdp, I noticed the gut of /etc/xrdp/startwm.sh is to call the executable script /etc/X11/Xsession:

test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession

However /etc/X11/Xsession in term look plough through a bunch of scripts in /etc/X11/Xsession.d folder and one step was to look for the executable script ~/.xsession, which is not established by default! For some reason the Xsession scripts can figure out the local desktop environment but not when it’s launched through xrdp!

So the solution is to make an executable script ~/.xsession with just one call to cinnamon-session and that’s it!

I initially thought the call was just ‘cinnamon’ because the most popular answer in the Stack Exchange page suggested writing to ~/.Xclients but this redirection was now obsolete and they use ~/.xsession instead:

but when I did that, the desktop loads but there are no icon and the theme colors are way off. The answer was buried here in a comment in one of the answers:

If you want this behavior to be universal across all user (don’t have to establish the ~/.xsession for each user), and is ok with hard-coding to stick to Cinnamon desktop for everybody including local users (i.e. no redirection script to figure out based on context and conditional config files), you can just replace the last two lines of /etc/xrdp/startwm.sh, which calls /etc/X11/Xsession, with simply cinnamon-session.

Geeze! Why does every basic feature in Windows has to turn into a freaking research project in Linux. I’ve wasted so many hours compiling XRDP from scratch from the author’s webpage thinking it’d solve the problem because he had many tutorials for a lot of cases that xrdp breaks out of the box. Turns out they didn’t matter: it’s just that xrdp couldn’t figure out the right desktop environment so it crashed after loggint in through xorg!

49 total views

## Linux WTF – KDE on Ubuntu and how to get rid of it.

I had quite a bit of trouble getting Cinnamon to work with xrdp (Remote Desktop Protocol for Linux) to work and was misguided to try out other Desktop environments such as KDE. I couldn’t be more displeased about how unfinished and poorly integrated KDE is.

Linux, no matter how good the programmers are with the core code with multiple people’s scrutiny, never had a proper QA team to take care of integration. Linux in 2022 is still like assembling a PC in the 1990s: I’d be super lucky if everything worked out at the first try after very careful planning and knowing every step of the way. There’s always something that just breaks out of the box for the most obvious use cases.

First I installed the ‘kde-full’ package, chose sddm, and rebooted to find out my 4k screen was covered by a giant freaking on screen keyboard:

What the fuck? It’s trying to be smart-ass accommodating handheld devices yet it’s not smart enough to figure that it’s a desktop computer with a keyboard, so it ended up with shitty out of the box behavior that nobody wants under any circumstances!

After I clicked the bottom down keyboard icon to close to the damn on screen keyboard, it keeps popping up as I set the focus to the edit box to type my password so I have to close it again. Aargh!

Once I get into the plasma desktop, the window designed looked like BeOS so I think I cannot accept anything less than Cinnamon for now, so I wanted out. I thought just removing the same ‘kde-full’ package will put me back to where I was, but hell no! I’m still stuck with that ugly and confusing welcome screen and my software menu was cluttered with a boatload of KDE default apps that I do not want!

After a bit of digging around, I’m not the only one perplexed by this behavior. Turns out there’s a lot of clean up the uninstaller didn’t do! That’s why Windows has installer instead of package managers. One size does not fit it all. Installing something just to find out that uninstalling it immediately right after doesn’t put you back to where you were is deeply frustrating.

I adapted his tutorial uninstalling KDE with Ubuntu Cinnamon Remix:

# The desktop is still not removed even if you did "sudo apt remove kde-full"
sudo apt remove plasma-desktop --autoremove
# Default apps the came with KDE and plasma desktop are still there
sudo apt-get remove kde* --autoremove
sudo apt-get remove plasma* --autoremove
# This will give you a menu to pick the old splash screen (it's called plymouth)
sudo update-alternatives --config default.plymouth

# Reflect changes in early startup scripts (initramfas) and boot loader (grub)
sudo update-initramfs -u
sudo update-grub
# Stop and remove SDDM service to get back the old lockscreen
sudo systemctl disable sddm
# Note that you might be thrown out to text mode when you stop SDDM
# Switch to other virtual consoles (e.g. Ctrl+Alt+F2) and run startx to get to the GUI
sudo systemctl stop sddm
# Delete SDDM
sudo apt-get remove --auto-remove sddm
# Clean up SDDM
sudo apt-get purge --auto-remove sddm

# Message in SDDM removal suggests reconfiguring lightdm
# (lightdm is Cinnamon's default greeter)
# Don't need to systemctl enable/start, that's for GDM3
sudo dpkg-reconfigure lightdm

# Reboot
reboot

49 total views

## Fix annoying bash colors

Folders (di) color ($LS_COLOR) are dark blue by default which is hard to read on a default dark background (also default): edit ~/.bashrc and add this to the last line to change folder colors to change it to bold (1) light blue (94) LS_COLORS=$LS_COLORS:'di=1;94:' ; export LS_COLORS

The default prompt ($PS1) also contains the directory (\w), which is also in dark blue (34) but bold (1) by default. Look for the line right below the $color_prompt flag section and change the color ([\033[<STYLE>;<COLOR>m]) modified before \w from bold dark blue (01;34) to bold light blue (01;94)

if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}$\033[01;32m$\u@\h$\033[00m$:$\033[01;94m$\w$\033[00m$\$ '


48 total views

## Cinnamon Desktop UI design WTFs (1)

Out of the box, Cinnamon decides to group the taskbar buttons like later Windows did. It’s often a huge annoyance to people who hates context switching in our head (I like huge workspaces that I can see everything at once so I don’t overlook clues from the relationship between things I’m working on. This is how I find difficult twists in research problems that other people give up solving).

In Windows, you right clock the taskbar, get to settings and there’s a pulldown menu for you to decide whether and how the buttons are grouped. Easy. But Cinnamon still have the Linux smell: organize things that are logical to programmers but not users (Tektronix, DD-WRT, etc. does that too), then surprise users with poorly thought out default behavior.

This time it’s a can of worms that requires some web searching to find people with the same exact specific problem (it’s a sign of poor UI design if the users cannot guess from the UI how to do what they want).

1. Needing to change whether buttons are grouped is common. It should not take a lot of steps to change the behavior, preferably a right click context menu
1. I would have thought it’s under Panel Settings, but hell no, things has to be organized the way the code was designed (sarcasm). It turns out that the windows button grouping is handled by an Applet called “Grouped Window List”
1. Some user suggested removing the applet altogether (turns out it’s wrong and unnecessary as turning it off will disable the taskbar altogether and there’s an option to disable it within the applet’s setting: the applet itself is the windows list, not just the grouping feature), but fuck by default the applet was not activated the settings button is dead. I have to go to the bottom navigation bar in the window and hit the ‘+’ sign to get to the settings so now there’s a check mark next to it and the setting (gear) button is now activated.

They also did not dim the settings button (two gears) when the ‘grouped window list’ is not activated (bug?), which made me think I can configure an Applet that’s not in use. Not to mention the previous settings got cleared (reset) if I disable the Applet and re-enable immediately afterwards (bug?)!
1. Now I can finally get to turn this shit off
1. This is where I think the UI design’s really fucked up. After you activate/deactivate the “Grouped windows list” applet, the buttons aligned right instead of left (default)! WTF!?! Do not do shit to surprise users! There’s absolutely no freaking logical reason why the taskbar button alignment should change the default (or the current state) for any reason!
2. To fix this, you have to so something similar to unlocking the taskbar in Microsoft Windows to move the task button bar. It’s easy in MS Windows as you just right click context menu on the taskbar to unlock and just drag the starting separator (the || bar on the leftmost where the taskbar starts) to specific position you wanted. In Linux/Cinnamon, you have to enter the ‘Panel Edit Mode’ to unlock the taskbar so you can drag things around:
1. I was confused while dragging the task button bar because there’s no clear position markers of where the task button starts and where it can ‘snap to grid’. It’s easy to drop it to the center to align center, but to align left, you have to watch for the buttons you want to insert before to move around to tell if it was a valid place to drop your new taskbar position What a pain in the butt!

This UI design suck, and I can totally understand why they would do something like this because of my programming background. It’s very logical for the programmer to modularize it as one applet, but first of all, generic suffixes like -let and -get does not help users get what the name means: it’s geeks’ way to name abstract concepts without getting the essence of the use case.

In MS Windows, the ‘Applets’ are organized roughly the same as ‘Toolbar’, except Windows is slightly more specialized that they have a ‘Toolbar’, ‘Start Menu’ and ‘Systray’ as distinct concepts instead of abstracting them into a higher level object as in ‘Applets’.

The biggest gripe I have about Cinnamon’s design choices is that detailed position adjustment needs to be easily accessible it’s likely that user preferences may vary a lot.

• By not having a separate Toolbar concept, they forgot to add direct ‘unlock grouped windows list (aka tasklist toolbar in MS Windows)’ option (context menu item). You have to click through ‘Preference > Configure’ to get to get to configure the ‘Grouped window list’
• Since the ‘Grouped window list’ is a (container) ‘bar’ within a bigger’ bar’ (Panel), the position of the window taskbar is logically organized under the platform (the bigger bar, hence the Panel), therefore the unlock window taskbar setting belongs to Panel, not Applet. This makes sense to programmers who knows that the feature is conceptually organized as container objects, but this is hell of confusing for users if they have to reason through this when they are trying to do one of the most common things!
• Unlike MS Windows, you cannot use the task buttons while you are in Panel edit mode. Panel edit mode (you enter a special mode where you drag objects into positions you like, but cannot actually use them, then freeze it after you leave the mode) is the same concept used in Interactive Broker’s Trader Workstation (TWS), which is a pain in the ass but I understand the massive work saved for the people who designs the code/UI. Of course it comes at the expense of user frustration.
• The solution article was written in 2018 and I’m surprised I still need that in 2022!

53 total views

## Mail sorts from oldest to newest by default

This design choice escapes me and is highly annoying. Go go Preferences/Settings > Config Editor (the very bottom problem at the page)

It’s called Advanced Preferences tab. Look up mailnews.default_news_sort_order and change the value from 1 (ascending) to 2 (descending)

Thanks PolarSPARC for the clue.

48 total views

## Excellent Android Free and Open Source Apps

Simple Mobile Tools has very nice replacement for basic features no matter you are using the apps that came with your phone’s stock ROM or LineageOS which has the minimum. It’s lightweight yet it does a little more than most default basic apps

## Browser

• Brave (Can use sync chain that your data is not stored in other people’s cloud)
• DuckDuckGo

## Maps & Navitation

• OsmAnd – Offline Mobile Maps and Navigation
• Organic Maps – very neat map apps that shows the walking trails!

I do not recommend Navit for Android as it’s very slow and broken. GTK+ style GUI looks very odd on Android.

## Multimedia

• Rumble
• Odysee (LRBY)
• Youtube Vanced (Youtube app broke which keeps demanding me to update when it’s already the latest)
You can change the comments behavior in Vanced settings

## Social Media

• Twidere: excellent Twitter/Mastodon client (Twitter’s official client is very resource intensive and sluggish.)

52 total views