lightdm-mini-greeter
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
  100. 100
  101. 101
  102. 102
  103. 103
  104. 104
  105. 105
  106. 106
  107. 107
  108. 108
  109. 109
  110. 110
  111. 111
  112. 112
  113. 113
  114. 114
  115. 115
  116. 116
  117. 117
  118. 118
  119. 119
  120. 120
  121. 121
  122. 122
  123. 123
  124. 124
  125. 125
  126. 126
  127. 127
  128. 128
  129. 129
  130. 130
  131. 131
  132. 132
  133. 133
  134. 134
  135. 135
  136. 136
  137. 137
  138. 138
  139. 139
  140. 140
  141. 141
  142. 142
  143. 143
  144. 144
  145. 145
  146. 146
  147. 147
  148. 148
  149. 149
  150. 150
  151. 151
  152. 152
  153. 153
  154. 154
  155. 155
  156. 156
  157. 157
  158. 158
  159. 159
  160. 160
  161. 161
  162. 162
  163. 163
  164. 164
  165. 165
  166. 166
  167. 167
  168. 168
  169. 169
  170. 170
  171. 171
  172. 172
  173. 173
  174. 174
  175. 175
  176. 176
  177. 177
  178. 178
  179. 179
  180. 180
  181. 181
  182. 182
  183. 183
  184. 184
  185. 185
  186. 186
  187. 187
  188. 188
  189. 189
  190. 190
  191. 191
  192. 192
  193. 193
  194. 194
  195. 195
  196. 196
  197. 197
  198. 198
  199. 199
  200. 200
  201. 201
  202. 202
  203. 203
  204. 204
  205. 205
  206. 206
  207. 207
  208. 208
  209. 209
  210. 210
  211. 211
  212. 212
  213. 213
  214. 214
  215. 215
  216. 216
  217. 217
  218. 218
  219. 219
  220. 220
  221. 221
  222. 222
  223. 223
  224. 224
  225. 225
  226. 226
  227. 227
  228. 228
  229. 229
  230. 230
  231. 231
  232. 232
  233. 233
  234. 234
  235. 235
# Mini-Greeter

