Package Details: key-mon 1.20-3

Git Clone URL: https://aur.archlinux.org/key-mon.git (read-only, click to copy)
Package Base: key-mon
Description: A screencast utility that displays your keyboard and mouse status
Upstream URL: https://github.com/scottkirkwood/key-mon
Licenses: Apache
Submitter: None
Maintainer: lkrms
Last Packager: lkrms
Votes: 57
Popularity: 0.016393
First Submitted: 2009-12-16 06:15 (UTC)
Last Updated: 2024-05-17 01:50 (UTC)

Latest Comments

1 2 3 4 5 Next › Last »

Popolon commented on 2025-12-25 18:13 (UTC) (edited on 2025-12-25 18:15 (UTC) by Popolon)

key-mon doesn't work anymore, due to changes in python, SafeConfigParser() has been replaced by ConfigParser()

Solution (from the package sources):

git clone https://github.com/scottkirkwood/key-mon
cd key-mon
git diff 6e8dfaba5cfd2f0aa7cc3e66f47113ea0bb8423a >../ConfigParser.patch

add the file and checksum from (sha512sum ConfigParser.patch)

source=("${url}/archive/${pkgver}.tar.gz"
        'ConfigParser.patch')
sha512sums=('8f8ef0a1cad92d6bd6e3e954b7b6989e69153ade83a41362561eae2e546df6dc1e4165c4fbc47357d489ea8df7f24a1a52d2f72afa17482f04f509c0b8e4a4fd'
            '4c1f8072bbb97034de88a27eb196d82404458a6a9be415281e756013bde62b2f73be5df29b25047e7dbac5042896e486e99109cf7d7697ec612dc7029312e499')

Andd add this in the build() function, before python setup.py build:

    patch -Np1 -i ../ConfigParser.patch

This the content of the patch:

diff --git a/src/keymon/key_mon.py b/src/keymon/key_mon.py
index 9fa742e..f62ac99 100644
--- a/src/keymon/key_mon.py
+++ b/src/keymon/key_mon.py
@@ -48,7 +48,7 @@ gi.require_version("Gtk", "3.0")
 gi.require_foreign("cairo")
 from gi.repository import Gtk, GdkPixbuf, GObject, GLib

-from configparser import SafeConfigParser
+from configparser import ConfigParser

 gettext.install('key-mon', 'locale')

diff --git a/src/keymon/options.py b/src/keymon/options.py
index a44e90b..18c0184 100644
--- a/src/keymon/options.py
+++ b/src/keymon/options.py
@@ -317,8 +317,8 @@ class Options(object):
   def parse_ini(self, fp):
     """Parser an ini file from fp, which is file-like class."""

-    config = configparser.SafeConfigParser()
-    config.readfp(fp)
+    config = configparser.ConfigParser()
+    config.read_file(fp)
     checker = {}
     for opt in list(self._options.values()):
       if opt.ini_group:
@@ -337,7 +337,7 @@ class Options(object):
   def write_ini(self, fp):
     """Parser an ini file from fp, which is file-like class."""

-    config = configparser.SafeConfigParser()
+    config = configparser.ConfigParser()
     for opt in list(self._options.values()):
       if not opt.ini_group:
         continue
diff --git a/src/keymon/settings.py b/src/keymon/settings.py
index df09f68..00d5882 100644
--- a/src/keymon/settings.py
+++ b/src/keymon/settings.py
@@ -26,7 +26,7 @@ import gi
 gi.require_version("Gtk", "3.0")
 from gi.repository import Gtk, GObject

-from configparser import SafeConfigParser
+from configparser import ConfigParser

 LOG = logging.getLogger('settings')

@@ -347,7 +347,7 @@ def get_themes():
   for theme_dir in theme_dirs:
     for entry in sorted(os.listdir(theme_dir)):
       try:
-        parser = SafeConfigParser()
+        parser = ConfigParser()
         theme_config = os.path.join(theme_dir, entry, 'config')
         parser.read(theme_config)
         desc = parser.get('theme', 'description')

rafaelff commented on 2024-08-29 18:15 (UTC)

