Update failed, file already exists in file system

I tried to run an update of all of my packages (pacman -Syuq) and it fails with this information here:

(336/336) checking keys in keyring                                                        100%
(336/336) checking package integrity                                                      100%
(336/336) loading package files                                                           100%
(336/336) checking for file conflicts                                                     100%
error: failed to commit transaction (conflicting files)
xkeyboard-config: /usr/share/X11/xkb exists in filesystem
Errors occurred, no packages were upgraded.

Checking the owner of this, I see that the same package is actually owning the folder:

 ~ pacman -Qo /usr/share/X11/xkb
/usr/share/X11/xkb/ is owned by xkeyboard-config 2.44-1

I feel like this is the kind of error which can be easy to fix but I am afraid of doing something fatal here.

Is the solution to reinstall the named package a valid solution or should I do something else here? I could not find see any specific known similar bugs from xkeyboard-config the past months, so maybe this is specifically me

sudo pacman -Syu

If this also fails, please provide the full command output of it failing; with that information, someone might be able to help.

In the meantime, please provide system information as described (below), plus any other useful details.

I’m sure someone will help when they are able.

Regards.


Welcome to the Manjaro community

As a new or infrequent forum user, please take some time to familiarise yourself with Forum requirements, and the many ways to use the forum to your benefit:


Update Announcements

The Update Announcements contain important information and a Known Issues and Solutions section that should generally be checked before posting a request for support.

System Information

While information from *-fetch type apps might be fine for someone wishing to buy your computer, for Support purposes it’s better to ask your system directly; :eyes:

Output of the inxi command with appropriate parameters will achieve this (naturally, formatted according to forum guidelines) and will generally be more useful for those wishing to help:

inxi --filter --verbosity=8

or the short form:

inxi -zv8

Be prepared to provide output from other commands whenever asked. It’s equally important to provide as much actionable information as possible in your first post, rather than simply indicating there is a problem.

Highly Recommended
Required Reading
Technical Resources

2 Likes

The new packages creates a sym link for /usr/share/X11/xkb and removes the folder and it contents before its creation.
But if there are somewhere files in /usr/share/X11/xkb that are not owned by the “xkeyboard-config” package, it will not removed the folder, which can lead to the error you see.

Did you manually added a file or multiple files in /usr/share/X11/xkb? If so remove them and try again.

3 Likes

That’s a new one, never noticed it has a ‘quiet’ option… however, I don’t see why it would be any worse than a straight pacman -Syu.

Aha, not a complete idiot - that’s promising… lots of folks dive in and start messing with permissions.

Actually, the FIRST step is to ensure you have working snapshots, and working backups - then you can safely nuke your system and bring it back from the dead.

/usr/share/X11/xkb (managed by the xkeyboard-config package) already exists in your filesystem, conflicting with Pacman’s attempt to install/update the package. Some kind of failure, or manual intervention - not sure why, but here goes…

1. Back it up first and then try to overwrite:

sudo cp -r /usr/share/X11/xkb /usr/share/X11/xkb.backup
sudo pacman -Syu --overwrite '/usr/share/X11/xkb/*'

2. Still messed up? Nuke the little beggar :wink: :

sudo rm -rf /usr/share/X11/xkb   && sudo pacman -Syu                 

If that’s fixed, don’t forget to nuke the /usr/share/X11/xkb.backup:

sudo rm -rf /usr/share/X11/xkb.backup

I’m not sure why this happened, it’s possible a previous update failed, or whatever - but hopefully it’s clean now.

:vulcan_salute:

2 Likes

@DORpave

I was looking for a topic that mentioned this, forgetting that it was in the Update announcements. Please see the following item under Known Issues and Solutions:

Regards.

4 Likes

Hello everybody!
Thank you for your answers, that was really really helpful.

I read through the update announcement link which soundofthunder sent in and that one started something similar to the solution the others talked about. I backuped the folder, ran the installation with --overwrite and everything was smooth after a restart.

I did not have any interest in having to reinstall the OS (which I am always afraid of), but I have updated and timeshift just in case.

Anyway, I found out a potential source of whats going on:
I have two question layouts in my symbols folder (and then also an altered rules/evdev.xml file), since I am a multilingual living in a third country and I am so sick of constantly searching for special symbols of all languages I use.