[![AUR package](https://repology.org/badge/version-for-repo/aur/lightdm-mini-greeter.svg)](https://aur.archlinux.org/packages/lightdm-mini-greeter) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/a1c58074072542be8ea60d1bf14863fc)](https://www.codacy.com/gh/prikhi/lightdm-mini-greeter/dashboard)

A minimal but highly configurable single-user GTK3 greeter for LightDM.

Inspired by the SLiM Display Manager & LightDM GTK3 Greeter.


## Goals

Eventually this is will present a more customizable interface:

* Randomized Background Wallpapers
* Configurable language/session info? (lightdm provides this already?)
* Handle GdkDisplay's `monitor-added` & `monitor-removed` signals

[Open Feature Requests](http://bugs.sleepanarchy.com/projects/mini-greeter/issues/)


## Current Status

Right now you can:

* log in
* hide the `Password:` label & customize the text
* hide the password input's cursor
* show the user, hostname, & current time
* set the password masking character
* set the size of the login window, the font, & every color
* set & scale a background image
* use modifiable hotkeys to cycle through sessions or trigger a shutdown,
  restart, hibernate, or suspend
* reposition window on the x or y axis

![A screen with a dark background and a single password input box in the center](https://raw.githubusercontent.com/prikhi/lightdm-mini-greeter/refs/heads/master/screenshot.png "Mini Greeter Screenshot")


## Install

### Arch Linux

Install the [lightdm-mini-greeter package][aur-package] from the Arch User
Repository:

```sh
yay -S lightdm-mini-greeter
```

### Gentoo Linux

Emerge the [lightdm-mini-greeter package][gentoo-package]:

```sh
emerge x11-misc/lightdm-mini-greeter
```

### NixOS

Enable & configure the greeter & default session in your `configuration.nix`:

```nix
{
    services.xserver = {
        enable = true;
        displayManager.lightdm.greeters.mini = {
            enable = true;
            user = "your-username";
            extraConfig = ''
                [greeter]
                show-password-label = false
                [greeter-theme]
                background-image = ""
            '';
        };
        # Optionally, set a default session
        windowManager = {
            default = "awesome";
            awesome.enable = true;
        };
    };
}
```

Then rebuild & switch your configuration with `nixos-rebuild switch`.

### Debian

Debian packages for the latest `stable` branch are available on the
[Releases][releases] page.

You can use `debhelper` to build the package yourself:

```sh
sudo apt-get install build-essential automake pkg-config fakeroot debhelper \
    liblightdm-gobject-dev libgtk-3-dev
cd lightdm-mini-greeter
fakeroot dh binary
sudo dpkg -i ../lightdm-mini-greeter_*.deb
```

Note: on Ubuntu, you need `liblightdm-gobject-1-dev` instead of
`liblightdm-gobject-dev`.

### Manual

You will need `automake`, `pkg-config`, `gtk+`, & `liblightdm-gobject` to build
the project.

Grab the source, build the greeter, & install it manually:

```sh
./autogen.sh
./configure --datadir /usr/share --bindir /usr/bin --sysconfdir /etc
make
sudo make install
```

Run `sudo make uninstall` to remove the greeter.


## Configure

Once installed, you should specify `lightdm-mini-greeter` as your
`greeter-session` in `/etc/lightdm/lightdm.conf`. If you have multiple Desktop
Environments or Window Managers installed, you can specify the default
selection by changing the `user-session` option as well(look in
`/usr/share/xsessions` for possible values).

Modify `/etc/lightdm/lightdm-mini-greeter.conf` to customize the greeter. At
the very least, you will need to set the `user`. All other settings are
optional & can be commented out or removed.

You can test it out using LightDM's `test-mode`:

    lightdm --test-mode -d

Or with `dm-tool`:

    dm-tool add-nested-seat

Note: If you've added a `background-image` it will appear in this preview, but
it may not appear during normal use if the file is not in directory which
lightdm has permission to read(like `/etc/lightdm/`). A symlink into this
location won't work.

### Keyboard layout

If your keyboard layout is loaded from your shell configuration files (`.bashrc`
for example) then it might not be possible to type certain characters after
installing lightdm-mini-greeter. You should consider modifying your
[Xorg keyboard configuration](https://wiki.archlinux.org/index.php/Xorg/Keyboard_configuration#Using_X_configuration_files).

For example for a french keyboard layout (azerty) you should edit/create
`/etc/X11/xorg.conf.d/00-keyboard.conf` with at least the following options:

```
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbModel" "pc104"
        Option "XkbLayout" "fr"
EndSection
```

### Config file in $HOME

You may wish to include your config file in their your home folder/dotfiles so
it is version controlled & easily transferable between systems. This is
possible, but on most systems, LightDM will not be able to read the
configuration file due to permission errors.

The proper way to handle this is to loosen the permissions on your home
directory a bit.

Start off by adding the `lightdm` user to your user's group:

    sudo usermod -aG $(whoami) lightdm

Allow your user group to read your home directory:

    chmod g+rx ~

Move the mini-greeter config file:

    sudo mv /etc/lightdm/lightdm-mini-greeter.conf ~/.dotfiles/mini-greeter.conf

And then add a symlink pointing to the file in your home directory:

    sudo ln -s ~/.dotfiles/mini-greeter.conf /etc/lightdm/lightdm-mini-greeter.conf

And finally log out & restart LightDM:

    sudo systemctl restart lightdm

If LightDM fails to start back up, check the greeter's log file(usually at
`/var/log/lightdm/seat0-greeter.log`) for the following line:

    Could not load configuration file: Permission denied

If present, your permissions need further adjustment. You can test your
permissions by attempting to read the file with `sudo`:

    sudo -u lightdm cat ~/.dotfiles/mini-greeter.conf


## Contribute

You can submit feature requests, bug reports, pull requests or patches on
either [github](http://github.com/prikhi/lightdm-mini-greeter) or
[redmine](http://bugs.sleepanarchy.com/projects/mini-greeter/).

If you like Mini-Greeter, please consider packaging it for your distribution.


### Style

* Use indentation and braces, 4 spaces - no tabs, no trailing whitespace.
* Declare pointers like this: `char *p1, *p2;`, avoid: `char* p1;`.
* Function braces should be on their own line.
* If/else/while/do should always use braces and indentation.
* Use `g_critical` for irrecoverable user errors, `g_error` for programming
  errors.

When in doubt, check surrounding code.


## License

GPL-3


[aur-package]: https://aur.archlinux.org/packages/lightdm-mini-greeter/
[gentoo-package]: https://packages.gentoo.org/packages/x11-misc/lightdm-mini-greeter
[releases]: https://github.com/prikhi/lightdm-mini-greeter/releases