mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-21 11:44:55 +00:00
Compare commits
104 Commits
dhalucario
...
v0.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c2be475ad | ||
|
|
d775efb414 | ||
|
|
57a8eecb1a | ||
|
|
cbd82146e2 | ||
|
|
1124c126f9 | ||
|
|
f9848f648b | ||
|
|
93cb8394d2 | ||
|
|
faa76def08 | ||
|
|
0b87d6c030 | ||
|
|
627ebe3326 | ||
|
|
a8ea5d3e99 | ||
|
|
8c4ba3bd40 | ||
|
|
c03ec1d15b | ||
|
|
c64f806a68 | ||
|
|
24f017e09c | ||
|
|
33662480e9 | ||
|
|
a7b01a721b | ||
|
|
77eb456410 | ||
|
|
19153760d3 | ||
|
|
2ffb86213b | ||
|
|
5db09ce104 | ||
|
|
99edd83429 | ||
|
|
59aae77f49 | ||
|
|
0cefb3da8e | ||
|
|
309b97df8d | ||
|
|
253ee005ad | ||
|
|
09ee6293bd | ||
|
|
86d035346e | ||
|
|
8c536d09ed | ||
|
|
13020184cf | ||
|
|
07ca027ac6 | ||
|
|
0a798831fe | ||
|
|
4e24154cac | ||
|
|
b5d3ef0a70 | ||
|
|
3556e39374 | ||
|
|
8d6218ee62 | ||
|
|
4208ba0e0f | ||
|
|
b051607c65 | ||
|
|
0599af2cce | ||
|
|
f6de0eb086 | ||
|
|
3c139d3eaf | ||
|
|
354b1493c7 | ||
|
|
7d5eb449c3 | ||
|
|
9364ffcea9 | ||
|
|
e158bb5e9d | ||
|
|
2e1a57648b | ||
|
|
4b5374c13f | ||
|
|
5945982d99 | ||
|
|
723a008adf | ||
|
|
802ad7b204 | ||
|
|
079f68696b | ||
|
|
73e8193b2e | ||
|
|
1fad38aad9 | ||
|
|
9e33f90d24 | ||
|
|
38aacc6b1c | ||
|
|
83c17b7b78 | ||
|
|
f485840d89 | ||
|
|
767120c701 | ||
|
|
cc5a50ff32 | ||
|
|
77d186b802 | ||
|
|
8eb487ae9e | ||
|
|
dec2ef14e0 | ||
|
|
63aeec1869 | ||
|
|
9da5a5e136 | ||
|
|
ffa8fbe77b | ||
|
|
ac2b255021 | ||
|
|
bd04d69b4d | ||
|
|
a078a07ee7 | ||
|
|
c84de06b91 | ||
|
|
78e2fd1a21 | ||
|
|
da5b08abf2 | ||
|
|
559f2f7370 | ||
|
|
d29d65dee5 | ||
|
|
1890da4799 | ||
|
|
6ea31612cd | ||
|
|
443616e4ed | ||
|
|
c0366fe805 | ||
|
|
7ed6631197 | ||
|
|
fa978c8add | ||
|
|
6245639daf | ||
|
|
9fd7779972 | ||
|
|
2ca457aada | ||
|
|
9c1e218900 | ||
|
|
df6d906f6d | ||
|
|
c762cdc20c | ||
|
|
d7930053c6 | ||
|
|
b6681e78a9 | ||
|
|
25034d1536 | ||
|
|
27c5673116 | ||
|
|
908ebf8964 | ||
|
|
dc0221259f | ||
|
|
79a4ff470d | ||
|
|
6023565814 | ||
|
|
609b3f9ddc | ||
|
|
7597bcdfc2 | ||
|
|
ccc39d2bed | ||
|
|
a20d5195a6 | ||
|
|
b3d5756a0a | ||
|
|
fad4e4dd84 | ||
|
|
9d4aea06b0 | ||
|
|
4094d2182a | ||
|
|
b448fc97b2 | ||
|
|
1ca229b5c8 | ||
|
|
c5012ef11b |
@@ -1,4 +0,0 @@
|
||||
srpm:
|
||||
cd $(spec)
|
||||
make github
|
||||
rpmbuild -vv -bs ly.spec --define "_srcrpmdir $(outdir)"
|
||||
15
.gitea
15
.gitea
@@ -1,15 +0,0 @@
|
||||
[submodule "sub/argoat"]
|
||||
path = sub/argoat
|
||||
url = https://git.nullgemm.fr/nullgemm/argoat.git
|
||||
[submodule "sub/configator"]
|
||||
path = sub/configator
|
||||
url = https://git.nullgemm.fr/nullgemm/configator.git
|
||||
[submodule "sub/ctypes"]
|
||||
path = sub/ctypes
|
||||
url = https://git.nullgemm.fr/nullgemm/ctypes.git
|
||||
[submodule "sub/dragonfail"]
|
||||
path = sub/dragonfail
|
||||
url = https://git.nullgemm.fr/nullgemm/dragonfail.git
|
||||
[submodule "sub/termbox_next"]
|
||||
path = sub/termbox_next
|
||||
url = https://git.nullgemm.fr/nullgemm/termbox_next.git
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
bin
|
||||
obj
|
||||
.gitmodules
|
||||
valgrind.log
|
||||
|
||||
3
.github → .gitmodules
vendored
3
.github → .gitmodules
vendored
@@ -4,9 +4,6 @@
|
||||
[submodule "sub/configator"]
|
||||
path = sub/configator
|
||||
url = https://github.com/nullgemm/configator.git
|
||||
[submodule "sub/ctypes"]
|
||||
path = sub/ctypes
|
||||
url = https://github.com/nullgemm/ctypes.git
|
||||
[submodule "sub/dragonfail"]
|
||||
path = sub/dragonfail
|
||||
url = https://github.com/nullgemm/dragonfail.git
|
||||
78
ly.spec.rpkg
78
ly.spec.rpkg
@@ -1,78 +0,0 @@
|
||||
%define relabel_files() \
|
||||
restorecon -R /usr/bin/ly; \
|
||||
|
||||
%define selinux_policyver 3.14.6-34
|
||||
|
||||
Name: {{{ git_dir_name }}}
|
||||
Version: {{{ git_dir_version }}}
|
||||
Release: 1%{?dist}
|
||||
Summary: A TUI display manager
|
||||
License: WTFPL
|
||||
URL: https://github.com/nullgemm/ly
|
||||
VCS: {{{ git_dir_vcs }}}
|
||||
Source: {{{ git_dir_pack }}}
|
||||
BuildRequires: libxcb-devel
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: make
|
||||
BuildRequires: git
|
||||
BuildRequires: gcc
|
||||
BuildRequires: selinux-policy-devel
|
||||
Requires: libxcb
|
||||
Requires: pam
|
||||
|
||||
%description
|
||||
Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
|
||||
|
||||
%prep
|
||||
git clone https://github.com/dhalucario/ly.git ly
|
||||
cd ly
|
||||
# git checkout v0.5.2
|
||||
make github
|
||||
|
||||
%build
|
||||
cd ly
|
||||
make
|
||||
|
||||
%install
|
||||
cd ly
|
||||
mkdir -p %{buildroot}/etc/
|
||||
mkdir -p %{buildroot}/usr/bin/
|
||||
mkdir -p %{buildroot}/usr/lib/systemd/system/
|
||||
mkdir -p %{buildroot}/etc/pam.d/
|
||||
DESTDIR="%{buildroot}" make install
|
||||
DESTDIR="%{buildroot}" make installselinux
|
||||
chmod -x %{buildroot}/etc/ly/config.ini
|
||||
chmod -x %{buildroot}/etc/ly/lang/*
|
||||
|
||||
%post
|
||||
semodule -n -i /usr/share/selinux/packages/ly.pp
|
||||
if /usr/sbin/selinuxenabled ; then
|
||||
/usr/sbin/load_policy
|
||||
%relabel_files
|
||||
|
||||
fi;
|
||||
exit 0
|
||||
|
||||
%postun
|
||||
if [ $1 -eq 0 ]; then
|
||||
semodule -n -r ly
|
||||
fi;
|
||||
exit 0
|
||||
|
||||
%files
|
||||
/usr/bin/ly
|
||||
/usr/lib/systemd/system/ly.service
|
||||
/etc/ly/lang/es.ini
|
||||
/etc/ly/lang/pt.ini
|
||||
/etc/ly/lang/ru.ini
|
||||
/etc/ly/lang/en.ini
|
||||
/etc/ly/lang/fr.ini
|
||||
/etc/ly/lang/ro.ini
|
||||
/etc/ly/xsetup.sh
|
||||
/etc/ly/wsetup.sh
|
||||
/etc/ly/config.ini
|
||||
/etc/pam.d/ly
|
||||
/usr/share/selinux/packages/ly.pp
|
||||
|
||||
%changelog
|
||||
{{{ git_dir_changelog }}}
|
||||
46
makefile
46
makefile
@@ -3,7 +3,7 @@ CC = gcc
|
||||
FLAGS = -std=c99 -pedantic -g
|
||||
FLAGS+= -Wall -Wextra -Werror=vla -Wno-unused-parameter
|
||||
#FLAGS+= -DDEBUG
|
||||
FLAGS+= -DGIT_VERSION_STRING=\"$(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')\"
|
||||
FLAGS+= -DLY_VERSION=\"$(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')\"
|
||||
LINK = -lpam -lxcb
|
||||
VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full --suppressions=../res/valgrind.supp
|
||||
CMD = ./$(NAME)
|
||||
@@ -70,7 +70,7 @@ leakgrind: $(BIND)/$(NAME)
|
||||
@less valgrind.log
|
||||
|
||||
install: $(BIND)/$(NAME)
|
||||
@echo "installing"
|
||||
@echo "installing ly"
|
||||
@install -dZ ${DESTDIR}/etc/ly
|
||||
@install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin
|
||||
@install -DZ $(RESD)/config.ini -t ${DESTDIR}/etc/ly
|
||||
@@ -78,24 +78,29 @@ install: $(BIND)/$(NAME)
|
||||
@install -DZ $(RESD)/wsetup.sh -t $(DATADIR)
|
||||
@install -dZ $(DATADIR)/lang
|
||||
@install -DZ $(RESD)/lang/* -t $(DATADIR)/lang
|
||||
@install -DZ $(RESD)/ly.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system
|
||||
@install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d
|
||||
|
||||
installnoconf: $(BIND)/$(NAME)
|
||||
@echo "installing without the configuration file"
|
||||
@echo "installing ly without the configuration file"
|
||||
@install -dZ ${DESTDIR}/etc/ly
|
||||
@install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin
|
||||
@install -DZ $(RESD)/xsetup.sh -t $(DATADIR)
|
||||
@install -DZ $(RESD)/wsetup.sh -t $(DATADIR)
|
||||
@install -dZ $(DATADIR)/lang
|
||||
@install -DZ $(RESD)/lang/* -t $(DATADIR)/lang
|
||||
@install -DZ $(RESD)/ly.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system
|
||||
@install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d
|
||||
|
||||
installselinux:
|
||||
@echo "installing selinux modules"
|
||||
@make -f /usr/share/selinux/devel/Makefile ly.pp
|
||||
@install -DZ ly.pp ${DESTDIR}/usr/share/selinux/packages/ly.pp
|
||||
installsystemd:
|
||||
@echo "installing systemd service"
|
||||
@install -DZ $(RESD)/ly.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system
|
||||
|
||||
installopenrc:
|
||||
@echo "installing openrc service"
|
||||
@install -DZ $(RESD)/ly-openrc -m 755 -T ${DESTDIR}/etc/init.d/${NAME}
|
||||
|
||||
installrunit:
|
||||
@echo "installing runit service"
|
||||
@install -DZ $(RESD)/ly-runit-service/* -t ${DESTDIR}/etc/sv/ly
|
||||
|
||||
uninstall:
|
||||
@echo "uninstalling"
|
||||
@@ -104,29 +109,10 @@ uninstall:
|
||||
@rm -f ${DESTDIR}/usr/bin/ly
|
||||
@rm -f ${DESTDIR}/usr/lib/systemd/system/ly.service
|
||||
@rm -f ${DESTDIR}/etc/pam.d/ly
|
||||
@rm -f ${DESTDIR}/etc/init.d/${NAME}
|
||||
@rm -rf ${DESTDIR}/etc/sv/ly
|
||||
|
||||
clean:
|
||||
@echo "cleaning"
|
||||
@rm -rf $(BIND) $(OBJD) valgrind.log
|
||||
@(cd $(SUBD)/termbox_next && $(MAKE) clean)
|
||||
|
||||
remotes:
|
||||
@echo "registering remotes"
|
||||
@git remote add github git@github.com:nullgemm/$(NAME).git
|
||||
@git remote add gitea ssh://git@git.nullgem.fr:2999/nullgemm/$(NAME).git
|
||||
|
||||
github:
|
||||
@echo "sourcing submodules from https://github.com"
|
||||
@cp .github .gitmodules
|
||||
@git submodule sync
|
||||
@git submodule update --init --remote
|
||||
@cd $(SUBD)/argoat && make github
|
||||
@git submodule update --init --recursive --remote
|
||||
|
||||
gitea:
|
||||
@echo "sourcing submodules from personal server"
|
||||
@cp .gitea .gitmodules
|
||||
@git submodule sync
|
||||
@git submodule update --init --remote
|
||||
@cd $(SUBD)/argoat && make gitea
|
||||
@git submodule update --init --recursive --remote
|
||||
|
||||
95
readme.md
95
readme.md
@@ -1,3 +1,4 @@
|
||||
|
||||
# Ly - a TUI display manager
|
||||

|
||||
|
||||
@@ -15,25 +16,34 @@ Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
|
||||
- tput
|
||||
- shutdown
|
||||
|
||||
On Debian-based distros running `apt install build-essential libpam0g-dev libxcb-xkb-dev` as root should install all the dependencies for you.
|
||||
On Debian-based distros running `apt install build-essential libpam0g-dev libxcb-xkb-dev` as root should install all the dependencies for you.
|
||||
For Fedora try running `dnf install make automake gcc gcc-c++ kernel-devel pam-devel libxcb-devel`
|
||||
|
||||
## Support
|
||||
The following desktop environments were tested with success
|
||||
|
||||
- awesome
|
||||
- bspwm
|
||||
- budgie
|
||||
- cinnamon
|
||||
- deepin
|
||||
- dwm
|
||||
- enlightenment
|
||||
- gnome
|
||||
- i3
|
||||
- kde
|
||||
- labwc
|
||||
- lxde
|
||||
- lxqt
|
||||
- mate
|
||||
- sway
|
||||
- xfce
|
||||
- maxx
|
||||
- pantheon
|
||||
- maxx
|
||||
- windowmaker
|
||||
- qtile
|
||||
- spectrwm
|
||||
- sway
|
||||
- windowmaker
|
||||
- xfce
|
||||
- xmonad
|
||||
|
||||
Ly should work with any X desktop environment, and provides
|
||||
basic wayland support (sway works very well, for example).
|
||||
@@ -47,39 +57,88 @@ changing the source code won't be necessary :)
|
||||
## Cloning and Compiling
|
||||
Clone the repository
|
||||
```
|
||||
git clone https://github.com/nullgemm/ly.git
|
||||
$ git clone --recurse-submodules https://github.com/fairyglade/ly
|
||||
```
|
||||
|
||||
Fetch submodules
|
||||
Change the directory to ly
|
||||
```
|
||||
make github
|
||||
$ cd ly
|
||||
```
|
||||
|
||||
Compile
|
||||
```
|
||||
make
|
||||
$ make
|
||||
```
|
||||
|
||||
Test in the configured tty (tty2 by default)
|
||||
or a terminal emulator (but desktop environments won't start)
|
||||
```
|
||||
sudo make run
|
||||
# make run
|
||||
```
|
||||
|
||||
Install Ly and the provided systemd service file
|
||||
```
|
||||
sudo make install
|
||||
# make install installsystemd
|
||||
```
|
||||
|
||||
Enable the service
|
||||
```
|
||||
sudo systemctl enable ly.service
|
||||
# systemctl enable ly.service
|
||||
```
|
||||
|
||||
If you need to switch between ttys after Ly's start you also have to
|
||||
disable getty on Ly's tty to prevent "login" from spawning on top of it
|
||||
```
|
||||
sudo systemctl disable getty@tty2.service
|
||||
# systemctl disable getty@tty2.service
|
||||
```
|
||||
|
||||
### OpenRC
|
||||
|
||||
Clone, compile and test.
|
||||
|
||||
Install Ly and the provided OpenRC service
|
||||
```
|
||||
# make install installopenrc
|
||||
```
|
||||
|
||||
Enable the service
|
||||
```
|
||||
# rc-update add ly
|
||||
```
|
||||
|
||||
You can edit which tty Ly will start on by editing the `tty` option in the configuration file.
|
||||
|
||||
If you choose a tty that already has a login/getty running (has a basic login prompt), then you have to disable the getty so it doesn't respawn on top of ly
|
||||
```
|
||||
# rc-update del agetty.tty2
|
||||
```
|
||||
|
||||
### runit
|
||||
|
||||
```
|
||||
$ make
|
||||
# make install installrunit
|
||||
# ln -s /etc/sv/ly /var/service/
|
||||
```
|
||||
|
||||
By default, ly will run on tty2. To change the tty it must be set in `/etc/ly/config.ini`
|
||||
|
||||
You should as well disable your existing display manager service if needed, e.g.:
|
||||
|
||||
```
|
||||
# rm /var/service/lxdm
|
||||
```
|
||||
|
||||
The agetty service for the tty console where you are running ly should be disabled. For instance, if you are running ly on tty2 (that's the default, check your `/etc/ly/config.ini`) you should disable the agetty-tty2 service like this:
|
||||
|
||||
```
|
||||
# rm /var/service/agetty-tty2
|
||||
```
|
||||
|
||||
## Arch Linux Installation
|
||||
You can install ly from the [`[extra]` repos](https://archlinux.org/packages/extra/x86_64/ly/):
|
||||
```
|
||||
$ sudo pacman -S ly
|
||||
```
|
||||
|
||||
## Configuration
|
||||
@@ -94,12 +153,10 @@ while on the desktop field (above the login field).
|
||||
## .xinitrc
|
||||
If your .xinitrc doesn't work make sure it is executable and includes a shebang.
|
||||
This file is supposed to be a shell script! Quoting from xinit's man page:
|
||||
```
|
||||
If no specific client program is given on the command line, xinit will look for
|
||||
a file in the user's home directory called .xinitrc to run as a shell script to
|
||||
start up client programs.
|
||||
```
|
||||
On ArchLinux, the example .xinitrc (/etc/X11/xinit/xinitrc) starts like this:
|
||||
|
||||
> If no specific client program is given on the command line, xinit will look for a file in the user's home directory called .xinitrc to run as a shell script to start up client programs.
|
||||
|
||||
On Arch Linux, the example .xinitrc (/etc/X11/xinit/xinitrc) starts like this:
|
||||
```
|
||||
#!/bin/sh
|
||||
```
|
||||
|
||||
154
res/config.ini
154
res/config.ini
@@ -1,104 +1,140 @@
|
||||
# animation enabled
|
||||
# Animation enabled/disabled
|
||||
#animate = false
|
||||
#animate = true
|
||||
|
||||
# the active animation (only animation '0' available for now)
|
||||
# The active animation
|
||||
# 0 -> PSX DOOM fire (default)
|
||||
# 1 -> CMatrix
|
||||
#animation = 0
|
||||
|
||||
# the char used to mask the password
|
||||
#asterisk = *
|
||||
#asterisk = o
|
||||
# format string for clock in top right corner (see strftime specification)
|
||||
#clock = %c
|
||||
|
||||
# background color id
|
||||
# enable/disable big clock
|
||||
#bigclock = true
|
||||
|
||||
# The character used to mask the password
|
||||
#asterisk = *
|
||||
|
||||
# Erase password input on failure
|
||||
#blank_password = false
|
||||
|
||||
#The `fg` and `bg` color settings take a digit 0-8 corresponding to:
|
||||
#define TB_DEFAULT 0x00
|
||||
#define TB_BLACK 0x01
|
||||
#define TB_RED 0x02
|
||||
#define TB_GREEN 0x03
|
||||
#define TB_YELLOW 0x04
|
||||
#define TB_BLUE 0x05
|
||||
#define TB_MAGENTA 0x06
|
||||
#define TB_CYAN 0x07
|
||||
#define TB_WHITE 0x08
|
||||
#
|
||||
# Setting both to zero makes `bg` black and `fg` white. To set the actual color palette you are encouraged to use another tool
|
||||
# such as [mkinitcpio-colors](https://github.com/evanpurkhiser/mkinitcpio-colors). Note that the color palette defined with
|
||||
# `mkinitcpio-colors` takes 16 colors (0-15), only values 0-8 are valid for `ly` config and these values do not correspond
|
||||
# exactly. For instance, in defining palettes with `mkinitcpio-colors` the order is black, dark red, dark green, brown, dark
|
||||
# blue, dark purple, dark cyan, light gray, dark gray, bright red, bright green, yellow, bright blue, bright purple, bright
|
||||
# cyan, and white, indexed in that order 0 through 15. For example, the color defined for white (indexed at 15 in the mkinitcpio
|
||||
# config) will be used by `ly` for `fg = 8`.
|
||||
|
||||
# Background color id
|
||||
#bg = 0
|
||||
|
||||
# blank main box
|
||||
#blank_box = true
|
||||
|
||||
# erase password input on failure
|
||||
#blank_password = false
|
||||
#blank_password = true
|
||||
|
||||
# console path
|
||||
#console_dev = /dev/console
|
||||
|
||||
# input active by default on startup
|
||||
#default_input = 2
|
||||
|
||||
# foreground color id
|
||||
# Foreground color id
|
||||
#fg = 9
|
||||
|
||||
# remove main box borders
|
||||
# Blank main box background
|
||||
# Setting to false will make it transparent
|
||||
#blank_box = true
|
||||
|
||||
# Remove main box borders
|
||||
#hide_borders = false
|
||||
#hide_borders = true
|
||||
|
||||
# number of visible chars on an input
|
||||
#input_len = 34
|
||||
|
||||
# active language
|
||||
#lang = en
|
||||
#lang = fr
|
||||
|
||||
# load the saved desktop and login
|
||||
#load = true
|
||||
|
||||
# main box margins
|
||||
# Main box margins
|
||||
#margin_box_h = 2
|
||||
#margin_box_v = 1
|
||||
|
||||
# total input sizes
|
||||
# Input boxes length
|
||||
#input_len = 34
|
||||
|
||||
# Max input sizes
|
||||
#max_desktop_len = 100
|
||||
#max_login_len = 255
|
||||
#max_password_len = 255
|
||||
|
||||
# cookie generator
|
||||
#mcookie_cmd = /usr/bin/mcookie
|
||||
|
||||
# event timeout in milliseconds
|
||||
#min_refresh_delta = 5
|
||||
# Input box active by default on startup
|
||||
#default_input = 2
|
||||
|
||||
# default path
|
||||
#path = /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin
|
||||
# Load the saved desktop and username
|
||||
#load = true
|
||||
|
||||
# command executed when pressing F2
|
||||
#restart_cmd = /sbin/shutdown -r now
|
||||
|
||||
# save the current desktop and login as defaults
|
||||
# Save the current desktop and login as defaults
|
||||
#save = true
|
||||
|
||||
# file in which to save and load the default desktop and login
|
||||
# File in which to save and load the default desktop and login
|
||||
#save_file = /etc/ly/save
|
||||
|
||||
# service name (set to ly to use the provided pam config file)
|
||||
#service_name = ly
|
||||
|
||||
# command executed when pressing F1
|
||||
# Remove F1/F2 command hints
|
||||
#hide_f1_commands = false
|
||||
|
||||
# Command executed when pressing F1
|
||||
#shutdown_cmd = /sbin/shutdown -a now
|
||||
|
||||
# terminal reset command (tput is faster)
|
||||
#term_reset_cmd = /usr/bin/tput reset
|
||||
# Command executed when pressing F2
|
||||
#restart_cmd = /sbin/shutdown -r now
|
||||
|
||||
|
||||
# Active language
|
||||
# Available languages are found in /etc/ly/lang/
|
||||
#lang = en
|
||||
|
||||
|
||||
# tty in use
|
||||
#tty = 2
|
||||
|
||||
# wayland setup command
|
||||
# Console path
|
||||
#console_dev = /dev/console
|
||||
|
||||
# Default path
|
||||
#path = /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin
|
||||
|
||||
|
||||
# Event timeout in milliseconds
|
||||
#min_refresh_delta = 5
|
||||
|
||||
# Service name (set to ly to use the provided pam config file)
|
||||
#service_name = ly
|
||||
|
||||
# Terminal reset command (tput is faster)
|
||||
#term_reset_cmd = /usr/bin/tput reset
|
||||
|
||||
# Cookie generator
|
||||
#mcookie_cmd = /usr/bin/mcookie
|
||||
|
||||
|
||||
# Wayland setup command
|
||||
#wayland_cmd = /etc/ly/wsetup.sh
|
||||
|
||||
# add wayland specifier to session names
|
||||
# Add wayland specifier to session names
|
||||
#wayland_specifier = false
|
||||
#wayland_specifier = true
|
||||
|
||||
# wayland desktop environments
|
||||
# Wayland desktop environments
|
||||
#waylandsessions = /usr/share/wayland-sessions
|
||||
|
||||
# xorg server command
|
||||
|
||||
# xinitrc
|
||||
#xinitrc = ~/.xinitrc
|
||||
|
||||
# Xorg server command
|
||||
#x_cmd = /usr/bin/X
|
||||
|
||||
# xorg setup command
|
||||
# Xorg setup command
|
||||
#x_cmd_setup = /etc/ly/xsetup.sh
|
||||
|
||||
# xorg xauthority edition tool
|
||||
# Xorg xauthority edition tool
|
||||
#xauth_cmd = /usr/bin/xauth
|
||||
|
||||
# xorg desktop environments
|
||||
# Xorg desktop environments
|
||||
#xsessions = /usr/share/xsessions
|
||||
|
||||
45
res/lang/cat.ini
Executable file
45
res/lang/cat.ini
Executable file
@@ -0,0 +1,45 @@
|
||||
capslock = Bloq Majús
|
||||
err_alloc = falla d'assignació de memòria
|
||||
err_bounds = índex fora de límit
|
||||
err_chdir = error al obrir carpeta home
|
||||
err_console_dev = error al accedir a la consola
|
||||
err_dgn_oob = missatge de registre
|
||||
err_domain = domini invàlid
|
||||
err_hostname = error al obtenir el nom del host
|
||||
err_mlock = error al bloquejar la clau de memòria
|
||||
err_null = punter nul
|
||||
err_pam = error en la transacció pam
|
||||
err_pam_abort = transacció pam avortada
|
||||
err_pam_acct_expired = compte expirat
|
||||
err_pam_auth = error d'autenticació
|
||||
err_pam_authinfo_unavail = error al obtenir informació de l'usuari
|
||||
err_pam_authok_reqd = token expirat
|
||||
err_pam_buf = error de la memòria intermitja
|
||||
err_pam_cred_err = error al establir les credencials
|
||||
err_pam_cred_expired = credencials expirades
|
||||
err_pam_cred_insufficient = credencials insuficients
|
||||
err_pam_cred_unavail = error al obtenir credencials
|
||||
err_pam_maxtries = s'ha assolit al màxim nombre d'intents
|
||||
err_pam_perm_denied = permís denegat
|
||||
err_pam_session = error de sessió
|
||||
err_pam_sys = error de sistema
|
||||
err_pam_user_unknown = usuari desconegut
|
||||
err_path = error al establir la ruta
|
||||
err_perm_dir = error al canviar de directori actual
|
||||
err_perm_group = error al degradar els permisos de grup
|
||||
err_perm_user = error al degradar els permisos de l'usuari
|
||||
err_pwnam = error al obtenir la informació de l'usuari
|
||||
err_user_gid = error al establir el GID de l'usuari
|
||||
err_user_init = error al inicialitzar usuari
|
||||
err_user_uid = error al establir el UID de l'usuari
|
||||
err_xsessions_dir = error al cercar la carpeta de sessions
|
||||
err_xsessions_open = error al obrir la carpeta de sessions
|
||||
f1 = F1 aturar
|
||||
f2 = F2 reiniciar
|
||||
login = iniciar sessió
|
||||
logout = tancar sessió
|
||||
numlock = Bloq Num
|
||||
password = Clau
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
45
res/lang/cs.ini
Normal file
45
res/lang/cs.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = capslock
|
||||
err_alloc = alokace paměti selhala
|
||||
err_bounds = index je mimo hranice pole
|
||||
err_chdir = nelze otevřít domovský adresář
|
||||
err_console_dev = chyba při přístupi do konzole
|
||||
err_dgn_oob = zpráva protokolu
|
||||
err_domain = neplatná doména
|
||||
err_hostname = nelze získat název hostitele
|
||||
err_mlock = uzamčení paměti hesel selhalo
|
||||
err_null = nulový ukazatel
|
||||
err_pam = pam transakce selhala
|
||||
err_pam_abort = pam transakce přerušena
|
||||
err_pam_acct_expired = platnost účtu vypršela
|
||||
err_pam_auth = chyba autentizace
|
||||
err_pam_authinfo_unavail = nelze získat informace o uživateli
|
||||
err_pam_authok_reqd = platnost tokenu vypršela
|
||||
err_pam_buf = chyba vyrovnávací paměti
|
||||
err_pam_cred_err = nelze nastavit pověření
|
||||
err_pam_cred_expired = platnost pověření vypršela
|
||||
err_pam_cred_insufficient = nedostatečné pověření
|
||||
err_pam_cred_unavail = nepodařilo se získat pověření
|
||||
err_pam_maxtries = byl dosažen maximální počet pokusů
|
||||
err_pam_perm_denied = přístup odepřen
|
||||
err_pam_session = chyba relace
|
||||
err_pam_sys = systemová chyba
|
||||
err_pam_user_unknown = neznámý uživatel
|
||||
err_path = nepodařilo se nastavit cestu
|
||||
err_perm_dir = nepodařilo se změnit adresář
|
||||
err_perm_group = nepodařilo se snížit skupinová oprávnění
|
||||
err_perm_user = nepodařilo se snížit uživatelská oprávnění
|
||||
err_pwnam = nelze získat informace o uživateli
|
||||
err_user_gid = nastavení GID uživatele selhalo
|
||||
err_user_init = inicializace uživatele selhala
|
||||
err_user_uid = nastavení UID uživateli selhalo
|
||||
err_xsessions_dir = nepodařilo se najít složku relací
|
||||
err_xsessions_open = nepodařilo se otevřít složku relací
|
||||
f1 = F1 vypnout
|
||||
f2 = F2 restartovat
|
||||
login = uživatel
|
||||
logout = odhlášen
|
||||
numlock = numlock
|
||||
password = heslo
|
||||
shell = příkazový řádek
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
45
res/lang/de.ini
Normal file
45
res/lang/de.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = Feststelltaste
|
||||
err_alloc = Speicherzuweisung fehlgeschlagen
|
||||
err_bounds = Listenindex ist außerhalb des Bereichs
|
||||
err_chdir = Fehler beim oeffnen des home-ordners
|
||||
err_console_dev = Zugriff auf die Konsole fehlgeschlagen
|
||||
err_dgn_oob = Protokoll Nachricht
|
||||
err_domain = Unzulaessige domain
|
||||
err_hostname = Holen des Hostnames fehlgeschlagen
|
||||
err_mlock = Abschließen des Passwortspeichers fehlgeschlagen
|
||||
err_null = Null Zeiger
|
||||
err_pam = pam Transaktion fehlgeschlagen
|
||||
err_pam_abort = pam Transaktion abgebrochen
|
||||
err_pam_acct_expired = Benutzerkonto abgelaufen
|
||||
err_pam_auth = Authentifizierungs Fehler
|
||||
err_pam_authinfo_unavail = holen der Benutzerinformationen fehlgeschlagen
|
||||
err_pam_authok_reqd = Schluessel abgelaufen
|
||||
err_pam_buf = Speicherpufferfehler
|
||||
err_pam_cred_err = Fehler beim setzen der Anmeldedaten
|
||||
err_pam_cred_expired = Anmeldedaten abgelaufen
|
||||
err_pam_cred_insufficient = Anmeldedaten unzureichend
|
||||
err_pam_cred_unavail = Fehler beim holen der Anmeldedaten
|
||||
err_pam_maxtries = Maximale Versuche erreicht
|
||||
err_pam_perm_denied = Zugriff Verweigert
|
||||
err_pam_session = Sitzungsfehler
|
||||
err_pam_sys = Systemfehler
|
||||
err_pam_user_unknown = Unbekannter Nutzer
|
||||
err_path = Fehler beim setzen des Pfades
|
||||
err_perm_dir = Fehler beim wechseln des Ordners
|
||||
err_perm_group = Fehler beim heruntersetzen der Gruppen Berechtigungen
|
||||
err_perm_user = Fehler beim heruntersetzen der Nutzer Berechtigungen
|
||||
err_pwnam = Holen der Benutzerinformationen fehlgeschlagen
|
||||
err_user_gid = Fehler beim setzen der Gruppen Id des Nutzers
|
||||
err_user_init = Initialisierung des Nutzers fehlgeschlagen
|
||||
err_user_uid = Setzen der Benutzer Id fehlgeschlagen
|
||||
err_xsessions_dir = Fehler beim finden des Sitzungsordners
|
||||
err_xsessions_open = Fehler beim öffnen des Sitzungsordners
|
||||
f1 = F1 Herunterfahren
|
||||
f2 = F2 Neustarten
|
||||
login = Anmelden
|
||||
logout = Abgemeldet
|
||||
numlock = Numtaste
|
||||
password = Passwort
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
@@ -36,10 +36,10 @@ err_xsessions_dir = failed to find sessions folder
|
||||
err_xsessions_open = failed to open sessions folder
|
||||
f1 = F1 shutdown
|
||||
f2 = F2 reboot
|
||||
login = login:
|
||||
login = login
|
||||
logout = logged out
|
||||
numlock = numlock
|
||||
password = password:
|
||||
password = password
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
|
||||
@@ -15,7 +15,7 @@ err_pam_auth = error de autenticación
|
||||
err_pam_authinfo_unavail = error al obtener información del usuario
|
||||
err_pam_authok_reqd = token expirado
|
||||
err_pam_buf = error de la memoria intermedia
|
||||
err_pam_cred_err = error al establecer la credenciales
|
||||
err_pam_cred_err = error al establecer las credenciales
|
||||
err_pam_cred_expired = credenciales expiradas
|
||||
err_pam_cred_insufficient = credenciales insuficientes
|
||||
err_pam_cred_unavail = error al obtener credenciales
|
||||
@@ -30,16 +30,16 @@ err_perm_group = error al degradar los permisos del grupo
|
||||
err_perm_user = error al degradar los permisos del usuario
|
||||
err_pwnam = error al obtener la información del usuario
|
||||
err_user_gid = error al establecer el GID del usuario
|
||||
err_user_init = errpr al inicializar usuario
|
||||
err_user_init = error al inicializar usuario
|
||||
err_user_uid = error al establecer el UID del usuario
|
||||
err_xsessions_dir = error al buscar la carpeta de sesiones
|
||||
err_xsessions_open = error al abrir la carpeta de sesiones
|
||||
f1 = F1 apagar
|
||||
f2 = F2 reiniciar
|
||||
login = iniciar sesion:
|
||||
logout = cerrar sesion
|
||||
login = iniciar sesión
|
||||
logout = cerrar sesión
|
||||
numlock = Bloq Num
|
||||
password = contraseña:
|
||||
password = contraseña
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
|
||||
@@ -5,7 +5,7 @@ err_chdir = échec de l'ouverture du répertoire home
|
||||
err_console_dev = échec d'accès à la console
|
||||
err_dgn_oob = message
|
||||
err_domain = domaine invalide
|
||||
err_hostname = échec de captation du nom d'hôte
|
||||
err_hostname = échec de lecture du nom d'hôte
|
||||
err_mlock = échec du verrouillage mémoire
|
||||
err_null = pointeur null
|
||||
err_pam = échec de la transaction pam
|
||||
@@ -28,7 +28,7 @@ err_path = échec de la modification du path
|
||||
err_perm_dir = échec de changement de répertoire
|
||||
err_perm_group = échec du déclassement des permissions de groupe
|
||||
err_perm_user = échec du déclassement des permissions utilisateur
|
||||
err_pwnam = échec de captation des infos utilisateur
|
||||
err_pwnam = échec de lecture des infos utilisateur
|
||||
err_user_gid = échec de modification du GID
|
||||
err_user_init = échec d'initialisation de l'utilisateur
|
||||
err_user_uid = échec de modification du UID
|
||||
@@ -36,10 +36,10 @@ err_xsessions_dir = échec de la recherche du dossier de sessions
|
||||
err_xsessions_open = échec de l'ouverture du dossier de sessions
|
||||
f1 = F1 éteindre
|
||||
f2 = F2 redémarrer
|
||||
login = identifiant :
|
||||
login = identifiant
|
||||
logout = déconnection
|
||||
numlock = verr.num
|
||||
password = mot de passe :
|
||||
password = mot de passe
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
|
||||
45
res/lang/it.ini
Normal file
45
res/lang/it.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = capslock
|
||||
err_alloc = impossibile allocare memoria
|
||||
err_bounds = indice fuori limite
|
||||
err_chdir = impossibile aprire home directory
|
||||
err_console_dev = impossibile aprire console
|
||||
err_dgn_oob = messaggio log
|
||||
err_domain = dominio non valido
|
||||
err_hostname = impossibile ottenere hostname
|
||||
err_mlock = impossibile ottenere lock per la password in memoria
|
||||
err_null = puntatore nullo
|
||||
err_pam = transazione PAM fallita
|
||||
err_pam_abort = transazione PAM interrotta
|
||||
err_pam_acct_expired = account scaduto
|
||||
err_pam_auth = errore di autenticazione
|
||||
err_pam_authinfo_unavail = impossibile ottenere informazioni utente
|
||||
err_pam_authok_reqd = token scaduto
|
||||
err_pam_buf = errore buffer memoria
|
||||
err_pam_cred_err = impossibile impostare credenziali
|
||||
err_pam_cred_expired = credenziali scadute
|
||||
err_pam_cred_insufficient = credenziali insufficienti
|
||||
err_pam_cred_unavail = impossibile ottenere credenziali
|
||||
err_pam_maxtries = raggiunto limite tentativi
|
||||
err_pam_perm_denied = permesso negato
|
||||
err_pam_session = errore di sessione
|
||||
err_pam_sys = errore di sistema
|
||||
err_pam_user_unknown = utente sconosciuto
|
||||
err_path = impossibile impostare percorso
|
||||
err_perm_dir = impossibile cambiare directory corrente
|
||||
err_perm_group = impossibile ridurre permessi gruppo
|
||||
err_perm_user = impossibile ridurre permessi utente
|
||||
err_pwnam = impossibile ottenere dati utente
|
||||
err_user_gid = impossibile impostare GID utente
|
||||
err_user_init = impossibile inizializzare utente
|
||||
err_user_uid = impossible impostare UID utente
|
||||
err_xsessions_dir = impossibile localizzare cartella sessioni
|
||||
err_xsessions_open = impossibile aprire cartella sessioni
|
||||
f1 = F1 arresto
|
||||
f2 = F2 riavvio
|
||||
login = username
|
||||
logout = scollegato
|
||||
numlock = numlock
|
||||
password = password
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
45
res/lang/pl.ini
Normal file
45
res/lang/pl.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = capslock
|
||||
err_alloc = nieudana alokacja pamięci
|
||||
err_bounds = indeks poza granicami
|
||||
err_chdir = nie udało się otworzyć folderu domowego
|
||||
err_console_dev = nie udało się uzyskać dostępu do konsoli
|
||||
err_dgn_oob = wiadomość loga
|
||||
err_domain = niepoprawna domena
|
||||
err_hostname = nie udało się uzyskać nazwy hosta
|
||||
err_mlock = nie udało się zablokować pamięci haseł
|
||||
err_null = wskaźnik zerowy
|
||||
err_pam = transakcja pam nieudana
|
||||
err_pam_abort = transakcja pam przerwana
|
||||
err_pam_acct_expired = konto wygasło
|
||||
err_pam_auth = błąd autentyfikacji
|
||||
err_pam_authinfo_unavail = nie udało się zdobyć informacji o użytkowniku
|
||||
err_pam_authok_reqd = token wygasł
|
||||
err_pam_buf = błąd bufora pamięci
|
||||
err_pam_cred_err = nie udało się ustawić uwierzytelnienia
|
||||
err_pam_cred_expired = uwierzytelnienie wygasło
|
||||
err_pam_cred_insufficient = niewystarczające uwierzytelnienie
|
||||
err_pam_cred_unavail = nie udało się uzyskać uwierzytelnienia
|
||||
err_pam_maxtries = osiągnięto limit prób
|
||||
err_pam_perm_denied = brak uprawnień
|
||||
err_pam_session = błąd sesji
|
||||
err_pam_sys = błąd systemu
|
||||
err_pam_user_unknown = nieznany użytkownik
|
||||
err_path = nie udało się ustawić ścieżki
|
||||
err_perm_dir = nie udało się zmienić obecnego katalogu
|
||||
err_perm_group = nie udało się obniżyć uprawnień grupy
|
||||
err_perm_user = nie udało się obniżyć uprawnień użytkownika
|
||||
err_pwnam = nie udało się uzyskać informacji o użytkowniku
|
||||
err_user_gid = nie udało się ustawić GID użytkownika
|
||||
err_user_init = nie udało się zainicjalizować użytkownika
|
||||
err_user_uid = nie udało się ustawić UID użytkownika
|
||||
err_xsessions_dir = nie udało się znaleźć folderu sesji
|
||||
err_xsessions_open = nie udało się otworzyć folderu sesji
|
||||
f1 = F1 wyłącz
|
||||
f2 = F2 uruchom ponownie
|
||||
login = login
|
||||
logout = wylogowano
|
||||
numlock = numlock
|
||||
password = hasło
|
||||
shell = powłoka
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
@@ -1,45 +1,45 @@
|
||||
capslock = caixa alta
|
||||
err_alloc = alocação de memória malsucedida
|
||||
capslock = capslock
|
||||
err_alloc = erro na atribuição de memória
|
||||
err_bounds = índice fora de limites
|
||||
err_chdir = não foi possível abrir o diretório home
|
||||
err_console_dev = não foi possível acessar o console
|
||||
err_dgn_oob = mensagem de log
|
||||
err_chdir = erro ao abrir a pasta home
|
||||
err_console_dev = erro ao aceder à consola
|
||||
err_dgn_oob = mensagem de registo
|
||||
err_domain = domínio inválido
|
||||
err_hostname = não foi possível obter o nome do host
|
||||
err_mlock = bloqueio da memória de senha malsucedido
|
||||
err_hostname = erro ao obter o nome do host
|
||||
err_mlock = erro de bloqueio de memória
|
||||
err_null = ponteiro nulo
|
||||
err_pam = transação pam malsucedida
|
||||
err_pam = erro na transação pam
|
||||
err_pam_abort = transação pam abortada
|
||||
err_pam_acct_expired = conta expirada
|
||||
err_pam_auth = erro de autenticação
|
||||
err_pam_authinfo_unavail = não foi possível obter informações do usuário
|
||||
err_pam_authok_reqd = token expirada
|
||||
err_pam_authinfo_unavail = erro ao obter informação do utilizador
|
||||
err_pam_authok_reqd = token expirado
|
||||
err_pam_buf = erro de buffer de memória
|
||||
err_pam_cred_err = erro para definir credenciais
|
||||
err_pam_cred_err = erro ao definir credenciais
|
||||
err_pam_cred_expired = credenciais expiradas
|
||||
err_pam_cred_insufficient = credenciais insuficientes
|
||||
err_pam_cred_unavail = não foi possível obter credenciais
|
||||
err_pam_cred_unavail = erro ao obter credenciais
|
||||
err_pam_maxtries = limite máximo de tentativas atingido
|
||||
err_pam_perm_denied = permissão negada
|
||||
err_pam_session = erro de sessão
|
||||
err_pam_sys = erro de sistema
|
||||
err_pam_user_unknown = usuário desconhecido
|
||||
err_path = não foi possível definir o caminho
|
||||
err_perm_dir = não foi possível alterar o diretório atual
|
||||
err_perm_group = não foi possível reduzir as permissões de grupo
|
||||
err_perm_user = não foi possível reduzir as permissões de usuário
|
||||
err_pwnam = não foi possível obter informações do usuário
|
||||
err_user_gid = não foi possível definir o GID do usuário
|
||||
err_user_init = não foi possível iniciar o usuário
|
||||
err_user_uid = não foi possível definir o UID do usuário
|
||||
err_xsessions_dir = não foi possível encontrar a pasta das sessões
|
||||
err_xsessions_open = não foi possível abrir a pasta das sessões
|
||||
f1 = F1 desligar
|
||||
err_pam_user_unknown = utilizador desconhecido
|
||||
err_path = erro ao definir o caminho de acesso
|
||||
err_perm_dir = erro ao alterar o diretório atual
|
||||
err_perm_group = erro ao reduzir as permissões do grupo
|
||||
err_perm_user = erro ao reduzir as permissões do utilizador
|
||||
err_pwnam = erro ao obter informação do utilizador
|
||||
err_user_gid = erro ao definir o GID do utilizador
|
||||
err_user_init = erro ao iniciar o utilizador
|
||||
err_user_uid = erro ao definir o UID do utilizador
|
||||
err_xsessions_dir = erro ao localizar a pasta das sessões
|
||||
err_xsessions_open = erro ao abrir a pasta das sessões
|
||||
f1 = F1 encerrar
|
||||
f2 = F2 reiniciar
|
||||
login = conectar:
|
||||
logout = desconectado
|
||||
login = iniciar sessão
|
||||
logout = terminar sessão
|
||||
numlock = numlock
|
||||
password = senha:
|
||||
password = palavra-passe
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
|
||||
45
res/lang/pt_BR.ini
Normal file
45
res/lang/pt_BR.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = caixa alta
|
||||
err_alloc = alocação de memória malsucedida
|
||||
err_bounds = índice fora de limites
|
||||
err_chdir = não foi possível abrir o diretório home
|
||||
err_console_dev = não foi possível acessar o console
|
||||
err_dgn_oob = mensagem de log
|
||||
err_domain = domínio inválido
|
||||
err_hostname = não foi possível obter o nome do host
|
||||
err_mlock = bloqueio da memória de senha malsucedido
|
||||
err_null = ponteiro nulo
|
||||
err_pam = transação pam malsucedida
|
||||
err_pam_abort = transação pam abortada
|
||||
err_pam_acct_expired = conta expirada
|
||||
err_pam_auth = erro de autenticação
|
||||
err_pam_authinfo_unavail = não foi possível obter informações do usuário
|
||||
err_pam_authok_reqd = token expirada
|
||||
err_pam_buf = erro de buffer de memória
|
||||
err_pam_cred_err = erro para definir credenciais
|
||||
err_pam_cred_expired = credenciais expiradas
|
||||
err_pam_cred_insufficient = credenciais insuficientes
|
||||
err_pam_cred_unavail = não foi possível obter credenciais
|
||||
err_pam_maxtries = limite máximo de tentativas atingido
|
||||
err_pam_perm_denied = permissão negada
|
||||
err_pam_session = erro de sessão
|
||||
err_pam_sys = erro de sistema
|
||||
err_pam_user_unknown = usuário desconhecido
|
||||
err_path = não foi possível definir o caminho
|
||||
err_perm_dir = não foi possível alterar o diretório atual
|
||||
err_perm_group = não foi possível reduzir as permissões de grupo
|
||||
err_perm_user = não foi possível reduzir as permissões de usuário
|
||||
err_pwnam = não foi possível obter informações do usuário
|
||||
err_user_gid = não foi possível definir o GID do usuário
|
||||
err_user_init = não foi possível iniciar o usuário
|
||||
err_user_uid = não foi possível definir o UID do usuário
|
||||
err_xsessions_dir = não foi possível encontrar a pasta das sessões
|
||||
err_xsessions_open = não foi possível abrir a pasta das sessões
|
||||
f1 = F1 desligar
|
||||
f2 = F2 reiniciar
|
||||
login = conectar
|
||||
logout = desconectado
|
||||
numlock = numlock
|
||||
password = senha
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
@@ -36,10 +36,10 @@ err_perm_user = nu s-a putut face downgrade permisiunilor de utilizator
|
||||
|
||||
f1 = F1 opreşte sistemul
|
||||
f2 = F2 resetează
|
||||
login = utilizator:
|
||||
login = utilizator
|
||||
logout = opreşte sesiunea
|
||||
numlock = numlock
|
||||
password = parolă:
|
||||
password = parolă
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
|
||||
@@ -10,17 +10,17 @@ err_mlock = сбой блокировки памяти
|
||||
err_null = нулевой указатель
|
||||
err_pam = pam транзакция не удалась
|
||||
err_pam_abort = pam транзакция прервана
|
||||
err_pam_acct_expired = срок действия аккаунта истек
|
||||
err_pam_acct_expired = срок действия аккаунта истёк
|
||||
err_pam_auth = ошибка аутентификации
|
||||
err_pam_authinfo_unavail = не удалось получить информацию о пользователе
|
||||
err_pam_authok_reqd = токен истек
|
||||
err_pam_authok_reqd = токен истёк
|
||||
err_pam_buf = ошибка буфера памяти
|
||||
err_pam_cred_err = не удалось установить полномочия
|
||||
err_pam_cred_expired = полномочия истекли
|
||||
err_pam_cred_insufficient = недостаточо полномочий
|
||||
err_pam_cred_insufficient = недостаточно полномочий
|
||||
err_pam_cred_unavail = не удалось получить полномочия
|
||||
err_pam_maxtries = лимит попыток исчерпан
|
||||
err_pam_perm_denied = доступ запрещен
|
||||
err_pam_perm_denied = доступ запрещён
|
||||
err_pam_session = ошибка сессии
|
||||
err_pam_sys = системная ошибка
|
||||
err_pam_user_unknown = неизвестный пользователь
|
||||
@@ -36,10 +36,10 @@ err_xsessions_dir = не удалось найти сессионную папк
|
||||
err_xsessions_open = не удалось открыть сессионную папку
|
||||
f1 = F1 выключить
|
||||
f2 = F2 перезагрузить
|
||||
login = логин:
|
||||
login = логин
|
||||
logout = logged out
|
||||
numlock = numlock
|
||||
password = пароль:
|
||||
password = пароль
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
|
||||
45
res/lang/sr.ini
Normal file
45
res/lang/sr.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = capslock
|
||||
err_alloc = neuspijesna alokacija memorije
|
||||
err_bounds = izvan granica indeksa
|
||||
err_chdir = neuspijesno otvaranje home foldera
|
||||
err_console_dev = neuspijesno pristupanje konzoli
|
||||
err_dgn_oob = log poruka
|
||||
err_domain = nevazeci domen
|
||||
err_hostname = neuspijesno trazenje hostname-a
|
||||
err_mlock = neuspijesno zakljucavanje memorije lozinke
|
||||
err_null = null pokazivac
|
||||
err_pam = pam transakcija neuspijesna
|
||||
err_pam_abort = pam transakcija prekinuta
|
||||
err_pam_acct_expired = nalog istekao
|
||||
err_pam_auth = greska pri autentikaciji
|
||||
err_pam_authinfo_unavail = neuspjelo uzimanje informacija o korisniku
|
||||
err_pam_authok_reqd = token istekao
|
||||
err_pam_buf = greska bafera memorije
|
||||
err_pam_cred_err = neuspjelo postavljanje kredencijala
|
||||
err_pam_cred_expired = kredencijali istekli
|
||||
err_pam_cred_insufficient = nedovoljni kredencijali
|
||||
err_pam_cred_unavail = neuspjelo uzimanje kredencijala
|
||||
err_pam_maxtries = dostignut maksimalan broj pokusaja
|
||||
err_pam_perm_denied = nedozovoljeno
|
||||
err_pam_session = greska sesije
|
||||
err_pam_sys = greska sistema
|
||||
err_pam_user_unknown = nepoznat korisnik
|
||||
err_path = neuspjelo postavljanje path-a
|
||||
err_perm_dir = neuspjelo mijenjanje foldera
|
||||
err_perm_group = neuspjesno snizavanje dozvola grupe
|
||||
err_perm_user = neuspijesno snizavanje dozvola korisnika
|
||||
err_pwnam = neuspijesno skupljanje informacija o korisniku
|
||||
err_user_gid = neuspijesno postavljanje korisničkog GID-a
|
||||
err_user_init = neuspijensa inicijalizacija korisnika
|
||||
err_user_uid = neuspijesno postavljanje UID-a korisnika
|
||||
err_xsessions_dir = neuspijesno pronalazenje foldera sesija
|
||||
err_xsessions_open = neuspijesno otvaranje foldera sesija
|
||||
f1 = F1 ugasi
|
||||
f2 = F2 ponovo pokreni
|
||||
login = korisnik
|
||||
logout = izlogovan
|
||||
numlock = numlock
|
||||
password = lozinka
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
45
res/lang/sv.ini
Normal file
45
res/lang/sv.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = capslock
|
||||
err_alloc = misslyckad minnesallokering
|
||||
err_bounds = utanför banan index
|
||||
err_chdir = misslyckades att öppna hemkatalog
|
||||
err_console_dev = misslyckades att komma åt konsol
|
||||
err_dgn_oob = loggmeddelande
|
||||
err_domain = okänd domän
|
||||
err_hostname = misslyckades att hämta värdnamn
|
||||
err_mlock = misslyckades att låsa lösenordsminne
|
||||
err_null = nullpekare
|
||||
err_pam = pam-transaktion misslyckades
|
||||
err_pam_abort = pam-transaktion avbröts
|
||||
err_pam_acct_expired = konto upphört
|
||||
err_pam_auth = autentiseringsfel
|
||||
err_pam_authinfo_unavail = misslyckades att hämta användarinfo
|
||||
err_pam_authok_reqd = token utgången
|
||||
err_pam_buf = minnesbuffer fel
|
||||
err_pam_cred_err = misslyckades att ställa in inloggningsuppgifter
|
||||
err_pam_cred_expired = inloggningsuppgifter upphörda
|
||||
err_pam_cred_insufficient = otillräckliga inloggningsuppgifter
|
||||
err_pam_cred_unavail = misslyckades att hämta inloggningsuppgifter
|
||||
err_pam_maxtries = nådde maximal försöksgräns
|
||||
err_pam_perm_denied = åtkomst nekad
|
||||
err_pam_session = sessionsfel
|
||||
err_pam_sys = systemfel
|
||||
err_pam_user_unknown = okänd användare
|
||||
err_path = misslyckades att ställa in sökväg
|
||||
err_perm_dir = misslyckades att ändra aktuell katalog
|
||||
err_perm_group = misslyckades att nergradera gruppbehörigheter
|
||||
err_perm_user = misslyckades att nergradera användarbehörigheter
|
||||
err_pwnam = misslyckades att hämta användarinfo
|
||||
err_user_gid = misslyckades att ställa in användar-GID
|
||||
err_user_init = misslyckades att initialisera användaren
|
||||
err_user_uid = misslyckades att ställa in användar-UID
|
||||
err_xsessions_dir = misslyckades att hitta sessionskatalog
|
||||
err_xsessions_open = misslyckades att öppna sessionskatalog
|
||||
f1 = F1 stäng av
|
||||
f2 = F2 starta om
|
||||
login = inloggad
|
||||
logout = utloggad
|
||||
numlock = numlock
|
||||
password = lösenord
|
||||
shell = skal
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
45
res/lang/tr.ini
Normal file
45
res/lang/tr.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = capslock
|
||||
err_alloc = basarisiz bellek ayirma
|
||||
err_bounds = sinirlarin disinda dizin
|
||||
err_chdir = ev klasoru acilamadi
|
||||
err_console_dev = konsola erisilemedi
|
||||
err_dgn_oob = log mesaji
|
||||
err_domain = gecersiz etki alani
|
||||
err_hostname = ana bilgisayar adi alinamadi
|
||||
err_mlock = parola bellegi kilitlenemedi
|
||||
err_null = bos isaretci hatasi
|
||||
err_pam = pam islemi basarisiz oldu
|
||||
err_pam_abort = pam islemi durduruldu
|
||||
err_pam_acct_expired = hesabin suresi dolmus
|
||||
err_pam_auth = kimlik dogrulama hatasi
|
||||
err_pam_authinfo_unavail = kullanici bilgileri getirilirken hata olustu
|
||||
err_pam_authok_reqd = suresi dolmus token
|
||||
err_pam_buf = bellek arabellegi hatasi
|
||||
err_pam_cred_err = kimlik bilgileri ayarlanamadi
|
||||
err_pam_cred_expired = kimlik bilgilerinin suresi dolmus
|
||||
err_pam_cred_insufficient = yetersiz kimlik bilgileri
|
||||
err_pam_cred_unavail = kimlik bilgileri alinamadi
|
||||
err_pam_maxtries = en fazla deneme sinirina ulasildi
|
||||
err_pam_perm_denied = izin reddedildi
|
||||
err_pam_session = oturum hatasi
|
||||
err_pam_sys = sistem hatasi
|
||||
err_pam_user_unknown = bilinmeyen kullanici
|
||||
err_path = yol ayarlanamadi
|
||||
err_perm_dir = gecerli dizin degistirilemedi
|
||||
err_perm_group = grup izinleri dusurulemedi
|
||||
err_perm_user = kullanici izinleri dusurulemedi
|
||||
err_pwnam = kullanici bilgileri alinamadi
|
||||
err_user_gid = kullanici icin GID ayarlanamadi
|
||||
err_user_init = kullanici oturumu baslatilamadi
|
||||
err_user_uid = kullanici icin UID ayarlanamadi
|
||||
err_xsessions_dir = oturumlar klasoru bulunamadi
|
||||
err_xsessions_open = oturumlar klasoru acilamadi
|
||||
f1 = F1 makineyi kapat
|
||||
f2 = F2 yeniden baslat
|
||||
login = kullanici
|
||||
logout = oturumdan cikis yapildi
|
||||
numlock = numlock
|
||||
password = sifre
|
||||
shell = shell
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
45
res/lang/uk.ini
Normal file
45
res/lang/uk.ini
Normal file
@@ -0,0 +1,45 @@
|
||||
capslock = capslock
|
||||
err_alloc = невдале виділення пам'яті
|
||||
err_bounds = поза межами індексу
|
||||
err_chdir = не вдалося відкрити домашній каталог
|
||||
err_console_dev = невдалий доступ до консолі
|
||||
err_dgn_oob = повідомлення журналу (log)
|
||||
err_domain = недійсний домен
|
||||
err_hostname = не вдалося отримати ім'я хосту
|
||||
err_mlock = збій блокування пам'яті
|
||||
err_null = нульовий вказівник
|
||||
err_pam = невдала pam транзакція
|
||||
err_pam_abort = pam транзакція перервана
|
||||
err_pam_acct_expired = термін дії акаунту вичерпано
|
||||
err_pam_auth = помилка автентифікації
|
||||
err_pam_authinfo_unavail = не вдалося отримати дані користувача
|
||||
err_pam_authok_reqd = термін дії токена вичерпано
|
||||
err_pam_buf = помилка буферу пам'яті
|
||||
err_pam_cred_err = не вдалося змінити облікові дані
|
||||
err_pam_cred_expired = термін дії повноважень вичерпано
|
||||
err_pam_cred_insufficient = недостатньо облікових даних
|
||||
err_pam_cred_unavail = не вдалося отримати облікові дані
|
||||
err_pam_maxtries = вичерпано ліміт спроб
|
||||
err_pam_perm_denied = відмовлено у доступі
|
||||
err_pam_session = помилка сесії
|
||||
err_pam_sys = системна помилка
|
||||
err_pam_user_unknown = невідомий користувач
|
||||
err_path = не вдалося змінити шлях
|
||||
err_perm_dir = не вдалося змінити поточний каталог
|
||||
err_perm_group = не вдалося понизити права доступу групи
|
||||
err_perm_user = не вдалося понизити права доступу користувача
|
||||
err_pwnam = не вдалося отримати дані користувача
|
||||
err_user_gid = не вдалося змінити GID користувача
|
||||
err_user_init = не вдалося ініціалізувати користувача
|
||||
err_user_uid = не вдалося змінити UID користувача
|
||||
err_xsessions_dir = не вдалося знайти каталог сесій
|
||||
err_xsessions_open = не вдалося відкрити каталог сесій
|
||||
f1 = F1 вимкнути
|
||||
f2 = F2 перезавантажити
|
||||
login = логін
|
||||
logout = вийти
|
||||
numlock = numlock
|
||||
password = пароль
|
||||
shell = оболонка
|
||||
wayland = wayland
|
||||
xinitrc = xinitrc
|
||||
38
res/ly-openrc
Normal file
38
res/ly-openrc
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="ly"
|
||||
description="TUI Display Manager"
|
||||
|
||||
## Supervisor daemon
|
||||
supervisor=supervise-daemon
|
||||
respawn_period=60
|
||||
pidfile=/run/"${RC_SVCNAME}.pid"
|
||||
|
||||
## Check for getty or agetty
|
||||
if [ -x /sbin/getty ] || [ -x /bin/getty ];
|
||||
then
|
||||
# busybox
|
||||
commandB="/sbin/getty"
|
||||
elif [ -x /sbin/agetty ] || [ -x /bin/agetty ];
|
||||
then
|
||||
# util-linux
|
||||
commandUL="/sbin/agetty"
|
||||
fi
|
||||
|
||||
## Get the tty from the conf file
|
||||
CONFTTY=$(cat /etc/ly/config.ini | sed -n 's/^tty.*=[^1-9]*// p')
|
||||
|
||||
## The execution vars
|
||||
# If CONFTTY is empty then default to 2
|
||||
TTY="tty${CONFTTY:-2}"
|
||||
TERM=linux
|
||||
BAUD=38400
|
||||
# If we don't have getty then we should have agetty
|
||||
command=${commandB:-$commandUL}
|
||||
command_args_foreground="-nl /usr/bin/ly $TTY $BAUD $TERM"
|
||||
|
||||
depend() {
|
||||
after agetty
|
||||
provide display-manager
|
||||
want elogind
|
||||
}
|
||||
12
res/ly-runit-service/conf
Normal file
12
res/ly-runit-service/conf
Normal file
@@ -0,0 +1,12 @@
|
||||
if [ -x /sbin/agetty -o -x /bin/agetty ]; then
|
||||
# util-linux specific settings
|
||||
if [ "${tty}" = "tty1" ]; then
|
||||
GETTY_ARGS="--noclear"
|
||||
fi
|
||||
fi
|
||||
|
||||
BAUD_RATE=38400
|
||||
TERM_NAME=linux
|
||||
|
||||
auxtty=$(/bin/cat /etc/ly/config.ini 2>/dev/null 1| /bin/sed -n 's/\(^[[:space:]]*tty[[:space:]]*=[[:space:]]*\)\([[:digit:]][[:digit:]]*\)\(.*\)/\2/p')
|
||||
TTY=tty${auxtty:-2}
|
||||
4
res/ly-runit-service/finish
Normal file
4
res/ly-runit-service/finish
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
[ -r conf ] && . ./conf
|
||||
|
||||
exec utmpset -w ${TTY}
|
||||
13
res/ly-runit-service/run
Normal file
13
res/ly-runit-service/run
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -r conf ] && . ./conf
|
||||
|
||||
if [ -x /sbin/getty -o -x /bin/getty ]; then
|
||||
# busybox
|
||||
GETTY=getty
|
||||
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
|
||||
# util-linux
|
||||
GETTY=agetty
|
||||
fi
|
||||
|
||||
exec setsid ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly "${TTY}" "${BAUD_RATE}" "${TERM_NAME}"
|
||||
@@ -51,4 +51,4 @@ case $SHELL in
|
||||
;;
|
||||
esac
|
||||
|
||||
exec $@
|
||||
exec "$@"
|
||||
|
||||
@@ -90,6 +90,7 @@ elif [ -f /etc/X11/Xresources ]; then
|
||||
xrdb -merge /etc/X11/Xresources
|
||||
fi
|
||||
[ -f $HOME/.Xresources ] && xrdb -merge $HOME/.Xresources
|
||||
[ -f $XDG_CONFIG_HOME/X11/Xresources ] && xrdb -merge $XDG_CONFIG_HOME/X11/Xresources
|
||||
|
||||
if [ -f "$USERXSESSION" ]; then
|
||||
. "$USERXSESSION"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/usr/bin/ly -- gen_context(system_u:object_r:ly_exec_t,s0)
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
## <summary>policy for ly</summary>
|
||||
|
||||
########################################
|
||||
## <summary>
|
||||
## Execute ly_exec_t in the ly domain.
|
||||
## </summary>
|
||||
## <param name="domain">
|
||||
## <summary>
|
||||
## Domain allowed to transition.
|
||||
## </summary>
|
||||
## </param>
|
||||
#
|
||||
interface(`ly_domtrans',`
|
||||
gen_require(`
|
||||
type ly_t, ly_exec_t;
|
||||
')
|
||||
|
||||
corecmd_search_bin($1)
|
||||
domtrans_pattern($1, ly_exec_t, ly_t)
|
||||
')
|
||||
|
||||
######################################
|
||||
## <summary>
|
||||
## Execute ly in the caller domain.
|
||||
## </summary>
|
||||
## <param name="domain">
|
||||
## <summary>
|
||||
## Domain allowed access.
|
||||
## </summary>
|
||||
## </param>
|
||||
#
|
||||
interface(`ly_exec',`
|
||||
gen_require(`
|
||||
type ly_exec_t;
|
||||
')
|
||||
|
||||
corecmd_search_bin($1)
|
||||
can_exec($1, ly_exec_t)
|
||||
')
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
policy_module(ly, 1.0.0)
|
||||
|
||||
########################################
|
||||
#
|
||||
# Declarations
|
||||
#
|
||||
|
||||
type ly_t;
|
||||
type ly_exec_t;
|
||||
init_daemon_domain(ly_t, ly_exec_t)
|
||||
|
||||
permissive ly_t;
|
||||
|
||||
########################################
|
||||
#
|
||||
# ly local policy
|
||||
#
|
||||
allow ly_t self:capability { setgid setuid };
|
||||
allow ly_t self:process { fork signal_perms };
|
||||
allow ly_t self:process transition;
|
||||
allow ly_t self:fifo_file rw_fifo_file_perms;
|
||||
allow ly_t self:unix_stream_socket create_stream_socket_perms;
|
||||
|
||||
domain_use_interactive_fds(ly_t)
|
||||
|
||||
files_read_etc_files(ly_t)
|
||||
|
||||
auth_use_nsswitch(ly_t)
|
||||
|
||||
logging_send_audit_msgs(ly_t)
|
||||
|
||||
miscfiles_read_localization(ly_t)
|
||||
146
src/bigclock.h
Normal file
146
src/bigclock.h
Normal file
@@ -0,0 +1,146 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#define CLOCK_W 5
|
||||
#define CLOCK_H 5
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
#define X 0x2593
|
||||
#define _ 0x0000
|
||||
#else
|
||||
#define X '#'
|
||||
#define _ 0
|
||||
#endif
|
||||
|
||||
#if CLOCK_W == 5 && CLOCK_H == 5
|
||||
|
||||
uint32_t CLOCK_0[] = {
|
||||
X,X,X,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,X,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_1[] = {
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_2[] = {
|
||||
X,X,X,X,X,
|
||||
_,_,_,X,X,
|
||||
X,X,X,X,X,
|
||||
X,X,_,_,_,
|
||||
X,X,X,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_3[] = {
|
||||
X,X,X,X,X,
|
||||
_,_,_,X,X,
|
||||
X,X,X,X,X,
|
||||
_,_,_,X,X,
|
||||
X,X,X,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_4[] = {
|
||||
X,X,_,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,X,X,X,
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_5[] = {
|
||||
X,X,X,X,X,
|
||||
X,X,_,_,_,
|
||||
X,X,X,X,X,
|
||||
_,_,_,X,X,
|
||||
X,X,X,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_6[] = {
|
||||
X,X,X,X,X,
|
||||
X,X,_,_,_,
|
||||
X,X,X,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,X,X,X,
|
||||
};
|
||||
|
||||
uint32_t CLOCK_7[] = {
|
||||
X,X,X,X,X,
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X,
|
||||
_,_,_,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_8[] = {
|
||||
X,X,X,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,X,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,X,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_9[] = {
|
||||
X,X,X,X,X,
|
||||
X,X,_,X,X,
|
||||
X,X,X,X,X,
|
||||
_,_,_,X,X,
|
||||
X,X,X,X,X
|
||||
};
|
||||
|
||||
uint32_t CLOCK_S[] = {
|
||||
_,_,_,_,_,
|
||||
_,_,X,_,_,
|
||||
_,_,_,_,_,
|
||||
_,_,X,_,_,
|
||||
_,_,_,_,_
|
||||
};
|
||||
|
||||
uint32_t CLOCK_E[] = {
|
||||
_,_,_,_,_,
|
||||
_,_,_,_,_,
|
||||
_,_,_,_,_,
|
||||
_,_,_,_,_,
|
||||
_,_,_,_,_
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#undef X
|
||||
#undef _
|
||||
|
||||
static inline uint32_t* CLOCK_N(char c)
|
||||
{
|
||||
switch(c)
|
||||
{
|
||||
case '0':
|
||||
return CLOCK_0;
|
||||
case '1':
|
||||
return CLOCK_1;
|
||||
case '2':
|
||||
return CLOCK_2;
|
||||
case '3':
|
||||
return CLOCK_3;
|
||||
case '4':
|
||||
return CLOCK_4;
|
||||
case '5':
|
||||
return CLOCK_5;
|
||||
case '6':
|
||||
return CLOCK_6;
|
||||
case '7':
|
||||
return CLOCK_7;
|
||||
case '8':
|
||||
return CLOCK_8;
|
||||
case '9':
|
||||
return CLOCK_9;
|
||||
case ':':
|
||||
return CLOCK_S;
|
||||
default:
|
||||
return CLOCK_E;
|
||||
}
|
||||
}
|
||||
21
src/config.c
21
src/config.c
@@ -2,7 +2,9 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -30,11 +32,11 @@ static void config_handle_u8(void* data, char** pars, const int pars_count)
|
||||
{
|
||||
if (strcmp(*pars, "") == 0)
|
||||
{
|
||||
*((u8*)data) = 0;
|
||||
*((uint8_t*)data) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*((u8*)data) = atoi(*pars);
|
||||
*((uint8_t*)data) = atoi(*pars);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,11 +44,11 @@ static void config_handle_u16(void* data, char** pars, const int pars_count)
|
||||
{
|
||||
if (strcmp(*pars, "") == 0)
|
||||
{
|
||||
*((u16*)data) = 0;
|
||||
*((uint16_t*)data) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*((u16*)data) = atoi(*pars);
|
||||
*((uint16_t*)data) = atoi(*pars);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,12 +161,15 @@ void config_load(const char *cfg_path)
|
||||
{"animation", &config.animation, config_handle_u8},
|
||||
{"asterisk", &config.asterisk, config_handle_char},
|
||||
{"bg", &config.bg, config_handle_u8},
|
||||
{"bigclock", &config.bigclock, config_handle_bool},
|
||||
{"blank_box", &config.blank_box, config_handle_bool},
|
||||
{"blank_password", &config.blank_password, config_handle_bool},
|
||||
{"clock", &config.clock, config_handle_str},
|
||||
{"console_dev", &config.console_dev, config_handle_str},
|
||||
{"default_input", &config.default_input, config_handle_u8},
|
||||
{"fg", &config.fg, config_handle_u8},
|
||||
{"hide_borders", &config.hide_borders, config_handle_bool},
|
||||
{"hide_f1_commands", &config.hide_f1_commands, config_handle_bool},
|
||||
{"input_len", &config.input_len, config_handle_u8},
|
||||
{"lang", &config.lang, config_handle_str},
|
||||
{"load", &config.load, config_handle_bool},
|
||||
@@ -187,6 +192,7 @@ void config_load(const char *cfg_path)
|
||||
{"wayland_specifier", &config.wayland_specifier, config_handle_bool},
|
||||
{"waylandsessions", &config.waylandsessions, config_handle_str},
|
||||
{"x_cmd", &config.x_cmd, config_handle_str},
|
||||
{"xinitrc", &config.xinitrc, config_handle_str},
|
||||
{"x_cmd_setup", &config.x_cmd_setup, config_handle_str},
|
||||
{"xauth_cmd", &config.xauth_cmd, config_handle_str},
|
||||
{"xsessions", &config.xsessions, config_handle_str},
|
||||
@@ -265,10 +271,12 @@ void config_defaults()
|
||||
config.animation = 0;
|
||||
config.asterisk = '*';
|
||||
config.bg = 0;
|
||||
config.bigclock = false;
|
||||
config.blank_box = true;
|
||||
config.blank_password = false;
|
||||
config.clock = NULL;
|
||||
config.console_dev = strdup("/dev/console");
|
||||
config.default_input = PASSWORD_INPUT;
|
||||
config.default_input = LOGIN_INPUT;
|
||||
config.fg = 9;
|
||||
config.hide_borders = false;
|
||||
config.input_len = 34;
|
||||
@@ -293,6 +301,7 @@ void config_defaults()
|
||||
config.wayland_specifier = false;
|
||||
config.waylandsessions = strdup("/usr/share/wayland-sessions");
|
||||
config.x_cmd = strdup("/usr/bin/X");
|
||||
config.xinitrc = strdup("~/.xinitrc");
|
||||
config.x_cmd_setup = strdup(DATADIR "/xsetup.sh");
|
||||
config.xauth_cmd = strdup("/usr/bin/xauth");
|
||||
config.xsessions = strdup("/usr/share/xsessions");
|
||||
@@ -349,6 +358,7 @@ void lang_free()
|
||||
|
||||
void config_free()
|
||||
{
|
||||
free(config.clock);
|
||||
free(config.console_dev);
|
||||
free(config.lang);
|
||||
free(config.mcookie_cmd);
|
||||
@@ -361,6 +371,7 @@ void config_free()
|
||||
free(config.wayland_cmd);
|
||||
free(config.waylandsessions);
|
||||
free(config.x_cmd);
|
||||
free(config.xinitrc);
|
||||
free(config.x_cmd_setup);
|
||||
free(config.xauth_cmd);
|
||||
free(config.xsessions);
|
||||
|
||||
31
src/config.h
31
src/config.h
@@ -1,7 +1,8 @@
|
||||
#ifndef H_LY_CONFIG
|
||||
#define H_LY_CONFIG
|
||||
|
||||
#include "ctypes.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
enum INPUTS {
|
||||
SESSION_SWITCH,
|
||||
@@ -61,25 +62,28 @@ struct lang
|
||||
struct config
|
||||
{
|
||||
bool animate;
|
||||
u8 animation;
|
||||
uint8_t animation;
|
||||
char asterisk;
|
||||
u8 bg;
|
||||
uint8_t bg;
|
||||
bool bigclock;
|
||||
bool blank_box;
|
||||
bool blank_password;
|
||||
char* clock;
|
||||
char* console_dev;
|
||||
u8 default_input;
|
||||
u8 fg;
|
||||
uint8_t default_input;
|
||||
uint8_t fg;
|
||||
bool hide_borders;
|
||||
u8 input_len;
|
||||
bool hide_f1_commands;
|
||||
uint8_t input_len;
|
||||
char* lang;
|
||||
bool load;
|
||||
u8 margin_box_h;
|
||||
u8 margin_box_v;
|
||||
u8 max_desktop_len;
|
||||
u8 max_login_len;
|
||||
u8 max_password_len;
|
||||
uint8_t margin_box_h;
|
||||
uint8_t margin_box_v;
|
||||
uint8_t max_desktop_len;
|
||||
uint8_t max_login_len;
|
||||
uint8_t max_password_len;
|
||||
char* mcookie_cmd;
|
||||
u16 min_refresh_delta;
|
||||
uint16_t min_refresh_delta;
|
||||
char* path;
|
||||
char* restart_cmd;
|
||||
bool save;
|
||||
@@ -87,11 +91,12 @@ struct config
|
||||
char* service_name;
|
||||
char* shutdown_cmd;
|
||||
char* term_reset_cmd;
|
||||
u8 tty;
|
||||
uint8_t tty;
|
||||
char* wayland_cmd;
|
||||
bool wayland_specifier;
|
||||
char* waylandsessions;
|
||||
char* x_cmd;
|
||||
char* xinitrc;
|
||||
char* x_cmd_setup;
|
||||
char* xauth_cmd;
|
||||
char* xsessions;
|
||||
|
||||
444
src/draw.c
444
src/draw.c
@@ -1,19 +1,23 @@
|
||||
#include "dragonfail.h"
|
||||
#include "termbox.h"
|
||||
#include "ctypes.h"
|
||||
|
||||
#include "inputs.h"
|
||||
#include "utils.h"
|
||||
#include "config.h"
|
||||
#include "draw.h"
|
||||
#include "bigclock.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(__DragonFly__) || defined(__FreeBSD__)
|
||||
#include <sys/kbio.h>
|
||||
@@ -29,8 +33,8 @@ void draw_init(struct term_buf* buf)
|
||||
buf->height = tb_height();
|
||||
hostname(&buf->info_line);
|
||||
|
||||
u16 len_login = strlen(lang.login);
|
||||
u16 len_password = strlen(lang.password);
|
||||
uint16_t len_login = strlen(lang.login);
|
||||
uint16_t len_password = strlen(lang.password);
|
||||
|
||||
if (len_login > len_password)
|
||||
{
|
||||
@@ -47,7 +51,7 @@ void draw_init(struct term_buf* buf)
|
||||
+ (config.input_len + 1)
|
||||
+ buf->labels_max_len;
|
||||
|
||||
#if defined(__linux__)
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
buf->box_chars.left_up = 0x250c;
|
||||
buf->box_chars.left_down = 0x2514;
|
||||
buf->box_chars.right_up = 0x2510;
|
||||
@@ -68,20 +72,31 @@ void draw_init(struct term_buf* buf)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void doom_free(struct term_buf* buf);
|
||||
static void matrix_free(struct term_buf* buf);
|
||||
|
||||
void draw_free(struct term_buf* buf)
|
||||
{
|
||||
if (config.animate)
|
||||
{
|
||||
free(buf->tmp_buf);
|
||||
switch (config.animation)
|
||||
{
|
||||
case 0:
|
||||
doom_free(buf);
|
||||
break;
|
||||
case 1:
|
||||
matrix_free(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void draw_box(struct term_buf* buf)
|
||||
{
|
||||
u16 box_x = (buf->width - buf->box_width) / 2;
|
||||
u16 box_y = (buf->height - buf->box_height) / 2;
|
||||
u16 box_x2 = (buf->width + buf->box_width) / 2;
|
||||
u16 box_y2 = (buf->height + buf->box_height) / 2;
|
||||
uint16_t box_x = (buf->width - buf->box_width) / 2;
|
||||
uint16_t box_y = (buf->height - buf->box_height) / 2;
|
||||
uint16_t box_x2 = (buf->width + buf->box_width) / 2;
|
||||
uint16_t box_y2 = (buf->height + buf->box_height) / 2;
|
||||
buf->box_x = box_x;
|
||||
buf->box_y = box_y;
|
||||
|
||||
@@ -117,7 +132,7 @@ void draw_box(struct term_buf* buf)
|
||||
struct tb_cell c1 = {buf->box_chars.top, config.fg, config.bg};
|
||||
struct tb_cell c2 = {buf->box_chars.bot, config.fg, config.bg};
|
||||
|
||||
for (u8 i = 0; i < buf->box_width; ++i)
|
||||
for (uint16_t i = 0; i < buf->box_width; ++i)
|
||||
{
|
||||
tb_put_cell(
|
||||
box_x + i,
|
||||
@@ -133,7 +148,7 @@ void draw_box(struct term_buf* buf)
|
||||
c1.ch = buf->box_chars.left;
|
||||
c2.ch = buf->box_chars.right;
|
||||
|
||||
for (u8 i = 0; i < buf->box_height; ++i)
|
||||
for (uint16_t i = 0; i < buf->box_height; ++i)
|
||||
{
|
||||
tb_put_cell(
|
||||
box_x - 1,
|
||||
@@ -151,9 +166,9 @@ void draw_box(struct term_buf* buf)
|
||||
{
|
||||
struct tb_cell blank = {' ', config.fg, config.bg};
|
||||
|
||||
for (u8 i = 0; i < buf->box_height; ++i)
|
||||
for (uint16_t i = 0; i < buf->box_height; ++i)
|
||||
{
|
||||
for (u8 k = 0; k < buf->box_width; ++k)
|
||||
for (uint16_t k = 0; k < buf->box_width; ++k)
|
||||
{
|
||||
tb_put_cell(
|
||||
box_x + k,
|
||||
@@ -164,15 +179,114 @@ void draw_box(struct term_buf* buf)
|
||||
}
|
||||
}
|
||||
|
||||
struct tb_cell* strn_cell(char* s, u16 len) // throws
|
||||
char* time_str(char* fmt, int maxlen)
|
||||
{
|
||||
time_t timer;
|
||||
char* buffer = malloc(maxlen);
|
||||
struct tm* tm_info;
|
||||
|
||||
timer = time(NULL);
|
||||
tm_info = localtime(&timer);
|
||||
|
||||
if (strftime(buffer, maxlen, fmt, tm_info) == 0)
|
||||
{
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
extern inline uint32_t* CLOCK_N(char c);
|
||||
|
||||
struct tb_cell* clock_cell(char c)
|
||||
{
|
||||
struct tb_cell* cells = malloc(sizeof(struct tb_cell) * CLOCK_W * CLOCK_H);
|
||||
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
if (config.animate && c == ':' && tv.tv_usec / 500000)
|
||||
{
|
||||
c = ' ';
|
||||
}
|
||||
uint32_t* clockchars = CLOCK_N(c);
|
||||
|
||||
for (int i = 0; i < CLOCK_W * CLOCK_H; i++)
|
||||
{
|
||||
cells[i].ch = clockchars[i];
|
||||
cells[i].fg = config.fg;
|
||||
cells[i].bg = config.bg;
|
||||
}
|
||||
|
||||
return cells;
|
||||
}
|
||||
|
||||
void alpha_blit(struct tb_cell* buf, uint16_t x, uint16_t y, uint16_t w, uint16_t h, struct tb_cell* cells)
|
||||
{
|
||||
if (x + w >= tb_width() || y + h >= tb_height())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < h; i++)
|
||||
{
|
||||
for (int j = 0; j < w; j++)
|
||||
{
|
||||
struct tb_cell cell = cells[i * w + j];
|
||||
if (cell.ch)
|
||||
{
|
||||
buf[(y + i) * tb_width() + (x + j)] = cell;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void draw_bigclock(struct term_buf* buf)
|
||||
{
|
||||
if (!config.bigclock)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int xo = buf->width / 2 - (5 * (CLOCK_W + 1)) / 2;
|
||||
int yo = (buf->height - buf->box_height) / 2 - CLOCK_H - 2;
|
||||
|
||||
char* clockstr = time_str("%H:%M", 6);
|
||||
struct tb_cell* clockcell;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
clockcell = clock_cell(clockstr[i]);
|
||||
alpha_blit(tb_cell_buffer(), xo + i * (CLOCK_W + 1), yo, CLOCK_W, CLOCK_H, clockcell);
|
||||
free(clockcell);
|
||||
}
|
||||
|
||||
free(clockstr);
|
||||
}
|
||||
|
||||
void draw_clock(struct term_buf* buf)
|
||||
{
|
||||
if (config.clock == NULL || strlen(config.clock) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
char* clockstr = time_str(config.clock, 32);
|
||||
int clockstrlen = strlen(clockstr);
|
||||
|
||||
struct tb_cell* cells = strn_cell(clockstr, clockstrlen);
|
||||
tb_blit(buf->width - clockstrlen, 0, clockstrlen, 1, cells);
|
||||
|
||||
free(clockstr);
|
||||
free(cells);
|
||||
}
|
||||
|
||||
struct tb_cell* strn_cell(char* s, uint16_t len) // throws
|
||||
{
|
||||
struct tb_cell* cells = malloc((sizeof (struct tb_cell)) * len);
|
||||
char* s2 = s;
|
||||
u32 c;
|
||||
uint32_t c;
|
||||
|
||||
if (cells != NULL)
|
||||
{
|
||||
for (u16 i = 0; i < len; ++i)
|
||||
for (uint16_t i = 0; i < len; ++i)
|
||||
{
|
||||
if ((s2 - s) >= len)
|
||||
{
|
||||
@@ -239,7 +353,7 @@ void draw_labels(struct term_buf* buf) // throws
|
||||
|
||||
if (buf->info_line != NULL)
|
||||
{
|
||||
u16 len = strlen(buf->info_line);
|
||||
uint16_t len = strlen(buf->info_line);
|
||||
struct tb_cell* info_cell = str_cell(buf->info_line);
|
||||
|
||||
if (dgn_catch())
|
||||
@@ -315,7 +429,7 @@ void draw_lock_state(struct term_buf* buf)
|
||||
close(fd);
|
||||
|
||||
// print text
|
||||
u16 pos_x = buf->width - strlen(lang.numlock);
|
||||
uint16_t pos_x = buf->width - strlen(lang.numlock);
|
||||
|
||||
if (numlock_on)
|
||||
{
|
||||
@@ -352,7 +466,7 @@ void draw_lock_state(struct term_buf* buf)
|
||||
|
||||
void draw_desktop(struct desktop* target)
|
||||
{
|
||||
u16 len = strlen(target->list[target->cur]);
|
||||
uint16_t len = strlen(target->list[target->cur]);
|
||||
|
||||
if (len > (target->visible_len - 3))
|
||||
{
|
||||
@@ -373,7 +487,7 @@ void draw_desktop(struct desktop* target)
|
||||
config.fg,
|
||||
config.bg);
|
||||
|
||||
for (u16 i = 0; i < len; ++ i)
|
||||
for (uint16_t i = 0; i < len; ++ i)
|
||||
{
|
||||
tb_change_cell(
|
||||
target->x + i + 2,
|
||||
@@ -386,8 +500,8 @@ void draw_desktop(struct desktop* target)
|
||||
|
||||
void draw_input(struct text* input)
|
||||
{
|
||||
u16 len = strlen(input->text);
|
||||
u16 visible_len = input->visible_len;
|
||||
uint16_t len = strlen(input->text);
|
||||
uint16_t visible_len = input->visible_len;
|
||||
|
||||
if (len > visible_len)
|
||||
{
|
||||
@@ -407,7 +521,7 @@ void draw_input(struct text* input)
|
||||
|
||||
struct tb_cell c1 = {' ', config.fg, config.bg};
|
||||
|
||||
for (u16 i = input->end - input->visible_start; i < visible_len; ++i)
|
||||
for (uint16_t i = input->end - input->visible_start; i < visible_len; ++i)
|
||||
{
|
||||
tb_put_cell(
|
||||
input->x + i,
|
||||
@@ -419,8 +533,8 @@ void draw_input(struct text* input)
|
||||
|
||||
void draw_input_mask(struct text* input)
|
||||
{
|
||||
u16 len = strlen(input->text);
|
||||
u16 visible_len = input->visible_len;
|
||||
uint16_t len = strlen(input->text);
|
||||
uint16_t visible_len = input->visible_len;
|
||||
|
||||
if (len > visible_len)
|
||||
{
|
||||
@@ -430,7 +544,7 @@ void draw_input_mask(struct text* input)
|
||||
struct tb_cell c1 = {config.asterisk, config.fg, config.bg};
|
||||
struct tb_cell c2 = {' ', config.fg, config.bg};
|
||||
|
||||
for (u16 i = 0; i < visible_len; ++i)
|
||||
for (uint16_t i = 0; i < visible_len; ++i)
|
||||
{
|
||||
if (input->visible_start + i < input->end)
|
||||
{
|
||||
@@ -455,8 +569,8 @@ void position_input(
|
||||
struct text* login,
|
||||
struct text* password)
|
||||
{
|
||||
u16 x = buf->box_x + config.margin_box_h + buf->labels_max_len + 1;
|
||||
i32 len = buf->box_x + buf->box_width - config.margin_box_h - x;
|
||||
uint16_t x = buf->box_x + config.margin_box_h + buf->labels_max_len + 1;
|
||||
int32_t len = buf->box_x + buf->box_width - config.margin_box_h - x;
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
@@ -480,18 +594,118 @@ static void doom_init(struct term_buf* buf)
|
||||
{
|
||||
buf->init_width = buf->width;
|
||||
buf->init_height = buf->height;
|
||||
buf->astate.doom = malloc(sizeof(struct doom_state));
|
||||
|
||||
u16 tmp_len = buf->width * buf->height;
|
||||
buf->tmp_buf = malloc(tmp_len);
|
||||
tmp_len -= buf->width;
|
||||
|
||||
if (buf->tmp_buf == NULL)
|
||||
if (buf->astate.doom == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
memset(buf->tmp_buf, 0, tmp_len);
|
||||
memset(buf->tmp_buf + tmp_len, DOOM_STEPS - 1, buf->width);
|
||||
uint16_t tmp_len = buf->width * buf->height;
|
||||
buf->astate.doom->buf = malloc(tmp_len);
|
||||
tmp_len -= buf->width;
|
||||
|
||||
if (buf->astate.doom->buf == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
memset(buf->astate.doom->buf, 0, tmp_len);
|
||||
memset(buf->astate.doom->buf + tmp_len, DOOM_STEPS - 1, buf->width);
|
||||
}
|
||||
|
||||
static void doom_free(struct term_buf* buf)
|
||||
{
|
||||
free(buf->astate.doom->buf);
|
||||
free(buf->astate.doom);
|
||||
}
|
||||
|
||||
// Adapted from cmatrix
|
||||
static void matrix_init(struct term_buf* buf)
|
||||
{
|
||||
buf->init_width = buf->width;
|
||||
buf->init_height = buf->height;
|
||||
buf->astate.matrix = malloc(sizeof(struct matrix_state));
|
||||
struct matrix_state* s = buf->astate.matrix;
|
||||
|
||||
if (s == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
uint16_t len = buf->height + 1;
|
||||
s->grid = malloc(sizeof(struct matrix_dot*) * len);
|
||||
|
||||
if (s->grid == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
len = (buf->height + 1) * buf->width;
|
||||
(s->grid)[0] = malloc(sizeof(struct matrix_dot) * len);
|
||||
|
||||
if ((s->grid)[0] == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
for (int i = 1; i <= buf->height; ++i)
|
||||
{
|
||||
s->grid[i] = s->grid[i - 1] + buf->width;
|
||||
|
||||
if (s->grid[i] == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
}
|
||||
|
||||
s->length = malloc(buf->width * sizeof(int));
|
||||
|
||||
if (s->length == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
s->spaces = malloc(buf->width * sizeof(int));
|
||||
|
||||
if (s->spaces == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
s->updates = malloc(buf->width * sizeof(int));
|
||||
|
||||
if (s->updates == NULL)
|
||||
{
|
||||
dgn_throw(DGN_ALLOC);
|
||||
}
|
||||
|
||||
// Initialize grid
|
||||
for (int i = 0; i <= buf->height; ++i)
|
||||
{
|
||||
for (int j = 0; j <= buf->width - 1; j += 2)
|
||||
{
|
||||
s->grid[i][j].val = -1;
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < buf->width; j += 2)
|
||||
{
|
||||
s->spaces[j] = (int) rand() % buf->height + 1;
|
||||
s->length[j] = (int) rand() % (buf->height - 3) + 3;
|
||||
s->grid[1][j].val = ' ';
|
||||
s->updates[j] = (int) rand() % 3 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void matrix_free(struct term_buf* buf)
|
||||
{
|
||||
free(buf->astate.matrix->grid[0]);
|
||||
free(buf->astate.matrix->grid);
|
||||
free(buf->astate.matrix->length);
|
||||
free(buf->astate.matrix->spaces);
|
||||
free(buf->astate.matrix->updates);
|
||||
free(buf->astate.matrix);
|
||||
}
|
||||
|
||||
void animate_init(struct term_buf* buf)
|
||||
@@ -500,11 +714,16 @@ void animate_init(struct term_buf* buf)
|
||||
{
|
||||
switch(config.animation)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
{
|
||||
doom_init(buf);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
matrix_init(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -528,12 +747,12 @@ static void doom(struct term_buf* term_buf)
|
||||
{0x2588, 8, 4}, // white
|
||||
};
|
||||
|
||||
u16 src;
|
||||
u16 random;
|
||||
u16 dst;
|
||||
uint16_t src;
|
||||
uint16_t random;
|
||||
uint16_t dst;
|
||||
|
||||
u16 w = term_buf->init_width;
|
||||
u8* tmp = term_buf->tmp_buf;
|
||||
uint16_t w = term_buf->init_width;
|
||||
uint8_t* tmp = term_buf->astate.doom->buf;
|
||||
|
||||
if ((term_buf->width != term_buf->init_width) || (term_buf->height != term_buf->init_height))
|
||||
{
|
||||
@@ -542,9 +761,9 @@ static void doom(struct term_buf* term_buf)
|
||||
|
||||
struct tb_cell* buf = tb_cell_buffer();
|
||||
|
||||
for (u16 x = 0; x < w; ++x)
|
||||
for (uint16_t x = 0; x < w; ++x)
|
||||
{
|
||||
for (u16 y = 1; y < term_buf->init_height; ++y)
|
||||
for (uint16_t y = 1; y < term_buf->init_height; ++y)
|
||||
{
|
||||
src = y * w + x;
|
||||
random = ((rand() % 7) & 3);
|
||||
@@ -572,6 +791,132 @@ static void doom(struct term_buf* term_buf)
|
||||
}
|
||||
}
|
||||
|
||||
// Adapted from cmatrix
|
||||
static void matrix(struct term_buf* buf)
|
||||
{
|
||||
static int frame = 3;
|
||||
const int frame_delay = 8;
|
||||
static int count = 0;
|
||||
bool first_col;
|
||||
struct matrix_state* s = buf->astate.matrix;
|
||||
|
||||
// Allowed codepoints
|
||||
const int randmin = 33;
|
||||
const int randnum = 123 - randmin;
|
||||
// Chars change mid-scroll
|
||||
const bool changes = true;
|
||||
|
||||
if ((buf->width != buf->init_width) || (buf->height != buf->init_height))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
count += 1;
|
||||
if (count > frame_delay)
|
||||
{
|
||||
frame += 1;
|
||||
if (frame > 4) frame = 1;
|
||||
count = 0;
|
||||
|
||||
for (int j = 0; j < buf->width; j += 2)
|
||||
{
|
||||
int tail;
|
||||
if (frame > s->updates[j])
|
||||
{
|
||||
if (s->grid[0][j].val == -1 && s->grid[1][j].val == ' ')
|
||||
{
|
||||
if (s->spaces[j] > 0)
|
||||
{
|
||||
s->spaces[j]--;
|
||||
} else {
|
||||
s->length[j] = (int) rand() % (buf->height - 3) + 3;
|
||||
s->grid[0][j].val = (int) rand() % randnum + randmin;
|
||||
s->spaces[j] = (int) rand() % buf->height + 1;
|
||||
}
|
||||
}
|
||||
|
||||
int i = 0, seg_len = 0;
|
||||
first_col = 1;
|
||||
while (i <= buf->height)
|
||||
{
|
||||
// Skip over spaces
|
||||
while (i <= buf->height
|
||||
&& (s->grid[i][j].val == ' ' || s->grid[i][j].val == -1))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i > buf->height) break;
|
||||
|
||||
// Find the head of this col
|
||||
tail = i;
|
||||
seg_len = 0;
|
||||
while (i <= buf->height
|
||||
&& (s->grid[i][j].val != ' ' && s->grid[i][j].val != -1))
|
||||
{
|
||||
s->grid[i][j].is_head = false;
|
||||
if (changes)
|
||||
{
|
||||
if (rand() % 8 == 0)
|
||||
s->grid[i][j].val = (int) rand() % randnum + randmin;
|
||||
}
|
||||
i++;
|
||||
seg_len++;
|
||||
}
|
||||
|
||||
// Head's down offscreen
|
||||
if (i > buf->height)
|
||||
{
|
||||
s->grid[tail][j].val = ' ';
|
||||
continue;
|
||||
}
|
||||
|
||||
s->grid[i][j].val = (int) rand() % randnum + randmin;
|
||||
s->grid[i][j].is_head = true;
|
||||
|
||||
if (seg_len > s->length[j] || !first_col) {
|
||||
s->grid[tail][j].val = ' ';
|
||||
s->grid[0][j].val = -1;
|
||||
}
|
||||
first_col = 0;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t blank;
|
||||
utf8_char_to_unicode(&blank, " ");
|
||||
|
||||
for (int j = 0; j < buf->width; j += 2)
|
||||
{
|
||||
for (int i = 1; i <= buf->height; ++i)
|
||||
{
|
||||
uint32_t c;
|
||||
int fg = TB_GREEN;
|
||||
int bg = TB_DEFAULT;
|
||||
|
||||
if (s->grid[i][j].val == -1 || s->grid[i][j].val == ' ')
|
||||
{
|
||||
tb_change_cell(j, i - 1, blank, fg, bg);
|
||||
continue;
|
||||
}
|
||||
|
||||
char tmp[2];
|
||||
tmp[0] = s->grid[i][j].val;
|
||||
tmp[1] = '\0';
|
||||
if(utf8_char_to_unicode(&c, tmp))
|
||||
{
|
||||
if (s->grid[i][j].is_head)
|
||||
{
|
||||
fg = TB_WHITE | TB_BOLD;
|
||||
}
|
||||
tb_change_cell(j, i - 1, c, fg, bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void animate(struct term_buf* buf)
|
||||
{
|
||||
buf->width = tb_width();
|
||||
@@ -581,19 +926,24 @@ void animate(struct term_buf* buf)
|
||||
{
|
||||
switch(config.animation)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
{
|
||||
doom(buf);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
matrix(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool cascade(struct term_buf* term_buf, u8* fails)
|
||||
bool cascade(struct term_buf* term_buf, uint8_t* fails)
|
||||
{
|
||||
u16 width = term_buf->width;
|
||||
u16 height = term_buf->height;
|
||||
uint16_t width = term_buf->width;
|
||||
uint16_t height = term_buf->height;
|
||||
|
||||
struct tb_cell* buf = tb_cell_buffer();
|
||||
bool changes = false;
|
||||
|
||||
73
src/draw.h
73
src/draw.h
@@ -2,45 +2,71 @@
|
||||
#define H_LY_DRAW
|
||||
|
||||
#include "termbox.h"
|
||||
#include "ctypes.h"
|
||||
|
||||
#include "inputs.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct box
|
||||
{
|
||||
u32 left_up;
|
||||
u32 left_down;
|
||||
u32 right_up;
|
||||
u32 right_down;
|
||||
u32 top;
|
||||
u32 bot;
|
||||
u32 left;
|
||||
u32 right;
|
||||
uint32_t left_up;
|
||||
uint32_t left_down;
|
||||
uint32_t right_up;
|
||||
uint32_t right_down;
|
||||
uint32_t top;
|
||||
uint32_t bot;
|
||||
uint32_t left;
|
||||
uint32_t right;
|
||||
};
|
||||
|
||||
struct matrix_dot
|
||||
{
|
||||
int val;
|
||||
bool is_head;
|
||||
};
|
||||
|
||||
struct matrix_state
|
||||
{
|
||||
struct matrix_dot** grid;
|
||||
int* length;
|
||||
int* spaces;
|
||||
int* updates;
|
||||
};
|
||||
|
||||
struct doom_state
|
||||
{
|
||||
uint8_t* buf;
|
||||
};
|
||||
|
||||
union anim_state
|
||||
{
|
||||
struct doom_state* doom;
|
||||
struct matrix_state* matrix;
|
||||
};
|
||||
|
||||
struct term_buf
|
||||
{
|
||||
u16 width;
|
||||
u16 height;
|
||||
u16 init_width;
|
||||
u16 init_height;
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint16_t init_width;
|
||||
uint16_t init_height;
|
||||
|
||||
struct box box_chars;
|
||||
char* info_line;
|
||||
u16 labels_max_len;
|
||||
u16 box_x;
|
||||
u16 box_y;
|
||||
u16 box_width;
|
||||
u16 box_height;
|
||||
uint16_t labels_max_len;
|
||||
uint16_t box_x;
|
||||
uint16_t box_y;
|
||||
uint16_t box_width;
|
||||
uint16_t box_height;
|
||||
|
||||
u8* tmp_buf;
|
||||
union anim_state astate;
|
||||
};
|
||||
|
||||
void draw_init(struct term_buf* buf);
|
||||
void draw_free(struct term_buf* buf);
|
||||
void draw_box(struct term_buf* buf);
|
||||
|
||||
struct tb_cell* strn_cell(char* s, u16 len);
|
||||
struct tb_cell* strn_cell(char* s, uint16_t len);
|
||||
struct tb_cell* str_cell(char* s);
|
||||
|
||||
void draw_labels(struct term_buf* buf);
|
||||
@@ -58,6 +84,9 @@ void position_input(
|
||||
|
||||
void animate_init(struct term_buf* buf);
|
||||
void animate(struct term_buf* buf);
|
||||
bool cascade(struct term_buf* buf, u8* fails);
|
||||
bool cascade(struct term_buf* buf, uint8_t* fails);
|
||||
|
||||
void draw_bigclock(struct term_buf *buf);
|
||||
void draw_clock(struct term_buf *buf);
|
||||
|
||||
#endif
|
||||
|
||||
37
src/inputs.c
37
src/inputs.c
@@ -1,13 +1,13 @@
|
||||
#include "dragonfail.h"
|
||||
#include "termbox.h"
|
||||
#include "ctypes.h"
|
||||
|
||||
#include "inputs.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <ctype.h>
|
||||
|
||||
void handle_desktop(void* input_struct, struct tb_event* event)
|
||||
{
|
||||
@@ -15,11 +15,11 @@ void handle_desktop(void* input_struct, struct tb_event* event)
|
||||
|
||||
if ((event != NULL) && (event->type == TB_EVENT_KEY))
|
||||
{
|
||||
if (event->key == TB_KEY_ARROW_LEFT)
|
||||
if (event->key == TB_KEY_ARROW_LEFT || (event->key == TB_KEY_CTRL_H))
|
||||
{
|
||||
input_desktop_right(target);
|
||||
}
|
||||
else if (event->key == TB_KEY_ARROW_RIGHT)
|
||||
else if (event->key == TB_KEY_ARROW_RIGHT || (event->key == TB_KEY_CTRL_L))
|
||||
{
|
||||
input_desktop_left(target);
|
||||
}
|
||||
@@ -77,19 +77,20 @@ void handle_text(void* input_struct, struct tb_event* event)
|
||||
void input_desktop(struct desktop* target)
|
||||
{
|
||||
target->list = NULL;
|
||||
target->list_simple = NULL;
|
||||
target->cmd = NULL;
|
||||
target->display_server = NULL;
|
||||
target->cur = 0;
|
||||
target->len = 0;
|
||||
|
||||
input_desktop_add(target, strdup(lang.shell), strdup(""), DS_SHELL);
|
||||
input_desktop_add(target, strdup(lang.xinitrc), strdup("~/.xinitrc"), DS_XINITRC);
|
||||
input_desktop_add(target, strdup(lang.xinitrc), strdup(config.xinitrc), DS_XINITRC);
|
||||
#if 0
|
||||
input_desktop_add(target, strdup(lang.wayland), strdup(""), DS_WAYLAND);
|
||||
#endif
|
||||
}
|
||||
|
||||
void input_text(struct text* target, u64 len)
|
||||
void input_text(struct text* target, uint64_t len)
|
||||
{
|
||||
target->text = malloc(len + 1);
|
||||
|
||||
@@ -123,7 +124,7 @@ void input_desktop_free(struct desktop* target)
|
||||
{
|
||||
if (target != NULL)
|
||||
{
|
||||
for (u16 i = 0; i < target->len; ++i)
|
||||
for (uint16_t i = 0; i < target->len; ++i)
|
||||
{
|
||||
if (target->list[i] != NULL)
|
||||
{
|
||||
@@ -177,7 +178,8 @@ void input_desktop_add(
|
||||
{
|
||||
++(target->len);
|
||||
target->list = realloc(target->list, target->len * (sizeof (char*)));
|
||||
target->cmd = realloc(target->cmd, target->len * (sizeof (char*)));
|
||||
target->list_simple = realloc(target->list_simple, target->len * (sizeof (char*)));
|
||||
target->cmd = realloc(target->cmd, target->len * (sizeof (char*)));
|
||||
target->display_server = realloc(
|
||||
target->display_server,
|
||||
target->len * (sizeof (enum display_server)));
|
||||
@@ -191,8 +193,23 @@ void input_desktop_add(
|
||||
return;
|
||||
}
|
||||
|
||||
target->list[target->cur] = name;
|
||||
target->cmd[target->cur] = cmd;
|
||||
target->list[target->cur] = name;
|
||||
|
||||
int name_len = strlen(name);
|
||||
char* name_simple = strdup(name);
|
||||
|
||||
if (strstr(name_simple, " ") != NULL)
|
||||
{
|
||||
name_simple = strtok(name_simple, " ");
|
||||
}
|
||||
|
||||
for (int i = 0; i < name_len; i++)
|
||||
{
|
||||
name_simple[i] = tolower(name_simple[i]);
|
||||
}
|
||||
|
||||
target->list_simple[target->cur] = name_simple;
|
||||
target->cmd[target->cur] = cmd;
|
||||
target->display_server[target->cur] = display_server;
|
||||
}
|
||||
|
||||
|
||||
24
src/inputs.h
24
src/inputs.h
@@ -2,7 +2,8 @@
|
||||
#define H_LY_INPUTS
|
||||
|
||||
#include "termbox.h"
|
||||
#include "ctypes.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum display_server {DS_WAYLAND, DS_SHELL, DS_XINITRC, DS_XORG};
|
||||
|
||||
@@ -10,32 +11,33 @@ struct text
|
||||
{
|
||||
char* text;
|
||||
char* end;
|
||||
i64 len;
|
||||
int64_t len;
|
||||
char* cur;
|
||||
char* visible_start;
|
||||
u16 visible_len;
|
||||
uint16_t visible_len;
|
||||
|
||||
u16 x;
|
||||
u16 y;
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
};
|
||||
|
||||
struct desktop
|
||||
{
|
||||
char** list;
|
||||
char** list_simple;
|
||||
char** cmd;
|
||||
enum display_server* display_server;
|
||||
|
||||
u16 cur;
|
||||
u16 len;
|
||||
u16 visible_len;
|
||||
u16 x;
|
||||
u16 y;
|
||||
uint16_t cur;
|
||||
uint16_t len;
|
||||
uint16_t visible_len;
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
};
|
||||
|
||||
void handle_desktop(void* input_struct, struct tb_event* event);
|
||||
void handle_text(void* input_struct, struct tb_event* event);
|
||||
void input_desktop(struct desktop* target);
|
||||
void input_text(struct text* target, u64 len);
|
||||
void input_text(struct text* target, uint64_t len);
|
||||
void input_desktop_free(struct desktop* target);
|
||||
void input_text_free(struct text* target);
|
||||
void input_desktop_right(struct desktop* target);
|
||||
|
||||
123
src/login.c
123
src/login.c
@@ -12,6 +12,7 @@
|
||||
#include <pwd.h>
|
||||
#include <security/pam_appl.h>
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -24,7 +25,7 @@
|
||||
int get_free_display()
|
||||
{
|
||||
char xlock[1024];
|
||||
u8 i;
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < 200; ++i)
|
||||
{
|
||||
@@ -212,22 +213,14 @@ void env_init(struct passwd* pwd)
|
||||
char* lang = getenv("LANG");
|
||||
// clean env
|
||||
environ[0] = NULL;
|
||||
|
||||
if (term != NULL)
|
||||
{
|
||||
setenv("TERM", term, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setenv("TERM", "linux", 1);
|
||||
}
|
||||
|
||||
|
||||
setenv("TERM", term ? term : "linux", 1);
|
||||
setenv("HOME", pwd->pw_dir, 1);
|
||||
setenv("PWD", pwd->pw_dir, 1);
|
||||
setenv("SHELL", pwd->pw_shell, 1);
|
||||
setenv("USER", pwd->pw_name, 1);
|
||||
setenv("LOGNAME", pwd->pw_name, 1);
|
||||
setenv("LANG", lang, 1);
|
||||
setenv("LANG", lang ? lang : "C", 1);
|
||||
|
||||
// Set PATH if specified in the configuration
|
||||
if (strlen(config.path))
|
||||
@@ -241,15 +234,8 @@ void env_init(struct passwd* pwd)
|
||||
}
|
||||
}
|
||||
|
||||
void env_xdg(const char* tty_id, const enum display_server display_server)
|
||||
void env_xdg_session(const enum display_server display_server)
|
||||
{
|
||||
char user[15];
|
||||
snprintf(user, 15, "/run/user/%d", getuid());
|
||||
setenv("XDG_RUNTIME_DIR", user, 0);
|
||||
setenv("XDG_SESSION_CLASS", "user", 0);
|
||||
setenv("XDG_SEAT", "seat0", 0);
|
||||
setenv("XDG_VTNR", tty_id, 0);
|
||||
|
||||
switch (display_server)
|
||||
{
|
||||
case DS_WAYLAND:
|
||||
@@ -271,6 +257,18 @@ void env_xdg(const char* tty_id, const enum display_server display_server)
|
||||
}
|
||||
}
|
||||
|
||||
void env_xdg(const char* tty_id, const char* desktop_name)
|
||||
{
|
||||
char user[20];
|
||||
snprintf(user, 20, "/run/user/%d", getuid());
|
||||
setenv("XDG_RUNTIME_DIR", user, 0);
|
||||
setenv("XDG_SESSION_CLASS", "user", 0);
|
||||
setenv("XDG_SESSION_ID", "1", 0);
|
||||
setenv("XDG_SESSION_DESKTOP", desktop_name, 0);
|
||||
setenv("XDG_SEAT", "seat0", 0);
|
||||
setenv("XDG_VTNR", tty_id, 0);
|
||||
}
|
||||
|
||||
void add_utmp_entry(
|
||||
struct utmp *entry,
|
||||
char *username,
|
||||
@@ -303,10 +301,51 @@ void remove_utmp_entry(struct utmp *entry) {
|
||||
endutent();
|
||||
}
|
||||
|
||||
void xauth(const char* display_name, const char* shell, const char* dir)
|
||||
void xauth(const char* display_name, const char* shell, char* pwd)
|
||||
{
|
||||
const char* xauth_file = "lyxauth";
|
||||
char* xauth_dir = getenv("XDG_RUNTIME_DIR");
|
||||
if ((xauth_dir == NULL) || (*xauth_dir == '\0'))
|
||||
{
|
||||
xauth_dir = getenv("XDG_CONFIG_HOME");
|
||||
struct stat sb;
|
||||
if ((xauth_dir == NULL) || (*xauth_dir == '\0'))
|
||||
{
|
||||
xauth_dir = strdup(pwd);
|
||||
strcat(xauth_dir, "/.config");
|
||||
stat(xauth_dir, &sb);
|
||||
if (S_ISDIR(sb.st_mode))
|
||||
{
|
||||
strcat(xauth_dir, "/ly");
|
||||
}
|
||||
else
|
||||
{
|
||||
xauth_dir = pwd;
|
||||
xauth_file = ".lyxauth";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(xauth_dir, "/ly");
|
||||
}
|
||||
|
||||
// If .config/ly/ or XDG_CONFIG_HOME/ly/ doesn't exist and can't create the directory, use pwd
|
||||
// Passing pwd beforehand is safe since stat will always evaluate false
|
||||
stat(xauth_dir, &sb);
|
||||
if (!S_ISDIR(sb.st_mode) && mkdir(xauth_dir, 0777) == -1)
|
||||
{
|
||||
xauth_dir = pwd;
|
||||
xauth_file = ".lyxauth";
|
||||
}
|
||||
}
|
||||
|
||||
// trim trailing slashes
|
||||
int i = strlen(xauth_dir) - 1;
|
||||
while (xauth_dir[i] == '/') i--;
|
||||
xauth_dir[i + 1] = '\0';
|
||||
|
||||
char xauthority[256];
|
||||
snprintf(xauthority, 256, "%s/%s", dir, ".lyxauth");
|
||||
snprintf(xauthority, 256, "%s/%s", xauth_dir, xauth_file);
|
||||
setenv("XAUTHORITY", xauthority, 1);
|
||||
setenv("DISPLAY", display_name, 1);
|
||||
|
||||
@@ -342,18 +381,10 @@ void xorg(
|
||||
const char* vt,
|
||||
const char* desktop_cmd)
|
||||
{
|
||||
// generate xauthority file
|
||||
const char* xauth_dir = getenv("XDG_CONFIG_HOME");
|
||||
|
||||
if ((xauth_dir == NULL) || (*xauth_dir == '\0'))
|
||||
{
|
||||
xauth_dir = pwd->pw_dir;
|
||||
}
|
||||
|
||||
char display_name[4];
|
||||
|
||||
snprintf(display_name, 3, ":%d", get_free_display());
|
||||
xauth(display_name, pwd->pw_shell, xauth_dir);
|
||||
xauth(display_name, pwd->pw_shell, pwd->pw_dir);
|
||||
|
||||
// start xorg
|
||||
pid_t pid = fork();
|
||||
@@ -470,6 +501,13 @@ void auth(
|
||||
{
|
||||
int ok;
|
||||
|
||||
char tty_id [3];
|
||||
snprintf(tty_id, 3, "%d", config.tty);
|
||||
|
||||
// Add XDG environment variables
|
||||
env_xdg_session(desktop->display_server[desktop->cur]);
|
||||
env_xdg(tty_id, desktop->list_simple[desktop->cur]);
|
||||
|
||||
// open pam session
|
||||
const char* creds[2] = {login->text, password->text};
|
||||
struct pam_conv conv = {login_conv, creds};
|
||||
@@ -530,7 +568,7 @@ void auth(
|
||||
if (pwd->pw_shell[0] == '\0')
|
||||
{
|
||||
setusershell();
|
||||
|
||||
|
||||
char* shell = getusershell();
|
||||
|
||||
if (shell != NULL)
|
||||
@@ -551,7 +589,7 @@ void auth(
|
||||
|
||||
if (pid == 0)
|
||||
{
|
||||
// set user info
|
||||
// set user info
|
||||
ok = initgroups(pwd->pw_name, pwd->pw_gid);
|
||||
|
||||
if (ok != 0)
|
||||
@@ -577,14 +615,14 @@ void auth(
|
||||
}
|
||||
|
||||
// get a display
|
||||
char tty_id [3];
|
||||
char vt[5];
|
||||
|
||||
snprintf(tty_id, 3, "%d", config.tty);
|
||||
snprintf(vt, 5, "vt%d", config.tty);
|
||||
|
||||
// set env
|
||||
// set env (this clears the environment)
|
||||
env_init(pwd);
|
||||
// Re-add XDG environment variables from lines 508,509
|
||||
env_xdg_session(desktop->display_server[desktop->cur]);
|
||||
env_xdg(tty_id, desktop->list_simple[desktop->cur]);
|
||||
|
||||
if (dgn_catch())
|
||||
{
|
||||
@@ -594,14 +632,11 @@ void auth(
|
||||
// add pam variables
|
||||
char** env = pam_getenvlist(handle);
|
||||
|
||||
for (u16 i = 0; env && env[i]; ++i)
|
||||
for (uint16_t i = 0; env && env[i]; ++i)
|
||||
{
|
||||
putenv(env[i]);
|
||||
}
|
||||
|
||||
// add xdg variables
|
||||
env_xdg(tty_id, desktop->display_server[desktop->cur]);
|
||||
|
||||
// execute
|
||||
int ok = chdir(pwd->pw_dir);
|
||||
|
||||
@@ -657,21 +692,21 @@ void auth(
|
||||
|
||||
// close pam session
|
||||
ok = pam_do(pam_close_session, handle, 0, buf);
|
||||
|
||||
|
||||
if (ok != PAM_SUCCESS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ok = pam_do(pam_setcred, handle, PAM_DELETE_CRED, buf);
|
||||
|
||||
|
||||
if (ok != PAM_SUCCESS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ok = pam_end(handle, 0);
|
||||
|
||||
|
||||
if (ok != PAM_SUCCESS)
|
||||
{
|
||||
pam_diagnose(ok, buf);
|
||||
|
||||
87
src/main.c
87
src/main.c
@@ -2,7 +2,6 @@
|
||||
#include "configator.h"
|
||||
#include "dragonfail.h"
|
||||
#include "termbox.h"
|
||||
#include "ctypes.h"
|
||||
|
||||
#include "draw.h"
|
||||
#include "inputs.h"
|
||||
@@ -10,15 +9,20 @@
|
||||
#include "utils.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ARG_COUNT 7
|
||||
// things you can define:
|
||||
// GIT_VERSION_STRING
|
||||
|
||||
#ifndef LY_VERSION
|
||||
#define LY_VERSION "0.6.0"
|
||||
#endif
|
||||
|
||||
// global
|
||||
struct lang lang;
|
||||
@@ -27,16 +31,14 @@ struct config config;
|
||||
// args handles
|
||||
void arg_help(void* data, char** pars, const int pars_count)
|
||||
{
|
||||
printf("RTFM\n");
|
||||
printf("If you want to configure Ly, please check the config file, usually located at /etc/ly/config.ini.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void arg_version(void* data, char** pars, const int pars_count)
|
||||
{
|
||||
#ifdef GIT_VERSION_STRING
|
||||
printf("Ly version %s\n", GIT_VERSION_STRING);
|
||||
#else
|
||||
printf("Ly version unknown\n");
|
||||
#endif
|
||||
printf("Ly version %s\n", LY_VERSION);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// low-level error messages
|
||||
@@ -107,11 +109,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
|
||||
config_load(config_path);
|
||||
|
||||
if (strcmp(config.lang, "en") != 0)
|
||||
{
|
||||
lang_load();
|
||||
}
|
||||
lang_load();
|
||||
|
||||
void* input_structs[3] =
|
||||
{
|
||||
@@ -138,13 +136,27 @@ int main(int argc, char** argv)
|
||||
// init visible elements
|
||||
struct tb_event event;
|
||||
struct term_buf buf;
|
||||
u8 active_input = config.default_input;
|
||||
|
||||
//Place the curser on the login field if there is no saved username, if there is, place the curser on the password field
|
||||
uint8_t active_input;
|
||||
if (config.default_input == LOGIN_INPUT && login.text != login.end){
|
||||
active_input = PASSWORD_INPUT;
|
||||
}
|
||||
else{
|
||||
active_input = config.default_input;
|
||||
}
|
||||
|
||||
(*input_handles[active_input])(input_structs[active_input], NULL);
|
||||
|
||||
// init drawing stuff
|
||||
draw_init(&buf);
|
||||
|
||||
// draw_box and position_input are called because they need to be
|
||||
// called before *input_handles[active_input] for the cursor to be
|
||||
// positioned correctly
|
||||
draw_box(&buf);
|
||||
position_input(&buf, &desktop, &login, &password);
|
||||
(*input_handles[active_input])(input_structs[active_input], NULL);
|
||||
|
||||
if (config.animate)
|
||||
{
|
||||
animate_init(&buf);
|
||||
@@ -162,7 +174,7 @@ int main(int argc, char** argv)
|
||||
bool update = true;
|
||||
bool reboot = false;
|
||||
bool shutdown = false;
|
||||
u8 auth_fails = 0;
|
||||
uint8_t auth_fails = 0;
|
||||
|
||||
switch_tty(&buf);
|
||||
|
||||
@@ -173,11 +185,15 @@ int main(int argc, char** argv)
|
||||
{
|
||||
if (auth_fails < 10)
|
||||
{
|
||||
(*input_handles[active_input])(input_structs[active_input], NULL);
|
||||
tb_clear();
|
||||
animate(&buf);
|
||||
draw_bigclock(&buf);
|
||||
draw_box(&buf);
|
||||
draw_clock(&buf);
|
||||
draw_labels(&buf);
|
||||
draw_f_commands();
|
||||
if(!config.hide_f1_commands)
|
||||
draw_f_commands();
|
||||
draw_lock_state(&buf);
|
||||
position_input(&buf, &desktop, &login, &password);
|
||||
draw_desktop(&desktop);
|
||||
@@ -194,7 +210,30 @@ int main(int argc, char** argv)
|
||||
tb_present();
|
||||
}
|
||||
|
||||
error = tb_peek_event(&event, config.min_refresh_delta);
|
||||
int timeout = -1;
|
||||
|
||||
if (config.animate)
|
||||
{
|
||||
timeout = config.min_refresh_delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
if (config.bigclock)
|
||||
timeout = (60 - tv.tv_sec % 60) * 1000 - tv.tv_usec / 1000 + 1;
|
||||
if (config.clock)
|
||||
timeout = 1000 - tv.tv_usec / 1000 + 1;
|
||||
}
|
||||
|
||||
if (timeout == -1)
|
||||
{
|
||||
error = tb_poll_event(&event);
|
||||
}
|
||||
else
|
||||
{
|
||||
error = tb_peek_event(&event, timeout);
|
||||
}
|
||||
|
||||
if (error < 0)
|
||||
{
|
||||
@@ -220,8 +259,10 @@ int main(int argc, char** argv)
|
||||
if (active_input > 0)
|
||||
{
|
||||
input_text_clear(input_structs[active_input]);
|
||||
update = true;
|
||||
}
|
||||
break;
|
||||
case TB_KEY_CTRL_K:
|
||||
case TB_KEY_ARROW_UP:
|
||||
if (active_input > 0)
|
||||
{
|
||||
@@ -229,6 +270,7 @@ int main(int argc, char** argv)
|
||||
update = true;
|
||||
}
|
||||
break;
|
||||
case TB_KEY_CTRL_J:
|
||||
case TB_KEY_ARROW_DOWN:
|
||||
if (active_input < 2)
|
||||
{
|
||||
@@ -241,7 +283,7 @@ int main(int argc, char** argv)
|
||||
|
||||
if (active_input > 2)
|
||||
{
|
||||
active_input = PASSWORD_INPUT;
|
||||
active_input = SESSION_SWITCH;
|
||||
}
|
||||
update = true;
|
||||
break;
|
||||
@@ -303,8 +345,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
execl("/bin/sh", "sh", "-c", config.shutdown_cmd, NULL);
|
||||
}
|
||||
|
||||
if (reboot)
|
||||
else if (reboot)
|
||||
{
|
||||
execl("/bin/sh", "sh", "-c", config.restart_cmd, NULL);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "configator.h"
|
||||
#include "dragonfail.h"
|
||||
|
||||
#include "inputs.h"
|
||||
#include "config.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
Submodule sub/argoat updated: 76d1e23b5e...e1844c4c94
Submodule sub/ctypes deleted from eb4b36559d
Submodule sub/dragonfail updated: 0a2492c6aa...15bd3299bf
Submodule sub/termbox_next updated: 23fff64470...d961a81222
Reference in New Issue
Block a user