Every time I reinstall a Linux, I just run a script copying these two layouts and add them into the evdev. It may not be the issue here, but I can be.

-rw-r--r-- 1 root root  22K  9. Jun 11:17 af
-rw-r--r-- 1 root root 5,9K  9. Jun 11:17 al
-rw-r--r-- 1 root root 3,7K  9. Jun 11:17 altwin
-rw-r--r-- 1 root root 9,3K  9. Jun 11:17 am
-rw-r--r-- 1 root root 8,3K  9. Jun 11:17 ancient
-rw-r--r-- 1 root root  52K  9. Jun 11:17 apl
-rw-r--r-- 1 root root  36K  9. Jun 11:17 ara
-rw-r--r-- 1 root root  392  9. Jun 11:17 at
-rw-r--r-- 1 root root  222  9. Jun 11:17 au
-rw-r--r-- 1 root root 3,9K  9. Jun 11:17 az
-rw-r--r-- 1 root root  690  9. Jun 11:17 ba
-rw-r--r-- 1 root root 3,3K  9. Jun 11:17 bd
-rw-r--r-- 1 root root  11K  9. Jun 11:17 be
-rw-r--r-- 1 root root  19K  9. Jun 11:17 bg
-rw-r--r-- 1 root root 5,2K  9. Jun 11:17 bqn
-rw-r--r-- 1 root root  19K  9. Jun 11:17 br
-rw-r--r-- 1 root root 2,5K  9. Jun 11:17 brai
-rw-r--r-- 1 root root 3,6K  9. Jun 11:17 bt
-rw-r--r-- 1 root root  950  9. Jun 11:17 bw
-rw-r--r-- 1 root root 4,4K  9. Jun 11:17 by
-rw-r--r-- 1 root root  17K  9. Jun 11:17 ca
-rw-r--r-- 1 root root 5,2K  9. Jun 11:17 capslock
-rw-r--r-- 1 root root 3,9K  9. Jun 11:17 cd
-rw-r--r-- 1 root root 6,7K  9. Jun 11:17 ch
-rw-r--r-- 1 root root  28K  9. Jun 11:17 cm
-rw-r--r-- 1 root root  37K  9. Jun 11:17 cn
-rw-r--r-- 1 root root 2,5K  9. Jun 11:17 compose
-rw-r--r-- 1 root root 4,2K  9. Jun 11:17 ctrl
-rw-r--r-- 1 root root  23K  9. Jun 11:17 cz
-rwxr-xr-x 1 root root  86K 29. Jun 11:50 da
-rw-r--r-- 1 root root 100K  9. Jun 11:17 de
drwxr-xr-x 1 root root   16 29. Jun 11:47 digital_vndr
-rw-r--r-- 1 root root 2,6K  9. Jun 11:17 dk
-rwxr-xr-x 1 root root  86K 29. Jun 11:50 dn
-rw-r--r-- 1 root root  13K  9. Jun 11:17 dz

They are all owned by root, but da and dn have indeed different rights here.

Do you suspect that this was the source of evil?

Thank you everybody for answering!

As @xabbu said, the files you added weren’t owned by the package, so it left the directory instead of removing it and replacing it with a symlink.

evdev.xml will be overwritten when xkeyboard-config is updated.

If you use Wayland then you can override that file in either /etc/xkb or $XDG_CONFIG_HOME/xkb (aka ~/.config/xkb), then it won’t be overwritten. Create the directories you need, for instance /etc/xkb/rules

Custom layouts aren’t a problem (unless you’ve modified layouts owned by xkeyboard-config), but they can be put there too (in the symbols dir of course).

2 Likes

I doubt the differing permissions contributed to the failed update, but it’s probably a good idea to keep them uniform, in any case.


One of the most common causes for update failures is due to mirrors needing to be refreshed. That one is easily fixed; See Manjaro Mirrors.

Using pacman (example):

sudo pacman-mirrors --continent
sudo pacman -Syu

Using pamac:

pamac update --no-aur --force-refresh

Another possible problem that prevents updating might be related to packages installed via the AUR; dependency issues.

However, they can usually be avoided by separating the update process; Manjaro repo updates first, before rebuilding AUR packages.

For example;

Using pacman and pamac:

