• Keyboard not working

    From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint on Sat Sep 6 17:33:48 2025
    From Newsgroup: alt.os.linux.mint

    I want to add a second keyboard layout, but Mint menu > Keyboard does absolutely nothing. No window opens when I click it.

    When typing cinnamon-settings keyboard I get all this:

    /usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py:458: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
    self.window.set_wmclass(wm_class, wm_class)
    Loading Keyboard module
    Traceback (most recent call last):
    File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 811, in <module>
    window = MainWindow()
    ^^^^^^^^^^^^
    File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 330, in __init__
    if self.load_sidepage_as_standalone():
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 464, in load_sidepage_as_standalone
    self.go_to_sidepage(sp_data.sp, user_action=False)
    File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 185, in go_to_sidepage
    sidePage.build()
    File "/usr/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py",
    line 212, in build
    self.module.on_module_selected()
    File "/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py",
    line 513, in on_module_selected
    _config = json.load(config_file)
    ^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/json/__init__.py", line 293, in load
    return loads(fp.read(),
    ^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


    I have no idea what I'm looking at here. I see an error in the last
    line, but have no clue what to do about it.

    Tried upgrading to 22.2 hoping that would fix the issue, but it didn't.

    Also tried sudo apt install --reinstall cinnamon-control-center as
    suggested by an AI but that didn't help either.

    Any ideas?
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Bourne@nntp.mbourne@spamgourmet.com to alt.os.linux.mint on Sun Sep 7 11:01:37 2025
    From Newsgroup: alt.os.linux.mint

    Monsieur wrote:
    I want to add a second keyboard layout, but Mint menu > Keyboard does absolutely nothing. No window opens when I click it.

    When typing cinnamon-settings keyboard I get all this:

    /usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py:458: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
    -a self.window.set_wmclass(wm_class, wm_class)
    Loading Keyboard module
    Traceback (most recent call last):
    -a File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 811, in <module>
    -a-a-a window = MainWindow()
    -a-a-a-a-a-a-a-a-a-a-a-a ^^^^^^^^^^^^
    -a File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 330, in __init__
    -a-a-a if self.load_sidepage_as_standalone():
    -a-a-a-a-a-a ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    -a File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 464, in load_sidepage_as_standalone
    -a-a-a self.go_to_sidepage(sp_data.sp, user_action=False)
    -a File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py",
    line 185, in go_to_sidepage
    -a-a-a sidePage.build()
    -a File "/usr/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py", line 212, in build
    -a-a-a self.module.on_module_selected()
    -a File "/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py", line 513, in on_module_selected
    -a-a-a _config = json.load(config_file)
    -a-a-a-a-a-a-a-a-a-a-a-a-a ^^^^^^^^^^^^^^^^^^^^^^

    It looks like it's trying to load a config file in JSON format...

    -a File "/usr/lib/python3.12/json/__init__.py", line 293, in load
    -a-a-a return loads(fp.read(),
    -a-a-a-a-a-a-a-a-a-a ^^^^^^^^^^^^^^^^
    -a File "/usr/lib/python3.12/json/__init__.py", line 346, in loads
    -a-a-a return _default_decoder.decode(s)
    -a-a-a-a-a-a-a-a-a-a ^^^^^^^^^^^^^^^^^^^^^^^^^^
    -a File "/usr/lib/python3.12/json/decoder.py", line 337, in decode
    -a-a-a obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    -a-a-a-a-a-a-a-a-a-a-a-a-a-a ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    -a File "/usr/lib/python3.12/json/decoder.py", line 355, in raw_decode
    -a-a-a raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    ...but the file isn't valid JSON (perhaps corrupted or an incorrect
    attempt at manually editing).

    I have no idea what I'm looking at here. I see an error in the last
    line, but have no clue what to do about it.

    From looking at `/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py` on my
    system (Mint 22.1), it's basically loading config files in JSON format
    from subdirectories of `~/.cinnamon/configs/` and
    `~/.config/cinnamon/spices/` [1]. It doesn't matter if one of those directories doesn't exist (I only have the second) but it'll search
    whichever ones do exist.

    One of those files is failing to load, but the exception trace doesn't indicate which one. If there's a file with a ".json" extension that's
    not valid JSON, it'll fail with something like what you're seeing.

    [1] It's actually bit more complicated than that, only actually looking
    in subdirectories corresponding to Cinnamon modules that are enabled in gsettings, and not necessarily attempting to load all the files, but if
    any are invalid it's potential for trouble.

    Tried upgrading to 22.2 hoping that would fix the issue, but it didn't.

    Also tried sudo apt install --reinstall cinnamon-control-center as
    suggested by an AI but that didn't help either.

    The config files are in your home directory, so reinstalling the package
    is unlikely to make any difference.

    Any ideas?

    The following Python code (adapted from the `cinnamon-settings` code I
    was looking at above) should identify any invalid JSON files in places
    that `cinnamon-settings` might look. Put the following code below,
    between the backticks but not including the backticks, in a new file,
    e.g. `/tmp/check-cinnamon-settings.py`:

    ```
    import json
    import os
    from pathlib import Path

    OLD_SETTINGS_DIR = Path.joinpath(Path.home(), ".cinnamon/configs/") SETTINGS_DIR = Path.joinpath(Path.home(), ".config/cinnamon/spices/")

    for settings_dir in (OLD_SETTINGS_DIR, SETTINGS_DIR):
    if not Path.exists(settings_dir):
    continue
    for spice in os.listdir(settings_dir):
    config_path = Path.joinpath(settings_dir, spice)
    for config in os.listdir(config_path):
    if not config.endswith(".json"):
    continue
    config_json = Path.joinpath(config_path, config)
    # print(f"Trying: {config_json}")
    with open(config_json, encoding="utf-8") as config_file:
    try:
    _config = json.load(config_file)
    except Exception as e:
    print(f"Invalid JSON: {config_json}")
    print(f" {type(e).__name__}: {e}")
    ```

    Then run `python3 /tmp/check-cinnamon-settings.py`. This should list
    any invalid JSON files, along with a message indicating where the
    problem is. For example:

    ```
    Invalid JSON: /home/mark/.config/cinnamon/spices/invalid@cinnamon.org/1.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    ```

    Unlike the stack trace from `cinnamon-settings` itself, this shows the
    name of the file that failed to load, and should also check all files
    rather than stopping at the first error.
    --
    Mark.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint on Sun Sep 7 18:46:01 2025
    From Newsgroup: alt.os.linux.mint

    Mark Bourne wrote:

    Unlike the stack trace from `cinnamon-settings` itself, this shows the
    name of the file that failed to load, and should also check all files
    rather than stopping at the first error.

    Thank you for that. I got the following result:

    Invalid JSON: /home/myname/.cinnamon/configs/favorites@cinnamon.org/9.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON: /home/myname/.cinnamon/configs/sound@cinnamon.org/sound@cinnamon.org.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON: /home/myname/.cinnamon/configs/notifications@cinnamon.org/notifications@cinnamon.org.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON: /home/myname/.cinnamon/configs/network@cinnamon.org/network@cinnamon.org.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON: /home/myname/.cinnamon/configs/menu@cinnamon.org/0.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON: /home/myname/.cinnamon/configs/power@cinnamon.org/power@cinnamon.org.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON: /home/myname/.cinnamon/configs/grouped-window-list@cinnamon.org/2.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON: /home/myname/.cinnamon/configs/calendar@cinnamon.org/13.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Invalid JSON:
    /home/myname/.cinnamon/configs/show-desktop@cinnamon.org/1.json
    JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    I looked at these files one by one. They are between a few hundreds
    bytes and a few kilobytes long. However, when I open them with a hex
    editor they are completely empty, they only contain zeroes.

    No idea why they are empty. I will try to install Mint in a virtual
    machine and see if I can copy these files.

    Thanks for the help.



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint on Sun Sep 7 21:55:29 2025
    From Newsgroup: alt.os.linux.mint

    Monsieur wrote:

    No idea why they are empty. I will try to install Mint in a virtual
    machine and see if I can copy these files.

    So I noticed that there are actually two locations for the config files:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    A bit confusing I think. Anyway, I noticed that the .json files were
    also in the first location and those were not empty. So I just copied
    those to the second location and overwrote the empty ones. Now the
    Keyboard menu opens without a problem.

    Strange that this happened on a completely fresh install on a completely
    new machine.












    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.os.linux.mint on Mon Sep 8 00:21:03 2025
    From Newsgroup: alt.os.linux.mint

    On Sun, 7 Sep 2025 21:55:29 +0200, Monsieur wrote:

    So I noticed that there are actually two locations for the config files:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    A bit confusing I think. Anyway, I noticed that the .json files were
    also in the first location and those were not empty. So I just copied
    those to the second location and overwrote the empty ones. Now the
    Keyboard menu opens without a problem.

    Were the bad files the same sizes as the corresponding good ones? (Just wondering ...)

    Slightly surprising that the second location was used in preference to the first one; I would have expected it to be the other way round.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint on Mon Sep 8 09:39:10 2025
    From Newsgroup: alt.os.linux.mint

    Lawrence DrCOOliveiro wrote:
    On Sun, 7 Sep 2025 21:55:29 +0200, Monsieur wrote:

    So I noticed that there are actually two locations for the config files:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    A bit confusing I think. Anyway, I noticed that the .json files were
    also in the first location and those were not empty. So I just copied
    those to the second location and overwrote the empty ones. Now the
    Keyboard menu opens without a problem.

    Were the bad files the same sizes as the corresponding good ones? (Just wondering ...)

    I did not compare the sizes, I just replaced the empty ones with the new files.


    Slightly surprising that the second location was used in preference to the first one; I would have expected it to be the other way round.

    Well, it might have had something to do with the fact that I completely rsync'ed my old home folder from Mint 21 to the new install (Mint 22), including the config files. I was advised here not to do that, but of
    course I didn't listen.
    Still it does not explain why the files had been emptied and filled with zeroes.

    Anyway, for now everything is working fine. I will try not to touch
    anything for a while.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Bourne@nntp.mbourne@spamgourmet.com to alt.os.linux.mint on Tue Sep 9 21:41:29 2025
    From Newsgroup: alt.os.linux.mint

    Monsieur wrote:
    Monsieur wrote:

    No idea why they are empty. I will try to install Mint in a virtual
    machine and see if I can copy these files.

    So I noticed that there are actually two locations for the config files:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    A bit confusing I think. Anyway, I noticed that the .json files were
    also in the first location and those were not empty. So I just copied
    those to the second location and overwrote the empty ones. Now the
    Keyboard menu opens without a problem.

    It looks like `~/.cinnamon/configs` is an "old" path for Cinnamon's
    settings files, with `~/.config/cinnamon/` being the "new" path (the `OLD_SETTINGS_DIR` and `SETTINGS_DIR` names in my script are copied
    straight from `cinnamon-settings` itself). You could probably just
    delete the now-duplicates from under `~/.cinnamon/configs` (or move to somewhere else and see how things go for a while before deleting, in
    case I'm wrong about that). I don't even have a `~/.cinnamon/`
    directory on my Mint 22.1 Cinnamon system, having been set up as a fresh installation and only selectively copied config files that I knew I
    wanted to keep from the previous version.

    The code in `cinnamon-settings` will load all files under both of those directories, with settings loaded from `~/.config/cinnamon/` taking
    precedence if both define the same settings, so there doesn't seem to be
    any advantage in having the same in both places. But, because it tries
    to load all the files, it'll fail if any are corrupt.

    Strange that this happened on a completely fresh install on a completely
    new machine.

    From other posts it sounds like you copied your home directory across
    from an old machine, but it's still strange. All I can think is that
    either something went wrong when copying, or perhaps the files were
    already corrupt on the old machine but the version of
    `cinnamon-settings` there either didn't look in that directory or was
    more tolerant of the errors.
    --
    Mark.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.os.linux.mint on Wed Sep 10 01:03:58 2025
    From Newsgroup: alt.os.linux.mint

    On Tue, 9 Sep 2025 21:41:29 +0100, Mark Bourne wrote:

    Monsieur wrote:

    So I noticed that there are actually two locations for the config
    files:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    A bit confusing I think. Anyway, I noticed that the .json files were
    also in the first location and those were not empty. So I just copied
    those to the second location and overwrote the empty ones. Now the
    Keyboard menu opens without a problem.

    It looks like `~/.cinnamon/configs` is an "old" path for Cinnamon's
    settings files, with `~/.config/cinnamon/` being the "new" path ...

    You would think so, yet he clearly says he copied the files in the other direction.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint on Wed Sep 10 10:46:52 2025
    From Newsgroup: alt.os.linux.mint

    Mark Bourne wrote:

    It looks like `~/.cinnamon/configs` is an "old" path for Cinnamon's
    settings files, with `~/.config/cinnamon/` being the "new" path (the `OLD_SETTINGS_DIR` and `SETTINGS_DIR` names in my script are copied
    straight from `cinnamon-settings` itself).-a You could probably just
    delete the now-duplicates from under `~/.cinnamon/configs` (or move to somewhere else and see how things go for a while before deleting, in
    case I'm wrong about that).-a I don't even have a `~/.cinnamon/`
    directory on my Mint 22.1 Cinnamon system, having been set up as a fresh installation and only selectively copied config files that I knew I
    wanted to keep from the previous version.

    I have now deleted the entire ./cinnamon/ folder and everything still
    works, so it appears it is no longer needed.

    The code in `cinnamon-settings` will load all files under both of those directories, with settings loaded from `~/.config/cinnamon/` taking precedence if both define the same settings, so there doesn't seem to be
    any advantage in having the same in both places.-a But, because it tries
    to load all the files, it'll fail if any are corrupt.


    Strange that this happened on a completely fresh install on a
    completely new machine.

    From other posts it sounds like you copied your home directory across
    from an old machine, but it's still strange.-a All I can think is that either something went wrong when copying, or perhaps the files were
    already corrupt on the old machine but the version of
    `cinnamon-settings` there either didn't look in that directory or was
    more tolerant of the errors.

    I have no explanation either. The strangest part is that the files were correctly copied but obviously couldn't be read because they were empty.
    Who or what wiped the contents I have no idea.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint on Wed Sep 10 10:47:08 2025
    From Newsgroup: alt.os.linux.mint

    Lawrence DrCOOliveiro wrote:
    On Tue, 9 Sep 2025 21:41:29 +0100, Mark Bourne wrote:

    Monsieur wrote:

    So I noticed that there are actually two locations for the config
    files:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    A bit confusing I think. Anyway, I noticed that the .json files were
    also in the first location and those were not empty. So I just copied
    those to the second location and overwrote the empty ones. Now the
    Keyboard menu opens without a problem.

    It looks like `~/.cinnamon/configs` is an "old" path for Cinnamon's
    settings files, with `~/.config/cinnamon/` being the "new" path ...

    You would think so, yet he clearly says he copied the files in the other direction.

    Yes I did. The files in .config/cinnamon were there, but empty. Only
    when I replaced them with the ones from the old ./cinnamon/configs did everything work again.

    I have no idea what went wrong.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to alt.os.linux.mint on Thu Sep 11 00:14:00 2025
    From Newsgroup: alt.os.linux.mint

    On Wed, 10 Sep 2025 10:47:08 +0200, Monsieur wrote:

    The files in .config/cinnamon were there, but empty. Only when I
    replaced them with the ones from the old ./cinnamon/configs did
    everything work again.

    ThatrCOs the logical direction we would expect, but itrCOs the opposite of what you said before:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    Anyway, I noticed that the .json files were also in the first
    location and those were not empty. So I just copied those to the
    second location and overwrote the empty ones.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Monsieur@Monsieur@notreal.invalid to alt.os.linux.mint on Thu Sep 11 17:54:13 2025
    From Newsgroup: alt.os.linux.mint

    Lawrence DrCOOliveiro wrote:
    On Wed, 10 Sep 2025 10:47:08 +0200, Monsieur wrote:

    The files in .config/cinnamon were there, but empty. Only when I
    replaced them with the ones from the old ./cinnamon/configs did
    everything work again.

    ThatrCOs the logical direction we would expect, but itrCOs the opposite of what you said before:

    - home/.config/cinnamon/
    - home/.cinnamon/configs

    Anyway, I noticed that the .json files were also in the first
    location and those were not empty. So I just copied those to the
    second location and overwrote the empty ones.

    Jeez. I remember re-reading that sentence before posting to make sure I
    didn't mix the locations up, and yet I still got them mixed up.

    Sorry about that.

    --- Synchronet 3.21a-Linux NewsLink 1.2