-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use keyboard configuration from Gnome Shell live #4976
Merged
jkonecny12
merged 7 commits into
rhinstaller:master
from
jkonecny12:master-install-keyboard-layout-from-Gnome-Shell
Aug 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
21fbce0
Extract liveuser data from help to generic tooling
jkonecny12 d1b6645
Add execWithCaptureAsLiveUser to run as liveuser
jkonecny12 a915755
Fix typo in the LocalizationInterface docstring
jkonecny12 b8d4dbf
Move get_missing_keyboard_configuration method
jkonecny12 5dc8832
Add live environment keyboard settings support
jkonecny12 696f1f5
Add support for virtual console keymap from live
jkonecny12 a9ecfc4
Add realease notes for keyboard from live system
jkonecny12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move get_missing_keyboard_configuration method
This method is not directly bound to localed and will be enhanced to also take into account Live system configuration. So let's move it first.
- Loading branch information
commit b8d4dbff1089ccf0b2ec0f19a72e6a747b6465f6
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# Copyright (C) 2023 Red Hat, Inc. | ||
# | ||
# This copyrighted material is made available to anyone wishing to use, | ||
# modify, copy, or redistribute it subject to the terms and conditions of | ||
# the GNU General Public License v.2, or (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY expressed or implied, including the implied warranties of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. You should have received a copy of the | ||
# GNU General Public License along with this program; if not, write to the | ||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
# source code or documentation are not subject to the GNU General Public | ||
# License and may only be used or replicated with the express permission of | ||
# Red Hat, Inc. | ||
# | ||
from pyanaconda.core.constants import DEFAULT_KEYBOARD | ||
|
||
from pyanaconda.anaconda_loggers import get_module_logger | ||
log = get_module_logger(__name__) | ||
|
||
|
||
def get_missing_keyboard_configuration(localed_wrapper, x_layouts, vc_keymap): | ||
"""Get missing keyboard settings by conversion and default values. | ||
|
||
:param localed_wrapper: instance of systemd-localed service wrapper | ||
:type localed_wrapper: LocaledWrapper | ||
:param x_layouts: list of X layout specifications | ||
:type x_layouts: list(str) | ||
:param vc_keymap: virtual console keyboard mapping name | ||
:type vc_keymap: str | ||
:returns: tuple of X layouts and VC keyboard settings | ||
:rtype: (list(str), str)) | ||
""" | ||
if not vc_keymap and not x_layouts: | ||
log.debug("Using default value %s for missing virtual console keymap", DEFAULT_KEYBOARD) | ||
vc_keymap = DEFAULT_KEYBOARD | ||
|
||
if not vc_keymap: | ||
vc_keymap = localed_wrapper.convert_layouts(x_layouts) | ||
log.debug("Missing virtual console keymap value %s converted from %s X layouts", | ||
vc_keymap, x_layouts) | ||
if not x_layouts: | ||
x_layouts = localed_wrapper.convert_keymap(vc_keymap) | ||
log.debug("Missing X layouts value %s converted from %s virtual console keymap", | ||
x_layouts, vc_keymap) | ||
|
||
return x_layouts, vc_keymap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is missing some context what we are trying to accomplish and how. Why is the keyboard configuration missing & how are we going to get se settings (conversion of what ? where do the default values come from ?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, the original code was so confusing because it was just about conversion but no word about defaults. I tried to improve the state but not that successful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is greatly improved in the last commit change.