sudo pacman -Syu
pamac update --aur

Or, using pamac only:

pamac update --no-aur
pamac update --aur

Regards.

Indeed they didn’t.

Normally those files would’ve been ignored, but this update was unusual in that the /usr/share/X11/xkb directory was replaced with a symlink. To do that the directory needed to be deleted which would’ve deleted those files, but they didn’t belong to the package and therefore couldn’t be replaced.

So the directory was left and then of course the symlink couldn’t be created which led to the error in the OP.

Agreed, they don’t need execute permissions.

1 Like

Something simple to try if get this on a regular basis: Smartctl tests, short, long, drive health. Do this especially if the drive has seen a lot of use.

Haha - don’t get me started… to be able to type Ω, or ไทย… :+1: without hitting a :gear: or check ✓ or :heavy_check_mark: unless it’s wrong ✘

Set yourself a Compose key, and edit your ~/.XCompose

Note, I have put a # to disable some lines - and often those are just reminders for defaults… like £ (capital L and =) though I can also type gbp to get it, that’s why XCompose is sweet.

🍰 - copy this and paste to your .XCompose
 # ~/.XCompose
# This file defines custom Compose sequences for Unicode characters

# Import default rules from the system Compose file:
include "/usr/share/X11/locale/en_US.UTF-8/Compose"

# compose -: -> ÷
# <x> <X> : "×"
# µ is compose /u ( also now 'micro')
<Multi_key> <c> <o> <g>                 : "⚙️"
<Multi_key> <m> <i> <c> <r> <o>         : "µ"   # micro
<Multi_key> <n> <u> <m>                 : "№"   #numero
<Multi_key> <g> <b> <p>                 : "₤"
<Multi_key> <t> <h> <a> <i>             : "ไทย"
<Multi_key> <b> <t>                     : "฿"        # Thai Baht
<Multi_key> <d> <i> <v>                 : "÷"
<Multi_key> <o> <h> <m>                 : "Ω"
<Multi_key> <d> <e> <g> <c>             : "°C"
<Multi_key> <Multi_key> <d> <e> <g> <F> : "℉"   U2109   # DEGREE FAHRENHEIT

<Multi_key> <V> <V>                 : "✓" U2713 # CHECK MARK
<Multi_key> <y> <y>                 : "✔" U2714 # HEAVY CHECK MARK 'Yes yes'
<Multi_key> <n> <n>                 : "✘" U2718 # HEAVY BALLOT "✘" no no
<Multi_key> <t> <h> <u>             : "👍"  # thumb up
<Multi_key> <t> <v> <m>             :"ขอบคุณมากครับ เจอกันใหม่ครั้งหน้าครับ"
<Multi_key> <k> <a> <p>             : "ครับ"

# Other Symbols
<Multi_key> <s> <t>                     : "⭐"  # star
<Multi_key> <s> <u> <n>                 : "☀"
<Multi_key> <u> <p>                     : "☝" # point up
<Multi_key> <m> <u> : "µ" U00B5          # Micro (shorter than <m><i><c><r><o>)
<Multi_key> <s> <q> <u> <a> <r> <e> <d> : "²"  # squared
<Multi_key> <p> <o> <0>             : "💩"
<Multi_key> <k> <b>                 : "<kbd>"  # keyboard discord
<Multi_key> <k> <f>                 : "</kbd>"  # keyboard discord
<Multi_key> <k> <n>                 : "</kbd><kbd>"  # keyboard discord

