Sample Header Ad - 728x90

Validate ~/.XCompose

9 votes
2 answers
1224 views
I'm working on creating my own compose key sequences in ~/.XCompose. As I add more and more sequences, occasionally I make typos or use the same sequence for different symbols. ## Examples: **Typo / Non-Existent Codes** : other-non-existent-keysym **Full Collision** : x # overrule by 2nd rule : y **Prefix Collisions** : y : x # overruled by 1st rule ## Question Is there a command that validates my ~/.XCompose file. Minimum requirement is a binary answer: Either »*your XCompose is error free*« or »*your XCompose contains errors*«. In case there are errors, a helpful error message like »*collision for rule sequence prefix *« would be welcome. ## What I Tried I created ~/.XCompose containing all errors from above and opened a text editor. The text editor shows no errors (on the console). Correct and non-overruled sequences work, all other sequences are ignored. I read man 5 XCompose. In the documentation itself I found nothing helpful. I looked at the references at the end of man 5 XCompose. Only mkcomposecache(1) looks promising (judging from the googled manpage ), but seems to be missing on my system (Linux Mint 18.3). Neither man -k mkcomposecache nor apt search mkcomposecache find anything. **Edit:** As @quixotic suggested, I compiled mkcomposecache from the sources and ran it, but its exits status is 1, no matter what compose file I choose (with or without errors). There is no error message. No cache is generated. Example of how I call the program: $ mkcomposecache en_US.UTF-8 /usr/share/X11/locale/en_US.UTF-8/Compose /tmp/ * XOpenDisplay: Success $ echo $? 1 The file /usr/share/X11/locale/en_US.UTF-8/Compose is Ubuntu's original compose file and should be error free. I guess there is a reason why it is not packaged in the Ubuntu and Arch Linux repositories. I doubt that mkcomposecache is what I need, even if it would work.
Asked by Socowi (645 rep)
Jan 6, 2018, 02:15 PM
Last activity: Jun 16, 2021, 06:11 PM