Skip to content

Tag: archlinux

Mozc Japanese Input on Arch Linux (KDE + X11) β€” Working Setup

So I can repeat it if I ever need to reinstall.

System:

  • OS: Arch Linux
  • DE: KDE Plasma
  • Session: X11
  • Input Method Framework: fcitx5 with fcitx5-mozc

📦 Installed Packages

sudo pacman -S fcitx5 fcitx5-mozc fcitx5-configtool fcitx5-gtk fcitx5-qt

⚙️ Environment Variables (KDE-compliant)

Create file:

~/.config/environment.d/fcitx5.conf

Add:

GTK_IM_MODULE=fcitx5
QT_IM_MODULE=fcitx5
XMODIFIERS=@im=fcitx

🚀 Autostart fcitx5 on Login

Create file:

~/.config/autostart/fcitx5.desktop

Add:

[Desktop Entry]
Type=Application
Exec=fcitx5
Hidden=false
X-GNOME-Autostart-enabled=true
Name=Fcitx5
Comment=Start fcitx5 input method

🧪 Configure Input Method

Run:

fcitx5-configtool
  • Add Mozc to your input methods
  • Set your toggle key (e.g. Ctrl+Space)
  • Optionally reorder inputs

✅ Done!

Custom Mapping

keymap.txt

status	key	command
Precomposition	Ctrl 、	InputModeHiragana
Precomposition	Ctrl .	InputModeKatakana
Precomposition	Ctrl /	InputModeLatin
Precomposition	Ctrl F12	LaunchConfigDialog
Precomposition	Backspace	Revert
Precomposition	Ctrl Backspace	Undo
Precomposition	Enter	Commit
Precomposition	Space	InsertSpace
Composition	Ctrl ,	InputModeHiragana
Composition	Ctrl .	InputModeKatakana
Composition	Ctrl /	InputModeLatin
Composition	Backspace	Backspace
Composition	Delete	Delete
Composition	Enter	Commit
Composition	Space	Convert
Composition	Ctrl ,	ConvertToHiragana
Composition	Ctrl .	ConvertToFullKatakana
Composition	Ctrl /	ConvertToFullAlphanumeric
Composition	Ctrl ;	ConvertToHalfWidth
Composition	Ctrl '	ConvertToHalfAlphanumeric
Composition	ESC	Cancel
Composition	Ctrl u	Cancel
Conversion	Ctrl ,	InputModeHiragana
Conversion	Ctrl .	InputModeKatakana
Conversion	Ctrl /	InputModeLatin
Conversion	Backspace	Cancel
Conversion	Delete	Cancel
Conversion	Enter	Commit
Conversion	Space	ConvertNext
Conversion	Ctrl ,	ConvertToHiragana
Conversion	Ctrl .	ConvertToFullKatakana
Conversion	Ctrl /	ConvertToFullAlphanumeric
Conversion	Ctrl ;	ConvertToHalfWidth
Conversion	Ctrl '	ConvertToHalfAlphanumeric
Conversion	ESC	Cancel
Conversion	Ctrl [	Cancel

Arch Linux Maintenance Documentation

Generic commands for me to use.

1. Check disk usage and free space

To see how much space is used and available on each partition:

df -h

For more detailed usage on individual directories:

du -sh /*

To check specific folder usage, like your home directory:

du -sh /home/USER

2. Delete files in Trash

To clear the Trash:

rm -rf ~/.local/share/Trash/files/*

3. Remove unused packages and clean package cache

To remove orphaned packages (packages that were installed as dependencies but are no longer required):

sudo pacman -Rns $(pacman -Qdtq)

To clean the pacman package cache, removing old versions of packages:

sudo pacman -Sc

To remove all cached packages (careful with this as it removes all cached versions):

sudo pacman -Scc

4. Update the system

To update the system and all packages:

sudo pacman -Syu

5. List installed packages

To list all installed packages:

pacman -Q

To list only explicitly installed packages (packages you manually installed):

pacman -Qe

6. Check for broken packages

Sometimes, an update might break something. To check if there are any broken or incomplete packages:

sudo pacman -Qk

7. Remove unnecessary logs

Log files can accumulate over time. To remove systemd logs (be cautious, as this might remove useful logs):

sudo journalctl --vacuum-size=100M

To clear all logs, set a retention period (e.g., 1 week):

sudojournalctl --vacuum-time=1w

8. Remove unused dependencies (after uninstalling software)

When you remove software, there may be leftover dependencies that were installed with it but are no longer needed. Clean these up with:

sudo pacman -Rns $(pacman -Qdtq)

9. System Cleanup and Optimizing

You can also use debt of space in hidden configuration files or directories. This command cleans some space from orphaned packages or unneeded files (it’s safe to run occasionally but make sure to review packages first):

sudo pacman -Qdtq | sudo pacman -Rns -

10. Check your system for errors

Sometimes file systems can develop errors. You can check and repair them (if needed):

sudo fsck -A

For specific file systems (e.g., if you want to check /home):

sudo fsck /dev/sda3

11. Remove old kernels

If you’re using linux-lts or other kernel versions, they can take up a lot of space. Remove unused or older kernels:

sudo pacman -R linux-lts linux-lts-headers

12. Rebuild package database

Sometimes, the package database can become corrupt. If you face issues with package installation or updates, rebuild it:

sudo pacman -Syyu

13. Clear the font cache

To clear font cache and refresh it:

sudo fc-cache -f -v

14. Check running processes

To view the running processes and resource usage on your system:

top

Or for a more detailed view:

htop

15. Uninstall a package

If you need to remove a package completely (including dependencies that were installed with it):

sudo pacman -Rns <package_name>

16. View system logs

To see detailed logs of system activities, including errors or other logs:

sudo journalctl -xe

17. Check for available system updates

To check if there are updates without actually installing them:

sudo pacman -Qu

18. Checking and cleaning memory usage (swap)

To view swap usage:

swapon --show

To turn off swap (useful for troubleshooting or cleanup):

sudo swapoff -a

19. Free up system memory (clear cache)

To clear cached memory:

sudo sysctl vm.drop_caches=3

Managing MySQL (MariaDB) for Local Use on Arch Linux

So I can run small projects locally like journaling and stuff.

Installation

sudo pacman -S mariadb

sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

sudo systemctl enable mariadb

sudo systemctl start mariadb

sudo mysql_secure_installation

mysql -u root -p

Can’t login?

sudo mariadb

USE mysql;

ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('yourpassword');

FLUSH PRIVILEGES;

EXIT;

New User and Database

CREATE DATABASE mydb;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;