<Multi_key> <o> <exclam>            : "●" U25cf # BLACK CIRLE (passwords)
#  <numbersign> = #
<Multi_key> <at> <numbersign>       : "⌘" U2318 # PLACE OF INTEREST SIGN
<Multi_key> <i> <d> <e> <a>         : "💡"    U1F4A1 # ELECTRIC LIGHT BULB
### /\ __ /\ EMOJIS
<Multi_key> <f> <u> <s> <e>       : "💣"    U1F4A3 # BOMB
<Multi_key> <z> <z> <z>             : "💤"    U1F4A4 # SLEEPING SYMBOL
<Multi_key> <p> <o> <w>             : "💥"    U1F4A5 # COLLISION SYMBOL
<Multi_key> <p> <o> <o>             : "💩"    U1F4A9 # PILE OF POO
<Multi_key> <k> <i> <s> <s>         : "💋"    U1F48B # KISS MARK
<Multi_key> <r> <o> <c> <k> <e> <t> : "🚀"   U1F680 # ROCKET
<Multi_key> <e> <a> <r> <t> <h>     : "🌍"   U1f30d # EARTH GLOBE EUROPE-AFRICA
<Multi_key> <f> <i> <r> <e>         : "🔥" U1F525
<Multi_key> <c> <o> <f> <f> <e> <e> : "☕" U2615
<Multi_key> <c> <a> <t>             : "🐈" U1F408
<Multi_key> <t> <u> <x>           : "🐧"   U1f427 # PENGUIN
<Multi_key> <f> <u>               : "🖕"   U1F595 # REVERSED HAND WITH MIDDLE FINGER EXTENDED
<Multi_key> <l> <l> <a> <p>       : "🖖"   U1F596 # Live Long and Prosper


# Typography
<Multi_key> <greater> <period>          : "›"   U203a # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
<Multi_key> <less> <period>             : "‹"   U2039 # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
<Multi_key> <H> <less>: "❮" U276E # HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT
<Multi_key> <H> <greater>       : "❯" U276F # HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
<Multi_key> <asterisk> <3>      : "⁂" U2042 # ASTERISM
<Multi_key> <asterisk> <f>      : "❦" U2766 # FLORAL HEART (fleuron, aldus leaf)
<Multi_key> <asterisk> <e> <s>  : "፠"   U1360 # ETHIOPIC SECTION MARK
<Multi_key> <asterisk> <e> <p>  : "፨"   U1368 # ETHIOPIC PARAGRAPH SEPARATOR
# Extra Math symbols
<Multi_key> <minus> <period>      : "−"   U2212 # MINUS SIGN
# slash:                   "/" U002F # ASCII SLASH
<Multi_key> <slash> <slash>: "∕" U2215 # DIVISION SLASH (INTENTIONAL CONFLICT)
<Multi_key> <slash> <period>: "⁄" U2044 # FRACTION SLASH
<Multi_key> <slash> <backslash>     : "∧"  U2227            # LOGICAL AND
<Multi_key> <backslash> <slash>     : "∨"  U2228            # LOGICAL OR

# Signs
<Multi_key> <i> <o>                         : "🛈"   U1f6c8 # CIRCLED INFORMATION SOURCE 🛈⚠
<Multi_key> <slash> <1> <backslash>   : "⚠"   U26A0 # WARNING SIGN
<Multi_key> <s> <k> <u> <l> <l>       : "☠"  # "skull" instead of <o><x>
# <Multi_key> <o> <x> => ¤            : "☠"   U2620  # SKULL AND CROSSBONES
<Multi_key> <z> <a> <p>               : "⚡"   U26A1 # HIGH VOLTAGE SIGN
<Multi_key> <a> <t> <o> <m>           : "⚛"   U269B       # ATOM SYMBOL
<Multi_key> <r> <a> <d>             : "☢"   U2622       # RADIOACTIVE SIGN
<Multi_key> <b> <i> <o>             : "☣"   U2623       # BIOHAZARD SIGN
<Multi_key> <p> <e> <n> <t> <a>     : "⛤" U26E4        # PENTAGRAM
<Multi_key> <m> <a> <i> <l>         : "✉"   U2709       # ENVELOPE
<Multi_key> <w> <h> <l> <c> <h>     : "♿"   U267F       # WHEELCHAIR SYMBOL

# Something different for STAFF OF AESCULAPIUS?
<Multi_key> <m> <e> <d>             : "⚕"   U2695   # STAFF OF AESCULAPIUS

