Implement sleep mode functionality for Cthulhu

Add application-specific sleep mode that disables speech and events while preserving the ability to toggle back to normal operation.

Features:
- Keybinding: Cthulhu+Ctrl+Alt+Shift+Q (matches Orca)
- Per-application scope (only affects focused app)
- Suppresses all speech, braille, and event processing
- Preserves sleep mode toggle keybinding for exit
- Status messages on enter/exit

Implementation:
- New sleepmode script module in src/cthulhu/scripts/sleepmode/
- Toggle handler in default.py using script manager
- Proper autotools integration with correct installation paths
- Build system fixes for module discovery

Files modified:
- src/cthulhu/common_keyboardmap.py: Add sleep mode keybinding
- src/cthulhu/scripts/default.py: Add toggleSleepMode handler
- src/cthulhu/scripts/sleepmode/: Complete sleep mode implementation
- CLAUDE.md: Documentation for build system and sleep mode
- Fix sleepmode/Makefile.am installation path

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Storm Dragon
2025-07-31 14:03:10 -04:00
parent 613fc514fb
commit 4d2561a293
23 changed files with 770 additions and 31 deletions

View File

@ -1,8 +1,10 @@
# build-to-host.m4 serial 3
dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
# build-to-host.m4
# serial 5
dnl Copyright (C) 2023-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file is offered as-is, without any warranty.
dnl Written by Bruno Haible.
@ -77,3 +79,196 @@ changequote([,])dnl
*) gl_tr_cr='\r' ;;
esac
])
dnl The following macros are convenience invocations of gl_BUILD_TO_HOST
dnl for some of the variables that are defined by Autoconf.
dnl To do so for _all_ the possible variables, use the module 'configmake'.
dnl Defines bindir_c and bindir_c_make.
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_BINDIR],
[
dnl Find the final value of bindir.
gl_saved_prefix="${prefix}"
gl_saved_exec_prefix="${exec_prefix}"
gl_saved_bindir="${bindir}"
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
exec_prefix='${prefix}'
fi
eval exec_prefix="$exec_prefix"
eval bindir="$bindir"
gl_BUILD_TO_HOST([bindir])
bindir="${gl_saved_bindir}"
exec_prefix="${gl_saved_exec_prefix}"
prefix="${gl_saved_prefix}"
])
dnl Defines datadir_c and datadir_c_make,
dnl where datadir = $(datarootdir)
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_DATADIR],
[
dnl Find the final value of datadir.
gl_saved_prefix="${prefix}"
gl_saved_datarootdir="${datarootdir}"
gl_saved_datadir="${datadir}"
dnl Unfortunately, prefix gets only finally determined at the end of
dnl configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
eval datarootdir="$datarootdir"
eval datadir="$datadir"
gl_BUILD_TO_HOST([datadir])
datadir="${gl_saved_datadir}"
datarootdir="${gl_saved_datarootdir}"
prefix="${gl_saved_prefix}"
])
dnl Defines libdir_c and libdir_c_make.
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LIBDIR],
[
dnl Find the final value of libdir.
gl_saved_prefix="${prefix}"
gl_saved_exec_prefix="${exec_prefix}"
gl_saved_libdir="${libdir}"
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
exec_prefix='${prefix}'
fi
eval exec_prefix="$exec_prefix"
eval libdir="$libdir"
gl_BUILD_TO_HOST([libdir])
libdir="${gl_saved_libdir}"
exec_prefix="${gl_saved_exec_prefix}"
prefix="${gl_saved_prefix}"
])
dnl Defines libexecdir_c and libexecdir_c_make.
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LIBEXECDIR],
[
dnl Find the final value of libexecdir.
gl_saved_prefix="${prefix}"
gl_saved_exec_prefix="${exec_prefix}"
gl_saved_libexecdir="${libexecdir}"
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
exec_prefix='${prefix}'
fi
eval exec_prefix="$exec_prefix"
eval libexecdir="$libexecdir"
gl_BUILD_TO_HOST([libexecdir])
libexecdir="${gl_saved_libexecdir}"
exec_prefix="${gl_saved_exec_prefix}"
prefix="${gl_saved_prefix}"
])
dnl Defines localedir_c and localedir_c_make.
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LOCALEDIR],
[
dnl Find the final value of localedir.
gl_saved_prefix="${prefix}"
gl_saved_datarootdir="${datarootdir}"
gl_saved_localedir="${localedir}"
dnl Unfortunately, prefix gets only finally determined at the end of
dnl configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
eval datarootdir="$datarootdir"
eval localedir="$localedir"
gl_BUILD_TO_HOST([localedir])
localedir="${gl_saved_localedir}"
datarootdir="${gl_saved_datarootdir}"
prefix="${gl_saved_prefix}"
])
dnl Defines pkgdatadir_c and pkgdatadir_c_make,
dnl where pkgdatadir = $(datadir)/$(PACKAGE)
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGDATADIR],
[
dnl Find the final value of pkgdatadir.
gl_saved_prefix="${prefix}"
gl_saved_datarootdir="${datarootdir}"
gl_saved_datadir="${datadir}"
gl_saved_pkgdatadir="${pkgdatadir}"
dnl Unfortunately, prefix gets only finally determined at the end of
dnl configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
eval datarootdir="$datarootdir"
eval datadir="$datadir"
eval pkgdatadir="$pkgdatadir"
gl_BUILD_TO_HOST([pkgdatadir])
pkgdatadir="${gl_saved_pkgdatadir}"
datadir="${gl_saved_datadir}"
datarootdir="${gl_saved_datarootdir}"
prefix="${gl_saved_prefix}"
])
dnl Defines pkglibdir_c and pkglibdir_c_make,
dnl where pkglibdir = $(libdir)/$(PACKAGE)
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBDIR],
[
dnl Find the final value of pkglibdir.
gl_saved_prefix="${prefix}"
gl_saved_exec_prefix="${exec_prefix}"
gl_saved_libdir="${libdir}"
gl_saved_pkglibdir="${pkglibdir}"
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
exec_prefix='${prefix}'
fi
eval exec_prefix="$exec_prefix"
eval libdir="$libdir"
eval pkglibdir="$pkglibdir"
gl_BUILD_TO_HOST([pkglibdir])
pkglibdir="${gl_saved_pkglibdir}"
libdir="${gl_saved_libdir}"
exec_prefix="${gl_saved_exec_prefix}"
prefix="${gl_saved_prefix}"
])
dnl Defines pkglibexecdir_c and pkglibexecdir_c_make,
dnl where pkglibexecdir = $(libexecdir)/$(PACKAGE)
AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBEXECDIR],
[
dnl Find the final value of pkglibexecdir.
gl_saved_prefix="${prefix}"
gl_saved_exec_prefix="${exec_prefix}"
gl_saved_libexecdir="${libexecdir}"
gl_saved_pkglibexecdir="${pkglibexecdir}"
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
prefix="$ac_default_prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
exec_prefix='${prefix}'
fi
eval exec_prefix="$exec_prefix"
eval libexecdir="$libexecdir"
eval pkglibexecdir="$pkglibexecdir"
gl_BUILD_TO_HOST([pkglibexecdir])
pkglibexecdir="${gl_saved_pkglibexecdir}"
libexecdir="${gl_saved_libexecdir}"
exec_prefix="${gl_saved_exec_prefix}"
prefix="${gl_saved_prefix}"
])

