# Setting up Ubuntu 24.04 after installation


{{% param description %}}

<!--more-->

## Configuring Keyboard Layout Switching with Alt-Shift on Ubuntu 24.04 in Wayland

Unfortunately, the built-in input window for switching layouts does not allow the commonly used combinations 
**Alt-Shift** or **Ctrl-Shift**. To configure these layout switching combinations in Wayland, you can use 
the following commands:

```shell
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Alt>Shift_L']"
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['<Shift>Alt_L']"
```

Add an indicator for the layout on the keyboard using the **Scroll Lock** indicator.

```shell
gsettings set org.gnome.desktop.input-sources xkb-options "['grp_led:scroll', 'grp:alt_shift_toggle']"
```

By the way, this removes the on-screen layout switching indicator. If you want to revert it back to how it was, reset
this parameter:

```shell
gsettings reset org.gnome.desktop.input-sources xkb-options
gsettings get org.gnome.desktop.input-sources xkb-options
```

---

## Configuring the Number of Workspaces

Open **Settings/Multitasking** and switch to **Fixed number of workspaces**:

{{<image src="number-of-workspace-ru.webp">}}

---

## Configuring Hotkeys for Switching Between Workspaces

Open **Settings/Keyboard/Shortcuts**:

{{<image src="keyboard-hotkeys-ru.webp">}}

Next, go to **Navigation/Switch to workspace 1** and assign the desired key combination:

{{<image src="workspace-hotkeys-ru.webp">}}

In this dialog, you can only assign combinations for four workspaces. If you need more, you can do it via the console:

```shell
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-10 "['<Alt>0']"
```

---

## How to Remove the Delay After Entering an Incorrect Password in Ubuntu?

In the file `/etc/pam.d/common-auth`, you need to add the `nodelay` option. This will remove the delay between incorrect
passwords for both direct user login, through sudo, and via SSH connection.

```text
auth    [success=1 default=ignore]      pam_unix.so nullok nodelay
```

---

## Power Management When Closing the Laptop Lid

In the file `/etc/systemd/logind.conf`, look for the line `HandleLidSwitch=suspend`. By default, the `suspend` mode is
used. You can also use `hibernate`, `ignore`, and `poweroff`. Other modes can be found in
the [Documentation](https://www.freedesktop.org/software/systemd/man/latest/logind.conf.html). It is recommended to keep
the size of the swap file/partition no smaller than the size of the RAM, although hibernation will work in many cases
even with a smaller size.

You can turn on or wake up the computer over the network using [WOL]({{< relref "wake-on-lan" >}}).