##### Asterisks (and stars)
<Multi_key> <8> <8>                 : "★" U2605 # BLACK STAR
<Multi_key> <8> <7>                 : "☆" U2606 # WHITE STAR (INTENTIONAL CONFLICT)
<Multi_key> <8> <0>                 : "✪" U272A # CIRCLED WHITE STAR
<Multi_key> <8> <2>                 : "⁑" U2051 # TWO ASTERISKS ALIGNED VERTICALLY
<Multi_key> <8> <4>                 : "✢"  U2722  # FOUR TEARDROP-SPOKED ASTERISK
<Multi_key> <8> <6>                 : "✡" U2721 # STAR OF DAVID
<Multi_key> <8> <numbersign>        : "✯" U272F # PINWHEEL STAR
<Multi_key> <8> <1>                 : "✱" U2731 # HEAVY ASTERISK
<Multi_key> <8> <h>                 : "⎈" U2388 # HELM SYMBOL
<Multi_key> <8> <p>                 : "●" U25cf # BLACK CIRLE (for password fields)
<Multi_key> <8> <s>                 : "﹡"   Ufe61 # SMALL ASTERISK
<Multi_key> <8> <w>                 : "*"   Uff0a # FULLWIDTH ASTERISK (CJK)

##### Small greek letters
<Multi_key> <a> <l> <p> <h> <a>     : "α"   U03B1       # GREEK SMALL LETTER ALPHA
<Multi_key> <b> <e> <t> <a>         : "β"   U03B2       # GREEK SMALL LETTER BETA
<Multi_key> <p> <i>                 : "π"   U03C0       # GREEK SMALL LETTER PI


##### Maths Stuff #####
# 4 compose ^. 2 -> 4·2
# Compose ^ -> superscript m² 2³ 3⁴
# Compose ^ 0 -> degree 34⁰
# compose cel -> °C, compose 'degc' --> °C...(compose ^0F) ⁰F
# Compose _ subscript -> 3₃
# Compose ( digit ) (3) -> ③
# Compose oc ©, or ®, tm™,

##### Punctuation etc
# Compose : . -> ∴ therefore :.
# compose . : -> ∵ because   .:

# Compose < < ⇒ « «
# Compose > > ⇒ »
# Compose . < ⇒ ‹
# Compose . > ⇒ ›
# Compose - - - -> — (auto with ligatures)
# compose -- -> ­ (em-dash)

# Compose + - -> ±
# Compose : – ⇒ ÷
# Compose 1 2 ⇒ ½
# Compose 1 4 ⇒ ¼
# Compose any 2 digits... (⅞) up to eighths.

##### Phonetics
# <Multi_key> <a> <i> <r>:"eər"          # ~ 'air'
# <Multi_key> <o> <i>: "ɔɪ"              # 'oi' in 'boy'
# <Multi_key> <o> <u> <c> <h>: "aʊ"      # ou in ouch
# <Multi_key> <i> <i>: "ɪ"               # i in PiN
# <Multi_key> <i> <e>: "aɪ"              # i in 'PiNE'
# <Multi_key> <t> <h> <h>: "ɵ"
# <Multi_key> <t> <h> <e>: "ð"
# <Multi_key> <t> <d>: "ð"
# <Multi_key> <z> <h>: "ʒ"
# <Multi_key> <u> <u>: "ᴧ"                    # u in cup
<Multi_key> <s> <h>: "ʃ"                   # sh
# <Multi_key> <o> <o>: "ʊ"                   # oo in book
# <Multi_key> <o> <a> <r>: "ɔ:"                   # 'or' in 'sort'
# <Multi_key> <a> <r>: "ɑː"                     # ar in 'car'
# <Multi_key> <a> <e>: "eɪ"                   # ai in rain
# <Multi_key> <e> <h>: "ɛ"                   # short 'e' sound
# <Multi_key> <u> <e>: "ə"                    # 'a' in 'a pig'
# <Multi_key> <e> <r>: "ɛ:"                   # 'ir' in 'sir' and 'girl'
# <Multi_key> <o> <e>: "əʊ"                   # 'ə' in  'the' plus 'ʊ' in book = long 'o'

##### Diacritic Characters #####
# ' (apostrophe -> acute accent, so 'e-> é 'a->á)
# " (speech) -> diaeresis ä, ë
# ` (grave) -> à, è
# _ (underscore) -> macron ā, ē
# ^ (circumflex) -> circumflex â, ê
# ~ (tilde) -> ã, õ
# , (comma) -> cedilla Ç, ç

######## DeepSeek
<Multi_key> <l> <o> <l>                         : "( ͡° ͜ʖ ͡°)"  # Lenny face
# <Multi_key> <asciicircum> <2> → ² (U+00B2)           # Superscript
# <Multi_key> <underscore> <2> → ₂ (U+2082)            # Subscript

