diff options
author | Victor Fuentes <vmfuentes64@gmail.com> | 2022-05-13 22:45:45 -0400 |
---|---|---|
committer | Victor Fuentes <vmfuentes64@gmail.com> | 2022-05-20 12:36:27 -0400 |
commit | 45afe309b7dcb1a18607f892aefac1e76f27c246 (patch) | |
tree | fa20d10aa4c3eecb433a1b910b36de26e57d989e /pkgs/tools | |
parent | 9af377e5ee2d90dfd4ad4fc885bbbd1a47ed985e (diff) |
calamares: fix keyboard on GNOME wayland
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/misc/calamares/default.nix | 5 | ||||
-rw-r--r-- | pkgs/tools/misc/calamares/waylandkbd.patch | 25 |
2 files changed, 29 insertions, 1 deletions
diff --git a/pkgs/tools/misc/calamares/default.nix b/pkgs/tools/misc/calamares/default.nix index e23471fc96d8..a73a2821cbf2 100644 --- a/pkgs/tools/misc/calamares/default.nix +++ b/pkgs/tools/misc/calamares/default.nix @@ -33,6 +33,9 @@ mkDerivation rec { ./uimod.patch # Remove options for unsupported partition types ./partitions.patch + # Fix setting the kayboard layout on GNOME wayland + # By default the module uses the setxkbmap, which will not change the keyboard + ./waylandkbd.patch ]; nativeBuildInputs = [ cmake extra-cmake-modules ]; @@ -57,7 +60,7 @@ mkDerivation rec { sed -e "s,pkexec calamares,calamares," \ -i calamares.desktop - sed -e "s,X-AppStream-Ignore=true,&\nStartupWMClass=io.calamares.calamares," \ + sed -e "s,X-AppStream-Ignore=true,&\nStartupWMClass=calamares," \ -i calamares.desktop # Fix desktop reference with wayland diff --git a/pkgs/tools/misc/calamares/waylandkbd.patch b/pkgs/tools/misc/calamares/waylandkbd.patch new file mode 100644 index 000000000000..37cddcf4e2af --- /dev/null +++ b/pkgs/tools/misc/calamares/waylandkbd.patch @@ -0,0 +1,25 @@ +diff --git a/src/modules/keyboard/Config.cpp b/src/modules/keyboard/Config.cpp +index 720588810..af0dd1c8d 100644 +--- a/src/modules/keyboard/Config.cpp ++++ b/src/modules/keyboard/Config.cpp +@@ -219,7 +219,10 @@ Config::xkbApply() + { m_additionalLayoutInfo.additionalVariant, m_selectedVariant }, + m_additionalLayoutInfo.groupSwitcher ) ); + +- ++ QString xkbmap = QString( "[('xkb','%1\%2'),('xkb','%3\%4')]").arg( ++ m_selectedLayout, ((!m_selectedVariant.isEmpty()) ? "+" + m_selectedVariant : ""), ++ m_additionalLayoutInfo.additionalLayout, ((!m_additionalLayoutInfo.additionalVariant.isEmpty()) ? "+" + m_additionalLayoutInfo.additionalVariant : "")); ++ QProcess::execute( "sh", { "-c", "if command -v gsettings; then gsettings set org.gnome.desktop.input-sources sources \"$0\"; fi", xkbmap }); + cDebug() << "xkbmap selection changed to: " << m_selectedLayout << '-' << m_selectedVariant << "(added " + << m_additionalLayoutInfo.additionalLayout << "-" << m_additionalLayoutInfo.additionalVariant + << " since current layout is not ASCII-capable)"; +@@ -227,6 +230,8 @@ Config::xkbApply() + else + { + QProcess::execute( "setxkbmap", xkbmap_layout_args( m_selectedLayout, m_selectedVariant ) ); ++ QString xkbmap = QString( "[('xkb','%1\%2')]").arg( m_selectedLayout, ((!m_selectedVariant.isEmpty()) ? "+" + m_selectedVariant : "") ); ++ QProcess::execute( "sh", { "-c", "if command -v gsettings; then gsettings set org.gnome.desktop.input-sources sources \"$0\"; fi", xkbmap }); + cDebug() << "xkbmap selection changed to: " << m_selectedLayout << '-' << m_selectedVariant; + } + m_setxkbmapTimer.disconnect( this ); |