Method and system for quickly logging in user desktop environment under Linux system
By loading the desktop environment at the same time when the user enters the password in the Linux system, the problem of users waiting for the desktop to load in the existing technology is solved, and the user's desktop environment is quickly logged in and the user experience is improved.
Patent Information
- Application Number
- CN202411728238.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
AI Technical Summary
In Linux environment, the existing login method requires the user to wait for a certain period of time before entering the desktop environment after entering the password, resulting in poor user experience.
By loading the desktop environment at the same time when the user enters the password, using a custom login interface instead of the login interface entered normally by booting, and loading the desktop environment through the desktop display manager, so that the user can directly enter the loaded desktop environment after entering the password.
It significantly improves the speed of users entering the desktop after entering the password, ensuring better user experience and satisfaction.
Smart Images

Figure CN119668700A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Linux operating system, and in particular to a method and system for quickly logging into a user desktop environment under a Linux system. Background Art
[0002] With the continuous improvement and optimization of the Linux operating system, the system is widely used in various industries. my country has also increased its investment to promote the rapid development of domestic operating systems based on the Linux system. The use of domestic operating systems on PCs and tablets is becoming more and more common, and the desktop environment is becoming more and more diverse and intelligent. In the Linux environment, the requirements for the system startup speed and the speed of entering the desktop after entering the password are also getting higher and higher.
[0003] In the Linux environment, the existing login method is to enter the password on the login interface first, and then start the desktop environment after the password is verified. After entering the password, it takes a certain amount of time for the desktop environment to start, which reduces the user experience. Therefore, it is urgent to provide a new solution to load the desktop environment during the password input process, so as to quickly enter the desktop and improve the overall experience of the user login process. Summary of the invention
[0004] The technical problem to be solved by the present invention is as follows: In view of the above-mentioned problems in the prior art, a method and system for quickly logging into a user desktop environment under a Linux system with fast response speed, short waiting time and good user experience is provided, so that the desktop environment can be loaded during the user password input process, thereby improving the speed of entering the desktop and enhancing the user experience and satisfaction.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: A method for quickly logging into a user desktop environment under a Linux system, comprising: Step S1: When the user starts the Linux system to log in, determine whether the current Linux system and the current logged-in user meet the quick login conditions; Step S2: If the current Linux system and the current logged-in user both meet the quick login conditions, the custom login interface is first started when logging in for the user to enter the password, and the desktop environment is loaded at the same time, so that the user enters the loaded desktop environment directly after entering the password.
[0006] Furthermore, in step S1, when the user starts the Linux system to log in, the Linux system performs the following operations: Start a desktop display manager and a login interface process. The desktop display manager is used for the desktop environment graphic display management of the Linux system. The login interface process saves the current logged-in user name to a configuration file when the user logs in, and sets the current logged-in user as the system default login user.
[0007] Furthermore, in step S1, judging whether the current Linux system and the current logged-in user meet the quick login condition includes: Reading a configuration file, the configuration file storing all user names that have logged into the local system, and judging whether the user name meets a first condition according to the user name of the last login in the configuration file, the first condition including that it is not the first login, manual user name input login is not enabled, and automatic login is not enabled; Obtaining current Linux system information and determining whether a second condition is met, wherein the second condition includes that the current Linux system is not a cloud environment and the current Linux system supports quick login; If it is determined that the first condition and the second condition are met at the same time, the quick login condition is met.
[0008] Further, step S2 includes: Step S21: modify the login process of the currently logged-in user, skip the native login interface and user authentication process of the currently logged-in user, and mark the user authentication result as successful; Step S22: calling a lock screen program, wherein the lock screen program starts a custom login interface for the user to enter a password, and simultaneously starts a window covering all other system interfaces except the custom login interface; Step S23: After calling the lock screen program, the desktop environment is loaded through the desktop display manager, so that the user can directly enter the loaded desktop environment after entering the password.
[0009] Furthermore, the step S22 includes: The lock screen program is launched by calling ukui-screensaver-dialog --lock, and the lock screen program starts a custom login interface for the user to enter a password; A background window is pulled up by calling screensaver-focus-helper, and the background window is displayed under the custom login interface and above any other windows and interfaces of the system.
[0010] Furthermore, the step S23 includes: Within a preset time after calling the lock screen program, the configuration of the user's desktop environment is read to obtain a startup command for the desktop environment, and the startup command is called through the lightdm desktop display manager to complete the loading of the desktop environment.
[0011] Further, if it is determined that the quick login condition is not met, one of the following steps is performed according to the quick login condition not being met: If it is determined that the current user is logging in for the first time or the user manually enters the username to log in, the login interface is started, and the user enters the username and password for authentication on the login interface. After the authentication is completed, the desktop environment is loaded to complete the login; If the current user has enabled automatic login, the login interface and user authentication are skipped, the user authentication result is directly marked as successful, the desktop environment is loaded, and the login is completed.
[0012] The present invention also provides a system for quickly logging into a user desktop environment under a Linux system, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the method for quickly logging into a user desktop environment under a Linux system.
[0013] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be programmed or configured by a microprocessor to execute the method for quickly logging into a user desktop environment under the Linux system.
[0014] The present invention also provides a computer program product, including a computer program / instruction, wherein the computer program / instruction is programmed or configured to execute the method for quickly logging into a user desktop environment under the Linux system through a processor.
[0015] Compared with the prior art, the advantages of the present invention are: The present invention replaces the normal login interface entered during startup with a customized login interface, and loads the user desktop environment when the customized login interface is started, so that the user can directly enter the desktop after entering the password without waiting for the loading process of the desktop environment, thereby improving the speed at which the user enters the desktop after entering the password, ensuring a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The present invention is a flowchart of a method for quickly logging into a user desktop environment under a Linux system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0018] like Figure 1 As shown, an embodiment of the present invention provides a method for quickly logging into a user desktop environment under a Linux system, comprising: Step S1: When the user starts the Linux system to log in, determine whether the current Linux system and the current logged-in user meet the quick login conditions; Step S2: If the current Linux system and the current logged-in user both meet the quick login conditions, the custom login interface is first started when logging in for the user to enter the password, and the desktop environment is loaded at the same time, so that the user enters the loaded desktop environment directly after entering the password.
[0019] It can be understood that this embodiment uses a custom login interface instead of the normal login interface entered upon startup, and loads the user desktop environment when the custom login interface is started, so that the user can directly enter the desktop after entering the password without waiting for the desktop environment to load, thereby improving the speed at which the user enters the desktop after entering the password and ensuring a better user experience.
[0020] In step S1 of this embodiment, when the user starts the Linux system to log in, the Linux system performs the following operations: Start the desktop display manager and login interface process. The desktop display manager is used for the graphical display management of the Linux system's desktop environment. The login interface process saves the currently logged-in user name to the configuration file when the user logs in, and sets the currently logged-in user as the system's default login user.
[0021] Specifically, confirm that lightdm (desktop display manager), ukui-greeter (login interface process manager) and ukui-screensaver (lock screen program) are installed in the system. Each time the system is powered on, the user login operation is performed normally. After the user successfully logs in, ukui-greeter records the current logged-in user name in the configuration file in the home directory of the lightdm user where the system's native login interface is located.
[0022] In step S1 of this embodiment, judging whether the current Linux system and the current logged-in user meet the quick login condition includes: Reading a configuration file, the configuration file stores all user names that have logged into the local system, and judging whether the user name meets the first condition according to the user name of the last login in the configuration file, the first condition includes that it is not the first login, manual user name input login is not enabled, and automatic login is not enabled; Obtain the current Linux system information and determine whether the second condition is met, where the second condition includes that the current Linux system is not a cloud environment and the current Linux system supports fast login; If it is determined that both the first condition and the second condition are met, the quick login condition is met.
[0023] Specifically, before executing the method for quickly logging into a user desktop environment of this embodiment, it is necessary to first determine whether the execution conditions are met, as follows: Obtain system information to determine whether the current environment is a cloud environment. If it is a cloud environment, do not use the method of quickly logging into the user desktop environment. Obtain system information to determine whether the system supports automatic login and whether it supports early desktop startup. If not, do not use the method of quickly logging into the user desktop environment. Get the last logged-in user name before shutdown, and determine whether the user name exists. If it does not exist, do not use the method of quickly logging into the user's desktop environment. Get system information to determine whether the manual user name input login configuration is currently enabled. If the user name is manually input for login, the method of quickly logging into the user desktop environment is not used; Obtain system information to determine whether automatic login is currently configured. If automatic login is configured, do not use the method of quickly logging into the user desktop environment. Get the last recorded user name. If the user name is incorrect, do not use the method of quickly logging into the user's desktop environment. If the system is not a cloud desktop, the user has logged in once, the manual user name input login method is not enabled, and the automatic login method is not enabled, the Linux quick login user desktop environment method is continued.
[0024] In this embodiment, step S2 includes: Step S21: modify the login process of the currently logged-in user, skip the native login interface and user authentication process of the currently logged-in user, and mark the user authentication result as successful; Step S22: calling the lock screen program, the lock screen program starts a custom login interface for the user to enter a password, and at the same time starts a window covering all other system interfaces except the custom login interface; Step S23: After calling the lock screen program, the desktop environment is loaded through the desktop display manager, so that the user can directly enter the loaded desktop environment after entering the password.
[0025] In this embodiment, step S22 includes: Call ukui-screensaver-dialog --lock to pull up the lock screen program, which starts the custom login interface for the user to enter the password; By calling screensaver-focus-helper, a background window is pulled up. The background window is displayed under the custom login interface and above any other windows and interfaces of the system.
[0026] In this embodiment, step S23 includes: Within a preset time after calling the lock screen program, the configuration of the user's desktop environment is read to obtain the startup command of the desktop environment, and the startup command is called through the lightdm desktop display manager to complete the loading of the desktop environment.
[0027] Specifically, when all conditions for quickly logging into the user desktop environment are met, the specific steps for quickly logging into the user desktop environment are as follows: ① Read the user name recorded in the configuration file. This user name is the user who logged in last time, so it is also predicted to be the user who wants to log in next time.
[0028] ②If the user corresponding to the username exists (the user read from the configuration file may not exist, for example, a user has logged in before and stored in the configuration file, and then deleted the user. In this way, the user will still be read from the configuration file next time, but because the user has been deleted, the login will fail, so it is necessary to determine whether the username exists), then modify the normal login process of the user. The process of the quick login method to the user desktop environment is: 1. Skip the native login interface and user authentication process. 2. Mark the user authentication result as successful. 3. Pull up the custom login interface as the user. 4. Pull up the desktop session.
[0029] ③Call the save-param command to pass in the user name. The save-param command will synchronize the corresponding user's display parameters, such as resolution, etc., to prepare for the subsequent loading of the lock screen program and desktop environment.
[0030] ④Asynchronously call the lock screen program. Configure and implement a screensaver-startup.sh script command and put it into the system. When the lock screen is called at startup, the command will be executed. The command will pull up a lock screen program by calling ukui-screensaver-dialog--lock and pull up a black background window by calling screensaver-focus-helper. The lock screen program is provided to the user as a custom login interface. Enter the password to enter the desktop. The black background window is displayed under the lock screen window. When the custom login interface is still in the startup process, the black background is used to cover the content under the custom login interface.
[0031] ⑤ One second after the lock screen program is called, lightdm starts to pull up the desktop environment, including the desktop, taskbar and other programs. The method for lightdm to pull up the desktop environment is to read the configuration of the user's desktop environment and then get the command to start the desktop environment, and one second after executing the / usr / bin / screensaver-starup.sh script, it synchronously calls the startup command of the desktop environment related programs. At this time, because the custom login interface provided by the lock screen program is displayed at the forefront, the loading of programs such as the desktop and taskbar is under the custom login interface, and the user will not perceive this process. In addition, because the custom login interface is pulled up, for the user, the login process is the same as the normal login process, that is, first turn on the computer, wait until the login interface is displayed, and then enter the password to log in. But the difference is that in the normal login process, the desktop environment starts to load after the user enters the password. Therefore, after the user enters the password to log in, he will see a few seconds of desktop loading effect instead of directly seeing the desktop. The method of quickly logging into the user's desktop environment uses a custom login interface to replace the system's native login interface (the native login interface is the authentication interface provided to the user to enter the user name and password when the system starts). After marking the user authentication result as successful, the system background has actually started loading the desktop environment, and at this time the user sees the custom login interface loaded by the lock screen program. Lightdm pulls up the desktop environment before the user enters the password, so when the user enters the password to log in, the desktop can be seen directly, thus achieving the effect of the user quickly seeing the desktop after logging in. It can be understood that in the process of pulling up the desktop session, the custom login interface is displayed on the desktop by setting it to always be on top. For the user, only the custom login interface can be seen; when the user enters the password to log in during the desktop loading process, the desktop can be seen directly after logging in, thereby achieving fast login and ensuring a good user experience.
[0032] In this embodiment, if it is determined that the quick login condition is not met, one of the following steps is performed according to the quick login condition not being met: If it is determined that the current user is logging in for the first time or the user manually enters the username to log in, the login interface is started, and the user enters the username and password for authentication on the login interface. After the authentication is completed, the desktop environment is loaded to complete the login; If the current user has enabled automatic login, the login interface and user authentication are skipped, the user authentication result is directly marked as successful, the desktop environment is loaded, and the login is completed.
[0033] Specifically, the above two conditions that do not meet the quick login correspond to the normal login process and the automatic login process, respectively. When the quick login is not met, the login is performed according to the normal login process and the automatic login process of the Linux system. The normal login process is: 1. The system starts the native login interface; 2. The user enters the username and password in the native login interface for authentication; 3. After the authentication is completed, the desktop session is pulled up, including desktop programs, taskbars, etc. The automatic login process is: 1. Skip the native login interface and user authentication. 2. The user authentication result is directly marked as successful, and then the desktop session is pulled up, including desktop programs, taskbars, etc. It should be noted that when other conditions are met but automatic login is turned on, the method of quickly logging into the user desktop environment of this embodiment can also be used. The specific operation is to cancel the automatic login mode set by the user through scripts, etc., and set the login process to manually enter the password to log in. The method of quickly logging into the user desktop environment can be used to load the desktop environment while the user enters the password.
[0034] The present invention also provides a system for quickly logging into a user desktop environment under a Linux system, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the method for quickly logging into a user desktop environment under a Linux system.
[0035] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be programmed or configured by a microprocessor to execute the method for quickly logging into a user desktop environment under the Linux system.
[0036] The present invention also provides a computer program product, including a computer program / instruction, wherein the computer program / instruction is programmed or configured to execute the method for quickly logging into a user desktop environment under the Linux system through a processor.
[0037] The system, medium and product of the present invention correspond to the above method and also have the advantages described in the above method.
[0038] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. The memory is used to store computer programs and / or modules. The processor implements various functions by running or executing computer programs and / or modules stored in the memory, and calling data stored in the memory. The memory may include a high-speed random access memory and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0039] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for quickly logging into a user desktop environment under a Linux system, characterized in that: include: Step S1: When the user starts the Linux system to log in, determine whether the current Linux system and the current logged-in user meet the quick login conditions; Step S2: If the current Linux system and the current logged-in user both meet the quick login conditions, the custom login interface is first started when logging in for the user to enter the password, and the desktop environment is loaded at the same time, so that the user enters the loaded desktop environment directly after entering the password.
2. The method for quickly logging into a user desktop environment under a Linux system according to claim 1, characterized in that: In step S1, when the user starts the Linux system to log in, the Linux system performs the following operations: Start a desktop display manager and a login interface process. The desktop display manager is used for the desktop environment graphic display management of the Linux system. The login interface process saves the current logged-in user name to a configuration file when the user logs in, and sets the current logged-in user as the system default login user.
3. The method for quickly logging into a user desktop environment under a Linux system according to claim 1, characterized in that: In step S1, judging whether the current Linux system and the current logged-in user meet the quick login condition includes: Reading a configuration file, the configuration file storing all user names that have logged into the local system, and judging whether the user name meets a first condition according to the user name of the last login in the configuration file, the first condition including that it is not the first login, manual user name input login is not enabled, and automatic login is not enabled; Obtaining current Linux system information and determining whether a second condition is met, wherein the second condition includes that the current Linux system is not a cloud environment and the current Linux system supports fast login; If it is determined that the first condition and the second condition are met at the same time, the quick login condition is met.
4. The method for quickly logging into a user desktop environment under a Linux system according to claim 1, characterized in that: Step S2 includes: Step S21: modify the login process of the currently logged-in user, skip the native login interface and user authentication process of the currently logged-in user, and mark the user authentication result as successful; Step S22: calling a lock screen program, wherein the lock screen program starts a custom login interface for the user to enter a password, and simultaneously starts a window covering all other system interfaces except the custom login interface; Step S23: After calling the lock screen program, the desktop environment is loaded through the desktop display manager, so that the user can directly enter the loaded desktop environment after entering the password.
5. The method for quickly logging into a user desktop environment under a Linux system according to claim 4, characterized in that: The step S22 comprises: The lock screen program is launched by calling ukui-screensaver-dialog --lock, and the lock screen program starts a custom login interface for the user to enter a password; A background window is pulled up by calling screensaver-focus-helper, and the background window is displayed under the custom login interface and above any other windows and interfaces of the system.
6. The method for quickly logging into a user desktop environment under a Linux system according to claim 4, characterized in that: The step S23 comprises: Within a preset time after calling the lock screen program, the configuration of the user's desktop environment is read to obtain a startup command for the desktop environment, and the startup command is called through the lightdm desktop display manager to complete the loading of the desktop environment.
7. The method for quickly logging into a user desktop environment under a Linux system according to claim 1, characterized in that: If it is determined that the quick login condition is not met, perform one of the following steps according to the quick login condition: If it is determined that the current user is logging in for the first time or the user manually enters the username to log in, the login interface is started, and the user enters the username and password for authentication on the login interface. After the authentication is completed, the desktop environment is loaded to complete the login; If the current user has enabled automatic login, the login interface and user authentication are skipped, the user authentication result is directly marked as successful, the desktop environment is loaded, and the login is completed.
8. A system for quickly logging into a user desktop environment under a Linux system, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the method for quickly logging into a user desktop environment under a Linux system as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored therein, characterized in that: The computer program is used to be programmed or configured by a microprocessor to execute the method for quickly logging into a user desktop environment under a Linux system as described in any one of claims 1 to 7.
10. A computer program product comprising a computer program / instructions, characterized in that The computer program / instruction is programmed or configured to execute the method for quickly logging into a user desktop environment under a Linux system as described in any one of claims 1 to 7 through a processor.