## Legal Symbols:
<Multi_key> <c> <o> :"©" # (U+00A9)
<Multi_key> <r> <o> :"®" # (U+00AE)

# Doubled arrows for implication.
<Multi_key> <equal> <greater>		: "⇒"	U21D2		# RIGHTWARDS DOUBLE ARROW
<Multi_key> <equal> <less>	     	: "⇐"	U21D0		# LEFTWARDS DOUBLE ARROW
<Multi_key> <less> <minus> <equal> <greater> : "⇔" U21D4 # LEFT RIGHT DOUBLE ARROW
<Multi_key> <equal> <Right> <Right>	: "⇒"	U21D2		# RIGHTWARDS DOUBLE ARROW
<Multi_key> <equal> <Left> <Left>	: "⇐"	U21D0		# LEFTWARDS DOUBLE ARROW
<Multi_key> <equal> <Left> <Right>	: "⇔"	U21D4	# LEFT RIGHT DOUBLE ARROW
<Multi_key> <equal> <Right> <Left>	: "⇔"	U21D4	# LEFT RIGHT DOUBLE ARROW
<Multi_key> <equal> <Up> <Up>		: "⇑"	U21D1	# UPWARDS DOUBLE ARROW
<Multi_key> <equal> <Down> <Down>	: "⇓"	U21D3	# DOWNWARDS DOUBLE ARROW
<Multi_key> <equal> <Up> <Down>		: "⇕"	U21D5	# UP DOWN DOUBLE ARROW
<Multi_key> <equal> <Down> <Left>	: "⏎"	U23CE	# RETURN ENTER
<Multi_key> <k> <e>                 : "<kbd>⏎ Enter</kbd>"

########## Discord
<Multi_key> <c> <a> <k> <e>         : "🍰"
2 Likes

I find third level shift easier (with the gb layout), luckily I mostly only use ¹, ², ³, Ω and µ anyway, sometimes also æ and þ for fun, eg. dæmon, or Þe olde shoppe (aka ye olde shoppe, aka the old shop). Though you do have to enable third level shift, as something (presumably the GUI keyboard settings) disables it for some reason.

The main problem is remembering which key gives which char, but you can get a visual using something like gkbd-keyboard-display -l gb.

Unfortunately the us layout is only 2 level but there’s an international variant with 4 levels.


Which brings up another question. How do you enter unicode on KDE? The usual Ctrl + Shift + U followed by hexcode and Enter doesn’t work for some stupid reason.

Still works on Mate, I might have to go back, so many stupid and annoying things with KDE.

{start rant}
Why do Wayland, KDE and Gnome keep breaking things, and leaving out useful features we’ve had for a decade or more. I feel like our OS is going backwards, in a few years we’ll all be using abaci.
{end rant}

I dont want to start the discussion about keyboards again, but what I am actually using is the Caps Lock button for changing between layouts and then all it does is going through different layouts swapping out some specific keys between each other, so for example åæø in Norwegian becomes üäö in German. I also swapped everything to QWERTY so French and German behaviour don’t do evil stuff.

But talking about what dmt wrote: Yes, indeed, like twice a month, my layouts get flushed away because evdev is updated. Irritating, but I just got used to it, thats a 10seconds fix with a script I wrote.

I like your idea here, but $XDG_CONFIG_HOME is empty and there is no xkb folder in ~/.config. I am indeed using wayland, as echo $XDG_SESSION_TYPE outputs wayland.
So maybe, there is some config missing here, can I just add this in the shell or is it not that easy? I never had the idea that there can be a custom folder for this, since the original evdev.xml has a section for custom stuff

That file is owned by xkeyboard-config and it doesn’t get updated that often. So not sure what’s going on there.

What are you doing in evdev.xml? You can use custom layouts without changing anything in there.

It falls back to ~/.config/xkb. You need to create it and any other dirs such as ~/.config/xkb/rules.

It’s relatively new, and it only works on Wayland because apparently X11 is hard-coded and no one wants to back-port it.

Here’s a blog about it from one of the devs.

Sorry, my bad, I was supposed to write twice a year :slight_smile:

In evdev.xml, I add two layouts before the tag.

The factual script is this one:

#!/bin/bash

set -e

