Правильный файл ~/.xinitrc

Revision as of 07:30, 21 January 2023 by Krotesk (talk | contribs) (Created page with "Файл <code>~/.xinitrc</code> в вашем домашнем каталоге выполняется командой <code>startx</code>. В общем случае он...")
Other languages:
English • ‎русский

Эта страница является краткой версией оригинальной страницы Arch Wiki. За более подробной информацией обращайтесь туда.

Это только для опытных пользователей, которые умеют чинить сломанные системы и знают толк в терминалах.


Общие сведения

Файл ~/.xinitrc в вашем домашнем каталоге выполняется командой startx. В общем случае он используется для запуска среды рабочего стола.

Usually, your Display/Login Managercalls startx, but you can also start it manually when needed.

Файл ~/.xinitrc

The ~/.xinitrc file is located in your home directory and it is a hidden file. Here is an example of a default ~/.xinitrc file:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

# exec enlightenment_start
# exec i3
# exec mate-session
# exec xmonad
# exec startlxqt
# exec startlxde
# exec awesome
# exec bspwm
# exec gnome-session
# exec gnome-session --session=gnome-classic
# exec startplasma-x11
# exec startplasma-wayland
# exec startxfce4
# exec startfluxbox
# exec openbox-session
# exec cinnamon-session
# exec pekwm
# exec catwm
# exec dwm
# exec startede
# exec icewm-session
# exec jwm
# exec monsterwm
# exec notion
# exec startdde       # deepin-session

Remove the # symbol at the beginning of the code line belonging to your Desktop Environment (beginning with # exec) and save the ~/.xinitrc file.

Устранение неисправностей

If you are using the Net Edition of Manjaro or a Community Edition, it can happen that the your ~/.xinitrc file is missing parts or contains wrong code. In this case, your system will show error messages and it will refuse to boot your Desktop Environment. It is even possible that your system is caught in a loop, in which it constantly keeps trying to execute startx.

If this happens, get a tty by pressing CTRL + ALT + F2 (or any other funktion key - try all function keys from F1 to F7). When you have a tty, you can log into your system, Install Display Managers or edit your ~/.xinitrc file using nano or vim (this might has to be installed before you can use it).