pax_global_header 0000666 0000000 0000000 00000000064 14714145711 0014517 g ustar 00root root 0000000 0000000 52 comment=15ba1d425a50785dec13c9373f7f5e8912dadd08
nwg-hello-0.3.0/ 0000775 0000000 0000000 00000000000 14714145711 0013413 5 ustar 00root root 0000000 0000000 nwg-hello-0.3.0/.github/ 0000775 0000000 0000000 00000000000 14714145711 0014753 5 ustar 00root root 0000000 0000000 nwg-hello-0.3.0/.github/FUNDING.yml 0000664 0000000 0000000 00000000041 14714145711 0016563 0 ustar 00root root 0000000 0000000 github: nwg-piotr
liberapay: nwg
nwg-hello-0.3.0/.gitignore 0000664 0000000 0000000 00000000061 14714145711 0015400 0 ustar 00root root 0000000 0000000 /.idea
/venv
/nwg_hello.egg-info/
/build/
/dist/
nwg-hello-0.3.0/LICENSE 0000664 0000000 0000000 00000002055 14714145711 0014422 0 ustar 00root root 0000000 0000000 MIT License
Copyright (c) 2024 Piotr Miller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
nwg-hello-0.3.0/README 0000664 0000000 0000000 00000000300 14714145711 0014264 0 ustar 00root root 0000000 0000000 Do not edit *-default.* files. To define own settings and the style sheet, copy files to:
# cp nwg-hello-default.json nwg-hello.json
# cp nwg-hello-default.css nwg-hello.css
and edit copies. nwg-hello-0.3.0/README.md 0000664 0000000 0000000 00000022562 14714145711 0014701 0 ustar 00root root 0000000 0000000 # nwg-hello
This program is a part of the [nwg-shell](https://nwg-piotr.github.io/nwg-shell) project.
Nwg-hello is a GTK3-based greeter for the [greetd](https://git.sr.ht/~kennylevinsen/greetd) daemon, written in python.
It is meant to work under a Wayland compositor, like [sway](https://swaywm.org) or [Hyprland](https://hyprland.org) (also see:
[Running on Debian and labwc](#running-on-debian-and-labwc)).
The greeter has been developed for the [nwg-iso](https://github.com/nwg-piotr/nwg-iso) project, but it may be configured
for standalone use.
_The screen layout is heavily inspired by [Sugar Candy SDDM theme](https://framagit.org/MarianArlt/sddm-sugar-candy)
by Marian Arlt._
## Background
I was looking for a good login manager for the nwg-iso project. I first used SDDM with the Sugar Candy theme, and it
worked pretty well. However, it brings QT dependencies, and my stuff is all GTK-based. Also, I know nothing on the QT
framework, so couldn't adjust the greeter to my taste. The next choice was LightDM with [my modification](https://github.com/nwg-piotr/lightdm-nwg-greeter)
of the [LightDM Elephant Greeter](https://github.com/max-moser/lightdm-elephant-greeter) by Maximilian Moser. It looked
well, but LightDM would happen to hang way too often. Then I gave a try to greetd, and that was it. I only needed
a nice graphical greeter based on GTK3. Since there was no such thing, I had to develop one.
## Features
- Multi-monitor support with gtk-layer-shell;
- multi-language support;
- background & style customization with css;
- automatic selection of the last used session and user;
- support for setting environment variables.
## Dependencies
- python >= 3.6;
- greetd;
- gtk3;
- gtk-layer-shell;
- Hyprland or sway Wayland compositor;
- gnome-themes-extra (recommended, as it provides us with the default Adwaita theme).
## Make dependencies
- python-build
- python-installer
- python-wheel
- python-setuptools
## Installation
[](https://repology.org/project/nwg-hello/versions)
First you need to [install and start greetd](https://wiki.archlinux.org/title/Greetd#Installation).
The greeter can be installed by cloning this repository and executing the `install.sh` script (make sure you installed
dependencies first). Then you need to edit the `/etc/greetd/config.toml` file (or `greetd.conf` - see the tip below).
```toml
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1
# The default session, also known as the greeter.
[default_session]
# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want started, such as `sway`.
command = "agreety --cmd /bin/sh"
# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"
```
Replace the line:
```toml
command = "agreety --cmd /bin/sh"
```
with
```toml
command = "Hyprland -c /etc/nwg-hello/hyprland.conf"
```
if you want to use Hyprland, or this line if you prefer sway:
```toml
command = "sway -c /etc/nwg-hello/sway-config"
```
__Do not change the__ `user = "greeter"` __line__, or some file-related functions won't work.
### Tip
During the greetd package upgrades, the `config.toml` file may be overwritten with the default one. E.g. on Arch Linux
your modified file gets renamed to `config.toml.pacsave`. This will restore the `agreety` greeter on your system.
To avoid such a situation, you may use the alternative `greetd.conf` file. This has not been mentioned in docs,
but greetd looks for this file first. Just copy `config.toml` to `greetd.conf` and make changes to the copy.
## Configuration
Copy `/etc/nwg-hello/nwg-hello-default.json` to `/etc/nwg-hello/nwg-hello.json` and make your changes there.
```json
{
"session_dirs": [
"/usr/share/wayland-sessions",
"/usr/share/xsessions"
],
"custom_sessions": [
{
"name": "Shell",
"exec": "/usr/bin/bash"
}
],
"monitor_nums": [],
"form_on_monitors": [],
"delay_secs": 1,
"cmd-sleep": "systemctl suspend",
"cmd-reboot": "systemctl reboot",
"cmd-poweroff": "systemctl poweroff",
"gtk-theme": "Adwaita",
"gtk-icon-theme": "",
"gtk-cursor-theme": "",
"prefer-dark-theme": true,
"template-name": "",
"time-format": "%H:%M:%S",
"date-format": "%A, %d. %B",
"layer": "overlay",
"keyboard-mode": "exclusive",
"lang": "",
"env-vars": []
}
```
- `"session_dirs"`: comma-separated paths to session directories. Modify only if you know well what you're doing.
- `"custom_sessions"`: greetd can run whatever starts from the command line. This way we can add `bash`, `zsh` or something else here. The `"name"` field is the display name. The `"exec"` field is a command.
- `"monitor_nums"`: leave as is to see the greeter on all monitors. Set e.g. `[0, 2]` for it to appear on the 1st and 3rd one.
- `"form_on_monitors"`: which of above monitors to display the login form on (just the wallpaper on the rest).
- `"delay_secs"`: some monitors take longer to turn on. In the meantime the greeter may behave oddly on other monitors. If it happens to restart/blink, increase this value. If you only have one monitor and no discrete GPU, you may probably set `0` here.
- `"cmd-sleep"`, `"cmd-reboot"`, and `"cmd-poweroff"` are pre-defined for systemd-based systems. Use whatever works for you.
- `"gtk-theme"`, `"gtk-icon-theme"` and `"gtk-cursor-theme"` are of little importance as long, as you use classes and IDs from the default css style sheet.
- `"prefer-dark-theme"` should remain `true`, unless you need to turn it off for use with your own background and/or styling.
- `"template-name"` allows use of own templates: find the built-in `/usr/lib/python3.xx/site-packages/nwg_hello-x.y.z-py3.xx.egg/nwg_hello/template.glade` file, copy to a folder somewhere in `~/`, edit and place as `/etc/nwg-hello/file-name.glade`. Do not change widget IDs. Set your `file-name.glade` as the `"template-name"` value. Leave blank to use the built-in template.
- `"time-format"`: string to format clock with the strftime() function (see: https://www.man7.org/linux/man-pages/man3/strftime.3.html).
- `"date-format"`: string to format date with the strftime() function (see: https://www.man7.org/linux/man-pages/man3/strftime.3.html).
- `"layer"`: allows to choose gtk-layer-shell layer: 'background', 'bottom', 'top', 'overlay'; 'overlay' will be used if no value given.
- `"keyboard-mode"`: allows to choose gtk-layer-shell keyboard mode: 'none', 'exclusive', 'on_demand'; 'exclusive' will be used if no value given.
- `"lang"` allows you to force the use of a specific language, regardless of the `$LANG` system variable. Check if we have the translation in the [langs directory](https://github.com/nwg-piotr/nwg-hello/tree/main/nwg_hello/langs).
- `"env-vars"` allows to pass an array of environment variables. Use like this: `["MY_VAR=value", "OTHER_VAR=value1"]`.
## Styling
Copy `/etc/nwg-hello/nwg-hello-default.css` to `/etc/nwg-hello/nwg-hello.css` and make your changes there.
## Custom icons
If you'd like to use own icons, do not replace `/usr/share/nwg-hello/*-default.svg` files. Place your `poweroff.svg`,
`reboot.svg` and `sleep.svg` files in the same directory.
## Own language files
You can't translate labels in the .glade file, as the program replaces the values with what's defined in
[language files](https://github.com/nwg-piotr/nwg-hello/tree/main/nwg_hello/langs). Since the 0.2.4 version, however,
you can copy your lang file to `/etc/nwg-hello/` and make desired changes there,
see https://github.com/nwg-piotr/nwg-hello/issues/19. Be careful with syntax, the JSON format is unforgiving.
Test your lang file by running `nwg-hello -t -d` from terminal.
## Running on Debian and labwc
Submitted by [@01micko](https://github.com/01micko).
### configs
#### /etc/greetd/greetd.conf
```toml
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 7
# The default session, also known as the greeter.
[default_session]
command = "labwc --config-dir /etc/nwg-hello/labwc-config"
# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "_greetd"
```
NOTE: The user `_greetd` is a debian thing, even though it isn't set up correctly. You have to manually add to 'video'
group and `chown` all the files in `/etc/greetd`.
#### /etc/nwg-hello/labwc-config/autostart
```sh
# start nwg-hello - full paths aren't required, but saves lookup time
exec /usr/bin/nwg-hello; /usr/bin/labwc --exit
```
#### /etc/nwg-hello/labwc-config/rc.xml (optional)
- only if you want a screenshot (using `PrtScr` key) of `nwg-hello` saved to /etc/greetd/
```xml
```
## Acknowledgments
- [@milisarge](https://gist.github.com/milisarge) for [the snippet](https://gist.github.com/milisarge/d169756e316e185572605699e73ed3ae) that let me know how things work;
- [Marian Arlt](https://framagit.org/MarianArlt) for inspiring look of the Sugar Candy SDDM theme.
nwg-hello-0.3.0/cache.json 0000664 0000000 0000000 00000000002 14714145711 0015341 0 ustar 00root root 0000000 0000000 {} nwg-hello-0.3.0/hyprland.conf 0000664 0000000 0000000 00000000257 14714145711 0016107 0 ustar 00root root 0000000 0000000 monitor=,preferred,auto,1
bind = ALT, Q, killactive,
misc {
disable_hyprland_logo = true
}
animations {
enabled = false
}
exec-once = nwg-hello; hyprctl dispatch exit
nwg-hello-0.3.0/img/ 0000775 0000000 0000000 00000000000 14714145711 0014167 5 ustar 00root root 0000000 0000000 nwg-hello-0.3.0/img/poweroff-default.svg 0000664 0000000 0000000 00000004147 14714145711 0020167 0 ustar 00root root 0000000 0000000
nwg-hello-0.3.0/img/reboot-default.svg 0000664 0000000 0000000 00000004525 14714145711 0017632 0 ustar 00root root 0000000 0000000
nwg-hello-0.3.0/img/sleep-default.svg 0000664 0000000 0000000 00000004037 14714145711 0017446 0 ustar 00root root 0000000 0000000
nwg-hello-0.3.0/install.sh 0000775 0000000 0000000 00000001472 14714145711 0015424 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
# Make sure you have 'python-build' 'python-installer' 'python-wheel' and 'python-setuptools' installed
install -D -m 644 -t /etc/nwg-hello/ nwg-hello-default.json
install -D -m 644 -t /etc/nwg-hello/ nwg-hello-default.css
install -D -m 644 -t /etc/nwg-hello/ hyprland.conf
install -D -m 644 -t /etc/nwg-hello/ sway-config
install -D -m 644 -t /etc/nwg-hello/ README
install -D -m 644 -t /usr/share/nwg-hello/ nwg.jpg
install -D -m 644 -t /usr/share/nwg-hello/ img/*
install -d /var/cache/nwg-hello
install -Dm644 -t /var/cache/nwg-hello cache.json -o greeter
install -Dm 644 -t "/usr/share/licenses/nwg-hello" LICENSE
install -Dm 644 -t "/usr/share/doc/nwg-hello" README.md
python -m build --wheel --no-isolation
[ -f /usr/bin/nwg-hello ] && sudo rm /usr/bin/nwg-hello
python -m installer dist/*.whl
nwg-hello-0.3.0/nwg-hello-default.css 0000664 0000000 0000000 00000001601 14714145711 0017441 0 ustar 00root root 0000000 0000000 window {
background-image: url("/usr/share/nwg-hello/nwg.jpg"); background-size: 100% 100%
}
#form-wrapper {
background-color: rgba(0, 0, 0, 0.2)
}
entry {
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid #eee;
border-radius: 18px;
padding: 12px
}
button {
background: none;
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid #eee;
border-radius: 18px;
padding: 12px
}
button:hover {
background-color: rgba(255, 255, 255, 0.2)
}
#power-button {
border-radius: 18px;
background:none;
border: none;
}
#power-button:hover {
background-color: rgba(255, 255, 255, 0.1)
}
#power-button:active {
background-color: rgba(255, 255, 0, 0.2)
}
#welcome-label {
font-size: 48px
}
#clock-label {
font-family: monospace;
font-size: 30px
}
#date-label {
font-size: 18px
}
#form-label {
}
#form-combo {
}
#password-entry {
}
#login-button {
}
nwg-hello-0.3.0/nwg-hello-default.json 0000664 0000000 0000000 00000001174 14714145711 0017627 0 ustar 00root root 0000000 0000000 {
"session_dirs": [
"/usr/share/wayland-sessions",
"/usr/share/xsessions"
],
"custom_sessions": [
{
"name": "Shell",
"exec": "/usr/bin/bash"
}
],
"monitor_nums": [],
"form_on_monitors": [],
"delay_secs": 1,
"cmd-sleep": "systemctl suspend",
"cmd-reboot": "systemctl reboot",
"cmd-poweroff": "systemctl poweroff",
"gtk-theme": "Adwaita",
"gtk-icon-theme": "",
"gtk-cursor-theme": "",
"prefer-dark-theme": true,
"template-name": "",
"time-format": "%H:%M:%S",
"date-format": "%A, %d. %B",
"layer": "overlay",
"keyboard-mode": "exclusive",
"lang": "",
"env-vars": []
}
nwg-hello-0.3.0/nwg.jpg 0000664 0000000 0000000 00005427121 14714145711 0014724 0 ustar 00root root 0000000 0000000 JFIF H H Exif MM * # b ( 2 i D Yellow spray on blue painted rocks H H 2023:09:13 15:18:43 Y e l l o w s p r a y o n b l u e p a i n t e d r o c k s
http://ns.adobe.com/xap/1.0/ Yellow spray on blue painted rocksabstractantiqueblackboardblankclose-upcrackcraterdistressedearthquakeelementemptyeruptionfloorformationglowgranitegreygrungehardindustrialjewelrylavamarblematerialmineralnationaloceanpaintpanoramarockrockyroughrustsandsceneryscenicslatestrongstructuresurfacetexturedturquoiseveinvintagevolcanowallpaperwavewhitewildwildernessPanoramic stones made of volcanic rock in different sizes, shapes and shades of color dark blue lava \Photoshop 3.0 8BIM #Z %G @Panoramic stones made of volcanic rock in different sizes, shape abstract antique
blackboard blank close-up crack crater
distressed
earthquake element empty eruption floor formation glow granite grey grunge hard
industrial jewelry lava marble material mineral national ocean paint panorama rock rocky rough rust sand scenery scenic slate strong structure surface textured turquoise vein vintage volcano wallpaper wave white wild
wildernessi dPanoramic stones made of volcanic rock in different sizes, shapes and shades of color dark blue lavax "Yellow spray on blue painted rocks 8BIM% ߋK EusswdICC_PROFILE Tlcms0 mntrRGB XYZ
acspMSFT -lcms desc >cprt H Lwtpt chad ,rXYZ bXYZ gXYZ rTRC gTRC bTRC chrm 0 $mluc enUS " s R G B I E C 6 1 9 6 6 - 2 . 1 mluc enUS 0 N o c o p y r i g h t , u s e f r e e l yXYZ -sf32 B % nXYZ o 8 XYZ $ XYZ b para ff
Y
[chrm T{ L &f