sudo cp da /usr/share/X11/xkb/symbols/
sudo cp dn /usr/share/X11/xkb/symbols/

FILE="/usr/share/X11/xkb/rules/evdev.xml"
BACKUP="/usr/share/X11/xkb/rules/evdev.xml.bak"

NEW_LAYOUTS='
<layout>
 <configItem>
   <name> da </name>
   <shortDescription>DE</shortDescription>
   <description> Dabendorf DE </description>
   <languageList>
      <iso639Id> deu </iso639Id>
   </languageList>
 </configItem>
 <variantList/>
</layout>
<layout>
 <configItem>
   <name> dn </name>
   <shortDescription>NO</shortDescription>
   <description> Dabendorf NO </description>
   <languageList>
      <iso639Id> deu </iso639Id>
   </languageList>
 </configItem>
 <variantList/>
</layout>
'

# Test root rights
if [ "$EUID" -ne 0 ]; then
  echo "Please use sudo"
  exit 1
fi

# Backup
cp "$FILE" "$BACKUP"

# Add layouts
awk -v insert="$NEW_LAYOUTS" '
/<\/layoutList>/ {
  print insert
}
{ print }
' "$BACKUP" > "$FILE"

echo "Successfully added layouts 'da' and 'dn'"

It has worked for years and originally comes from the time when I was using Ubuntu (since its Gnome anyway): https://askubuntu.com/questions/510024/what-are-the-steps-needed-to-create-new-keyboard-layout-on-ubuntu

Thank you for the link, I will have a look for the contents in here.

1 Like

That sounds about right. :slight_smile:

Ah, so you’re configuring which layouts you use through the GUI. :+1:

You can configure at least one custom layout through the CLI without editing any package owned file. It should work with multiple layouts, I just can’t remember trying it.

However overriding the file in either /etc/xkb (multiple users) or ~/.config/xkb (single user), seems like the best option.

Just so you know, base.xml and evdev.xml are meant to be identical, but it doesn’t seem to matter too much, as you don’t modify base.xml and it sounds like it works. :man_shrugging:

1 Like

It’s broken, but XCompose makes up for it.

Not broken…

That’s ridiculous - I never knew why it didn’t work, it’s one reason I had trouble messing with my inputs a year or two back and it’s weird that it’s disabled in the basic layout.

I have a fairly standard US Int. keyboard, but the layout English (US) doesn’t accomodate Unicode.

  1. Base QWERTY with $ and @ above №2 is English (US)
  2. intl. is designed to type characters for Western European languages (accents, diacritics etc using dead keys).
  3. AltGr I’m assuming is redundant for me as I don’t have that key… but CtrlShiftU now works.

Also, just in case you’re interested - for typing keys I now type ‘Compose kb’ to get <kbd> then ‘kn’ gets me </kbd><kbd> and ‘kf’ for </kbd>.

Generally by the time I found the character, then the Unicode (U2718 ✘) then I’d rather just enter something I can remember… maybe like ‘wrong’ or in this case ‘nn’ for NO! NO! :heavy_check_mark:

So I now need to learn my new keyboard layout - I assume my RAlt is now active because on my 123 keys, with Right Alt I now get ¡²³.

So it seems now I have successfully passed the bar to achieve Level 3 :wink:

1 Like

I don’t think it does, it’s different functionality. Though I must admit I use it so rarely I’ve forgotten all the hexcodes.

I’d prefer all 3 options to be at my disposal, so I could use whichever best suits the situation (but mostly for playing around).

It’s often Right Alt or just the Alt on the right.

You can change the key for third level shift anyway, there are plenty of options, and you can also assign it to any key by messing with the layout.

I think I’d still prefer a plugin.

However thanks to that (and ibus), not only do I have those custom compose definitions (so much better than typing it) but Ctrl+Shift+U also works now.

Thank You. :smiley:

Welcome to Level 3 (and 4). :slight_smile:

There’s also a Level 5 Shift, but AFAIK no default layout uses more than 4 levels. Well they use a 5th level for switching TTYs, but of course that doesn’t use 5th level shift.

Now I challenge you to get to Level 9 - if you feel like it (as it could be a bit of a rarebit¹ hole). :grin:

Edit:

¹Like a rabbit hole, but cheesier. :coat: :door:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.