View File

@ -1,8 +1,10 @@
# host-cpu-c-abi.m4 serial 17
dnl Copyright (C) 2002-2024 Free Software Foundation, Inc.
# host-cpu-c-abi.m4
# serial 20
dnl Copyright (C) 2002-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file is offered as-is, without any warranty.
dnl From Bruno Haible and Sam Steingold.
@ -35,7 +37,7 @@ dnl * The same canonical name is used for different endiannesses. You can
dnl determine the endianness through preprocessor symbols:
dnl - 'arm': test __ARMEL__.
dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
dnl - 'powerpc64': test __BIG_ENDIAN__ vs. __LITTLE_ENDIAN__.
dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
@ -140,7 +142,7 @@ changequote([,])dnl
else
gl_cv_host_cpu_c_abi=arm
fi
rm -f conftest*
rm -fr conftest*
])
;;
@ -382,6 +384,9 @@ EOF
#ifndef __ia64__
#undef __ia64__
#endif
#ifndef __loongarch32__
#undef __loongarch32__
#endif
#ifndef __loongarch64__
#undef __loongarch64__
#endif
@ -501,9 +506,9 @@ changequote([,])dnl
if test -n "$gl_cv_host_cpu_c_abi"; then
dnl gl_HOST_CPU_C_ABI has already been run. Use its result.
case "$gl_cv_host_cpu_c_abi" in
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | loongarch32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
gl_cv_host_cpu_c_abi_32bit=yes ;;
x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | loongarch64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
gl_cv_host_cpu_c_abi_32bit=no ;;
*)
gl_cv_host_cpu_c_abi_32bit=unknown ;;