Also, namcap reports:

PKGBUILD (key-mon) W: Non-unique source name (1.20.tar.gz). Use a unique filename.

key-mon E: Apache is not a valid SPDX license identifier. See https://spdx.org/licenses/ for valid identifiers, or prefix the identifier with 'LicenseRef-', if it is custom.

rafaelff commented on 2024-08-29 18:14 (UTC)

To solve this issue, one can download the patch from the pull request #107 (https://github.com/scottkirkwood/key-mon/pull/107.patch) and apply to the source code.

Here is a diff from what is today and a PKGBUILD that works:

diff --git a/PKGBUILD b/PKGBUILD
index db6396b..ce9a44b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,8 +14,15 @@ arch=('any')
 license=('Apache')
 depends=('gtk3' 'python' 'python-cairo' 'python-gobject' 'python-xlib')
 makedepends=('python-setuptools')
-source=("${url}/archive/${pkgver}.tar.gz")
-sha512sums=('8f8ef0a1cad92d6bd6e3e954b7b6989e69153ade83a41362561eae2e546df6dc1e4165c4fbc47357d489ea8df7f24a1a52d2f72afa17482f04f509c0b8e4a4fd')
+source=("${url}/archive/${pkgver}.tar.gz"
+        "${url}/pull/107.patch")
+sha512sums=('8f8ef0a1cad92d6bd6e3e954b7b6989e69153ade83a41362561eae2e546df6dc1e4165c4fbc47357d489ea8df7f24a1a52d2f72afa17482f04f509c0b8e4a4fd'
+            'fb8a0431cf245ebe0a4ed1662af961222f1350cf42bae720d647eeae2e19537d6390e14ac0f1f1105a186ab9254b6153f0da85a84d2a0461ed4f166f7c861781')
+
+prepare() {
+    cd "${srcdir}/${pkgname}-${pkgver}"
+    patch -p1 -i ../107.patch
+}

 build() {
     cd "${srcdir}/${pkgname}-${pkgver}"

Retro_Gamer commented on 2024-08-29 17:57 (UTC)

Still not working here, can we get this fixed?

key-mon                                                                                                                                                                                                                     
Traceback (most recent call last):
  File "/usr/bin/key-mon", line 2, in <module>
    import keymon.key_mon as km
  File "/usr/lib/python3.12/site-packages/keymon/key_mon.py", line 41, in <module>
    from . import settings
  File "/usr/lib/python3.12/site-packages/keymon/settings.py", line 29, in <module>
    from configparser import SafeConfigParser
ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/usr/lib/python3.12/configparser.py). Did you mean: 'RawConfigParser'

rafaelff commented on 2024-08-03 06:54 (UTC)

Python 3.12 incompatibility was fixed after https://github.com/scottkirkwood/key-mon/issues/105 (see linked pull request), but not released. This patch would be nice to be included in here.

Minihawk commented on 2024-08-03 06:44 (UTC) (edited on 2024-08-03 06:47 (UTC) by Minihawk)

Does not work since some month

Thwows:


tutorius@pacoblitz ~]$ key-mon
Traceback (most recent call last):
  File "/usr/bin/key-mon", line 2, in <module>
    import keymon.key_mon as km
  File "/usr/lib/python3.12/site-packages/keymon/key_mon.py", line 41, in <module>
    from . import settings
  File "/usr/lib/python3.12/site-packages/keymon/settings.py", line 29, in <module>
    from configparser import SafeConfigParser
ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/usr/lib/python3.12/configparser.py). Did you mean: 'RawConfigParser'?

Any hints?

jose1711 commented on 2022-04-08 08:50 (UTC)

could you please fix this?

$ pacman -Qql key-mon | while read i; file $i; end | grep 'no read permission'
/usr/share/icons/hicolor/key-mon.png: regular file, no read permission
/usr/share/icons/hicolor/key-mon.svg: regular file, no read permission

thanks, j

lyoneel commented on 2022-02-28 13:36 (UTC)

Today I installed and do not work until I installed python2-gobject2

akovia commented on 2021-03-22 23:16 (UTC)

@Popolon Thank you very much!