cmc/cleberg.net
My personal web garden & blog.
clone: git clone https://gitbay.org/cmc/cleberg.net.git
main: content/blog/2022-10-30-linux-display-manager.org · raw
1#+date: [2022-10-30 Sun 00:00:00]
2#+title: Void Linux: Remove the Display Manager
3#+description: Disabling the display manager on Void Linux and starting i3 manually.
4#+slug: linux-display-manager
5#+filetags: :linux:
6
7* Display Manager Services
8
9In order to change the [[https://en.wikipedia.org/wiki/Display_manager][display manager]] on Void Linux - or any other Linux
10distribution - you need to identify the currently enabled display manager.
11
12** Disabling the Current Display Manager
13
14Void Linux only has one optical disc image (ISO) available for download with a
15pre-built display manager at the time of this post: the XFCE ISO. If you've
16installed this version, the pre-assigned display manager is =lxdm=. If you
17installed another display manager, replace =lxdm= in the following command with
18the display manager you have installed.
19
20To disable =lxdm=, simply remove the service symlink:
21
22#+begin_src sh
23sudo rm /var/service/lxdm
24#+end_src
25
26** Enabling a New Display Manager
27
28If you want to enable a new display manager, you can do so after =lxdm= is
29disabled. Make sure to replace =<new_display_manager>= with your new DM, such as
30=gdm=, =xdm=, etc.
31
32#+begin_src sh
33sudo ln -s /etc/sv/<new_display_manager> /var/service
34#+end_src
35
36* Set Up =.xinitrc=
37
38Depending on your setup, you may need to create a few X files, such as
39=~/.xinitrc=. For my personal set-up, I created this file to launch the i3wm as
40my desktop.
41
42#+begin_src sh
43nano ~/.xinitrc
44#+end_src
45
46#+begin_src sh
47#!/bin/sh
48
49exec i3
50#+end_src
51
52If you run a desktop other than i3, simply replace =i3= with the shell command
53that launches that desktop.
54
55* Set Up Your Shell Profile
56
57Finally, in order to automatically launch an X session upon login, you will need
58to edit the =.bash_profile= (bash) or =.zprofile= (zsh) files for your shell:
59
60#+begin_src sh
61nano ~/.zprofile
62#+end_src
63
64Add the following snippet to the end of the shell profile file. This will
65execute the =startx= command upon login.
66
67#+begin_src sh
68if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
69 exec startx
70fi
71#+end_src
72
73Alternatively, you can ignore this step and simply choose to manually execute
74=startx= upon login. This can be useful if you have issues with your desktop or
75like to manually launch different desktops by choice.