102 Commits

Author SHA1 Message Date
AnErrupTion
1c2be475ad Exit when asking for version 2023-06-15 09:30:09 +02:00
AnErrupTion
d775efb414 Rename GIT_VERSION_STRING to LY_VERSION, don't allow shutdown and reboot at same time 2023-06-15 09:26:34 +02:00
AnErrupTion
57a8eecb1a Add labwc to supported DEs list 2023-06-15 09:21:26 +02:00
AnErrupTion
cbd82146e2 Fix code syntax issues 2023-06-15 09:00:31 +02:00
Colin
1124c126f9 Clocks (#461)
* Added a big clock

* fixed clock timing when animation is turned off

* fix memory leak and segfault

* rename clock to bigclock

* Added formattable clock

* fix clock position on first draw

don't rely on box_x and box_y to position the clock, because it might not be initialized in the first frame.

* fix memory leak
2023-06-15 08:57:37 +02:00
AnErrupTion
f9848f648b Rename "captation" to "lecture" in res/lang/fr.ini
Closes #398
2023-06-15 00:32:33 +02:00
Albert Akmukhametov
93cb8394d2 Added location of Xresources for XDG Base Dir Spec (#251) 2023-06-14 23:33:16 +02:00
Ranny Archer
faa76def08 Ctrl+{hjkl} Moving cursor (but not in text) (#492) 2023-06-14 23:24:00 +02:00
AnErrupTion
0b87d6c030 Remove broken workaround for Sway in res/wsetup.sh 2023-06-14 23:19:21 +02:00
Christian Heusel
627ebe3326 update the archlinux installation instructions (#505)
Signed-off-by: Christian Heusel <christian@heusel.eu>
2023-06-14 21:42:26 +02:00
Bruno Rodríguez
a8ea5d3e99 Tidy up runit service scripts (#479)
* Fix the script installation path (install everything only on /etc/sv/ly)

* Update the runit scripts to get the TTY value from the /etc/ly/config.ini file

* Update readme.md
2023-06-14 21:42:01 +02:00
Luna Jernberg
8c4ba3bd40 Add Swedish Translation (#495)
* Add Swedish Translation

Create sv.ini for Swedish translation

* Update sv.ini

Updated to some feedback from Vorpal in #archlinux-offtopic @ Libera
2023-06-14 21:36:17 +02:00
Vladyslav Prudius
c03ec1d15b Ukrainian and Russian localizations fixing (#503)
* Fix Ukrainian translation

* Fix Russian translation
2023-06-14 21:35:36 +02:00
Joseth Ariel B
c64f806a68 fix typos in spanish translation (#477) 2023-01-12 21:48:57 +01:00
Alfred Roos
24f017e09c Fixed wrong argument in inputs.s input_desktop (#469) 2022-12-08 23:29:23 +01:00
AnErrupTion
33662480e9 Potential fix for Sway (closes #433) 2022-12-07 12:50:48 +01:00
AnErrupTion
a7b01a721b Increase length for UID to 20 (closes #444) 2022-12-07 12:35:35 +01:00
Simon Struck
77eb456410 Re-add missing environment variables (#446) 2022-12-07 12:33:12 +01:00
AnErrupTion
19153760d3 Fix segfault (closes #434, #435) 2022-12-07 12:20:23 +01:00
Jordi Altayó
2ffb86213b Fedora dependencies (#436)
* Fedora dependencies

* Fedora dependencies 

Comments from @AnErrupTion
2022-09-07 13:45:21 +02:00
Daniel Haarhoff
5db09ce104 Make it easy to install ly on runit systems e.g. void (#431)
* Make it easy to install ly on runit systems e.g. void

* Tidy up runit section in readme

Co-authored-by: Daniel Haarhoff <daniel@rknt.de>
2022-08-28 12:53:58 +02:00
ClientCrash
99edd83429 add German lang translation (#355)
* added german translation

* Replaced umlauts in german translations

Replaced umlauts in german translations with alternative spelling method to avoid any encoding problems etc.

* updated translation

Co-authored-by: Leif G <46281254+4ctiv@users.noreply.github.com>
2022-08-22 17:58:12 +02:00
Cavernosa
59aae77f49 Fixes for the XDG Base Dirs implementation (#330) (#419)
Fix XDG Base Dirs implementation
2022-08-14 20:08:08 +02:00
Cavernosa
0cefb3da8e OpenRC service and support for more inits (#368)
Add OpenRC service and support for other init services

Co-authored-by: Jonathan <78560204+wncry@users.noreply.github.com>
Co-authored-by: MadcowOG <null>
Co-authored-by: MadcowOG <88654251+MadcowOG@users.noreply.github.com>
2022-08-13 10:44:53 +02:00
ShiningLea
309b97df8d Improve Arch instructions 2022-08-12 23:35:31 +02:00
stevensonmt
253ee005ad Improve config documentation (#414)
* Improve config documentation

update readme to provide some direction on customization options.

* move color config info to config.ini

Info on configuring color palette moving from README to config.ini comments

* Add comments for color config
2022-08-12 22:02:22 +02:00
ShiningLea
09ee6293bd Merge dev into master (closes #182) (#425)
Merge dev into master branch
Co-authored-by: AnErrupTion <anerruption@disroot.org>
2022-08-12 21:27:06 +02:00
ShiningLea
86d035346e Update README to use new organization name 2022-08-12 18:51:58 +02:00
ShiningLea
8c536d09ed Merge pull request #394 from hugok79/patch-1
Fix pt and pt_BR translation translation
2022-08-12 18:32:27 +02:00
ShiningLea
13020184cf Merge pull request #362 from KR1470R/ukrainian_lang
Add Ukrainian Translation
2022-08-12 15:11:02 +02:00
ShiningLea
07ca027ac6 Merge pull request #353 from jakubhyza/master
Czech lang translation
2022-08-12 15:10:10 +02:00
ShiningLea
0a798831fe Merge pull request #399 from Cavernosa/patch-1
Organized config.ini and readme.md
2022-07-24 15:25:57 +02:00
Cavernosa
4e24154cac Add awesome wm and some corrections 2022-07-16 14:53:34 +00:00
Cavernosa
b5d3ef0a70 Merge branch 'fairyglade:master' into patch-1 2022-07-16 14:28:12 +00:00
ShiningLea
3556e39374 Merge pull request #400 from KR1470R/aur
added link for aur package in readme
2022-06-09 23:28:08 +02:00
KR1470R
8d6218ee62 added link 2022-06-09 12:54:12 +03:00
Cavernosa
4208ba0e0f Organized config.ini
Grouped related things together and changed some comments
2022-06-08 04:02:31 +00:00
Hugo Carvalho
b051607c65 Fix pt and pt_BR translation translation
The "pt" translation was in brazilian portuguese as such, I correctly translated the translation to portuguese(pt) and renamed the other one to pt_BR.
2022-06-03 14:45:39 +01:00
KRIPTOR
0599af2cce fix ukrainian_lang 2 2022-06-03 12:37:11 +03:00
Jakub Hýža
f6de0eb086 Required changes - shell 2022-06-03 10:51:49 +02:00
Jakub Hýža
3c139d3eaf Required changes 2022-06-03 10:44:35 +02:00
AnErrupTion
354b1493c7 Merge remote-tracking branch 'origin/master' 2022-06-03 10:21:58 +02:00
AnErrupTion
7d5eb449c3 Add missing step in README 2022-06-03 10:21:51 +02:00
ShiningLea
9364ffcea9 Merge pull request #330 from UtkarshVerma/xdg
Use XDG_RUNTIME_DIR for storing Xauthority
2022-06-03 10:16:37 +02:00
AnErrupTion
e158bb5e9d Remove semicolons in language files 2022-06-03 10:13:54 +02:00
ShiningLea
2e1a57648b Merge pull request #393 from UtkarshVerma/xinitrc
Make `xinitrc` path configurable
2022-06-03 10:04:35 +02:00
ShiningLea
4b5374c13f Merge pull request #379 from KR1470R/aur
add instruction of aur package installation to readme
2022-06-03 10:03:24 +02:00
AnErrupTion
5945982d99 Merge remote-tracking branch 'origin/master' 2022-06-03 10:02:06 +02:00
AnErrupTion
723a008adf Helpful message when doing --help (closes #391 #390 #346) 2022-06-03 09:59:33 +02:00
Utkarsh Verma
802ad7b204 Merge branch 'master' of github.com:fairyglade/ly into xinitrc 2022-06-03 07:43:36 +05:30
Utkarsh Verma
079f68696b Make xinitrc path configurable 2022-06-03 07:43:19 +05:30
Turion64
73e8193b2e Merge pull request #388 from TheArctesian/patch-1
Update readme.md
2022-05-31 22:04:04 +02:00
The Arctesian
1fad38aad9 Update readme.md 2022-05-30 21:27:49 +08:00
KRIPTOR
9e33f90d24 Update readme.md 2022-05-25 19:39:15 +03:00
Utkarsh Verma
38aacc6b1c Implement fallback logic for XAUTHORITY 2022-05-24 07:41:35 +05:30
KRIPTOR
83c17b7b78 Update readme.md 2022-05-23 22:20:45 +03:00
KR1470R
f485840d89 add aur support 2022-05-22 22:26:32 +03:00
Turion64
767120c701 Add spectrwm 2022-05-18 06:49:14 +02:00
Turion64
cc5a50ff32 Merge pull request #367 from donno2048/patch-1
Use `uint16_t` on `put_cell` iterations
2022-05-17 06:40:14 +02:00
Elisha Hollander
77d186b802 use uint16_t on put_cell iterations 2022-05-17 01:36:36 +03:00
Turion64
8eb487ae9e Merge pull request #354 from SapphireAmoeba5/master
Make TAB key loop through U.I elements infinitely
2022-05-16 23:24:19 +02:00
Turion64
dec2ef14e0 Merge pull request #352 from kefoster951/master
Changed active_input selection to be based on default config
2022-05-16 23:23:26 +02:00
KR1470R
63aeec1869 fix ukrainian_lang 2022-05-14 17:47:50 +03:00
KR1470R
9da5a5e136 add ukrainian lang 2022-05-14 16:09:31 +03:00
SapphireAmoeba5
ffa8fbe77b Replaced 0 with SESSION_SWITCH 2022-05-13 19:03:01 -03:00
SapphireAmoeba5
ac2b255021 Make TAB key loop through U.I elements 2022-05-13 13:23:14 -03:00
kefoster951
bd04d69b4d Changed default input to login field 2022-05-13 09:12:24 -04:00
kefoster951
a078a07ee7 Update main.c 2022-05-13 09:11:00 -04:00
Jakub Hýža
c84de06b91 Czech lang 2022-05-13 07:11:32 +02:00
Turion64
78e2fd1a21 Merge pull request #297 from gerardet46/catalan-translation
Catalan translation
2022-05-13 06:42:03 +02:00
Qontinuum
da5b08abf2 Check if lang is NULL and use shorter check (#303) 2022-05-12 22:37:43 +02:00
kefoster951
559f2f7370 Update main.c
changed how the curser placement works to be based on if there is a saved username or not
2022-05-12 11:05:23 -04:00
gerardet46
d29d65dee5 Remove semicolons and fixed a typo 2022-05-04 15:17:44 +02:00
Turion64
1890da4799 Merge pull request #312 from mr-durmus/master
Add Turkish language
2022-04-26 15:28:57 +02:00
Rasit
6ea31612cd Semicolons and parentheses removed. Missing translation translated. 2022-04-26 02:43:03 +03:00
Rasit
443616e4ed Merge branch 'fairyglade:master' into master 2022-04-26 02:39:06 +03:00
jakobrs
c0366fe805 Use tb_poll_event instead of tb_peek_event (#320)
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.
2022-04-25 20:52:22 +02:00
Baptiste Daroussin
7ed6631197 FreeBSD deserves nice drawing as well (#340) 2022-04-24 12:40:08 +02:00
yobleck
fa978c8add add qtile to list of supported de/wm (#286)
caveat: only tested on one machine
2022-04-24 11:55:16 +02:00
Stale
6245639daf Matrix scrolling text animation (#283) 2022-04-24 11:54:50 +02:00
Raen
9fd7779972 Allow en.ini load and add config to hide f1 commands (#281) 2022-04-23 19:17:56 +02:00
plasmoduck
2ca457aada Update readme.md (#252)
add dwm to list. Been using with dwm on multiple machines inc FreeBSD
2022-04-23 19:04:56 +02:00
Andrew Vos
9c1e218900 Add bspwm to list of tested desktop environments (#230) 2022-04-23 19:02:29 +02:00
Turion64
df6d906f6d Merge pull request #245 from kpetrilli/it_language
Add IT translation
2022-04-21 21:25:03 +02:00
Turion64
c762cdc20c Merge pull request #321 from jorrmungandrr/master
Added serbian translation
2022-04-21 21:17:39 +02:00
Turion64
d7930053c6 Merge pull request #325 from USBashka/master
Fix Russian translation
2022-04-21 21:13:26 +02:00
Turion64
b6681e78a9 Merge pull request #327 from RDKRACZ/Add-Polish
Create pl.ini
2022-04-21 21:12:03 +02:00
AnErrupTion
25034d1536 Set XDG_SESSION_ID to fix a few bugs 2022-04-19 21:46:40 +02:00
AnErrupTion
27c5673116 Set XDG_SESSION_TYPE earlier to fix some bugs 2022-04-19 21:36:58 +02:00
Utkarsh Verma
908ebf8964 Use XDG_RUNTIME_DIR for storing Xauthority 2022-01-02 15:55:36 +05:30
K0RR
dc0221259f Update pl.ini
Missed these two
2021-12-26 12:52:49 +01:00
K0RR
79a4ff470d Create pl.ini 2021-12-26 12:50:48 +01:00
USBashka
6023565814 Fix ru translation
Replaced Е with Ё where needed
2021-12-16 23:11:36 +04:00
nullgemm
609b3f9ddc fix readme 2021-12-10 12:58:14 +01:00
nullgemm
7597bcdfc2 update readme 2021-12-10 12:57:05 +01:00
nullgemm
ccc39d2bed update submodules 2021-12-10 12:55:11 +01:00
nullgemm
a20d5195a6 remove git submodules helper 2021-12-10 12:49:59 +01:00
nullgemm
b3d5756a0a remove git remote helper 2021-12-09 17:58:23 +01:00
Јован Ђокић-Шумарац
fad4e4dd84 Added serbian translation 2021-11-27 18:07:56 +01:00
00101111
9d4aea06b0 Add Turkish language 2021-10-23 19:42:03 +03:00
GerrySoft
1ca229b5c8 translation for catalan 2021-07-27 18:57:18 +02:00
kpetrilli
c5012ef11b Add IT
Added translation file for Italian language
2020-10-26 16:51:05 +01:00
37 changed files with 1471 additions and 232 deletions

View File

@@ -3,7 +3,7 @@ CC = gcc
FLAGS = -std=c99 -pedantic -g FLAGS = -std=c99 -pedantic -g
FLAGS+= -Wall -Wextra -Werror=vla -Wno-unused-parameter FLAGS+= -Wall -Wextra -Werror=vla -Wno-unused-parameter
#FLAGS+= -DDEBUG #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 LINK = -lpam -lxcb
VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full --suppressions=../res/valgrind.supp VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full --suppressions=../res/valgrind.supp
CMD = ./$(NAME) CMD = ./$(NAME)
@@ -70,7 +70,7 @@ leakgrind: $(BIND)/$(NAME)
@less valgrind.log @less valgrind.log
install: $(BIND)/$(NAME) install: $(BIND)/$(NAME)
@echo "installing" @echo "installing ly"
@install -dZ ${DESTDIR}/etc/ly @install -dZ ${DESTDIR}/etc/ly
@install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin @install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin
@install -DZ $(RESD)/config.ini -t ${DESTDIR}/etc/ly @install -DZ $(RESD)/config.ini -t ${DESTDIR}/etc/ly
@@ -78,20 +78,30 @@ install: $(BIND)/$(NAME)
@install -DZ $(RESD)/wsetup.sh -t $(DATADIR) @install -DZ $(RESD)/wsetup.sh -t $(DATADIR)
@install -dZ $(DATADIR)/lang @install -dZ $(DATADIR)/lang
@install -DZ $(RESD)/lang/* -t $(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 @install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d
installnoconf: $(BIND)/$(NAME) installnoconf: $(BIND)/$(NAME)
@echo "installing without the configuration file" @echo "installing ly without the configuration file"
@install -dZ ${DESTDIR}/etc/ly @install -dZ ${DESTDIR}/etc/ly
@install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin @install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin
@install -DZ $(RESD)/xsetup.sh -t $(DATADIR) @install -DZ $(RESD)/xsetup.sh -t $(DATADIR)
@install -DZ $(RESD)/wsetup.sh -t $(DATADIR) @install -DZ $(RESD)/wsetup.sh -t $(DATADIR)
@install -dZ $(DATADIR)/lang @install -dZ $(DATADIR)/lang
@install -DZ $(RESD)/lang/* -t $(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 @install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d
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: uninstall:
@echo "uninstalling" @echo "uninstalling"
@rm -rf ${DESTDIR}/etc/ly @rm -rf ${DESTDIR}/etc/ly
@@ -99,21 +109,10 @@ uninstall:
@rm -f ${DESTDIR}/usr/bin/ly @rm -f ${DESTDIR}/usr/bin/ly
@rm -f ${DESTDIR}/usr/lib/systemd/system/ly.service @rm -f ${DESTDIR}/usr/lib/systemd/system/ly.service
@rm -f ${DESTDIR}/etc/pam.d/ly @rm -f ${DESTDIR}/etc/pam.d/ly
@rm -f ${DESTDIR}/etc/init.d/${NAME}
@rm -rf ${DESTDIR}/etc/sv/ly
clean: clean:
@echo "cleaning" @echo "cleaning"
@rm -rf $(BIND) $(OBJD) valgrind.log @rm -rf $(BIND) $(OBJD) valgrind.log
@(cd $(SUBD)/termbox_next && $(MAKE) clean) @(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
gitea: github
github:
@echo "sourcing submodules"
@git submodule sync
@git submodule update --init --remote
@cd $(SUBD)/argoat && make github
@git submodule update --init --recursive --remote

View File

@@ -1,3 +1,4 @@
# Ly - a TUI display manager # Ly - a TUI display manager
![Ly screenshot](https://user-images.githubusercontent.com/5473047/88958888-65efbf80-d2a1-11ea-8ae5-3f263bce9cce.png "Ly screenshot") ![Ly screenshot](https://user-images.githubusercontent.com/5473047/88958888-65efbf80-d2a1-11ea-8ae5-3f263bce9cce.png "Ly screenshot")
@@ -16,24 +17,33 @@ Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
- shutdown - 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 ## Support
The following desktop environments were tested with success The following desktop environments were tested with success
- awesome
- bspwm
- budgie - budgie
- cinnamon - cinnamon
- deepin - deepin
- dwm
- enlightenment - enlightenment
- gnome - gnome
- i3 - i3
- kde - kde
- labwc
- lxde - lxde
- lxqt - lxqt
- mate - mate
- sway
- xfce
- pantheon
- maxx - maxx
- pantheon
- qtile
- spectrwm
- sway
- windowmaker - windowmaker
- xfce
- xmonad
Ly should work with any X desktop environment, and provides Ly should work with any X desktop environment, and provides
basic wayland support (sway works very well, for example). basic wayland support (sway works very well, for example).
@@ -47,39 +57,88 @@ changing the source code won't be necessary :)
## Cloning and Compiling ## Cloning and Compiling
Clone the repository 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 Compile
``` ```
make $ make
``` ```
Test in the configured tty (tty2 by default) Test in the configured tty (tty2 by default)
or a terminal emulator (but desktop environments won't start) or a terminal emulator (but desktop environments won't start)
``` ```
sudo make run # make run
``` ```
Install Ly and the provided systemd service file Install Ly and the provided systemd service file
``` ```
sudo make install # make install installsystemd
``` ```
Enable the service 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 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 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 ## Configuration
@@ -94,12 +153,10 @@ while on the desktop field (above the login field).
## .xinitrc ## .xinitrc
If your .xinitrc doesn't work make sure it is executable and includes a shebang. 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: 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 > 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.
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:
```
On ArchLinux, the example .xinitrc (/etc/X11/xinit/xinitrc) starts like this:
``` ```
#!/bin/sh #!/bin/sh
``` ```

View File

@@ -1,104 +1,140 @@
# animation enabled # Animation enabled/disabled
#animate = false #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 #animation = 0
# the char used to mask the password # format string for clock in top right corner (see strftime specification)
#asterisk = * #clock = %c
#asterisk = o
# 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 #bg = 0
# blank main box # Foreground color id
#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
#fg = 9 #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 = false
#hide_borders = true
# number of visible chars on an input # Main box margins
#input_len = 34
# active language
#lang = en
#lang = fr
# load the saved desktop and login
#load = true
# main box margins
#margin_box_h = 2 #margin_box_h = 2
#margin_box_v = 1 #margin_box_v = 1
# total input sizes # Input boxes length
#input_len = 34
# Max input sizes
#max_desktop_len = 100 #max_desktop_len = 100
#max_login_len = 255 #max_login_len = 255
#max_password_len = 255 #max_password_len = 255
# cookie generator
#mcookie_cmd = /usr/bin/mcookie
# event timeout in milliseconds # Input box active by default on startup
#min_refresh_delta = 5 #default_input = 2
# default path # Load the saved desktop and username
#path = /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin #load = true
# command executed when pressing F2 # Save the current desktop and login as defaults
#restart_cmd = /sbin/shutdown -r now
# save the current desktop and login as defaults
#save = true #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 #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 #shutdown_cmd = /sbin/shutdown -a now
# terminal reset command (tput is faster) # Command executed when pressing F2
#term_reset_cmd = /usr/bin/tput reset #restart_cmd = /sbin/shutdown -r now
# Active language
# Available languages are found in /etc/ly/lang/
#lang = en
# tty in use # tty in use
#tty = 2 #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 #wayland_cmd = /etc/ly/wsetup.sh
# add wayland specifier to session names # Add wayland specifier to session names
#wayland_specifier = false #wayland_specifier = false
#wayland_specifier = true
# wayland desktop environments # Wayland desktop environments
#waylandsessions = /usr/share/wayland-sessions #waylandsessions = /usr/share/wayland-sessions
# xorg server command
# xinitrc
#xinitrc = ~/.xinitrc
# Xorg server command
#x_cmd = /usr/bin/X #x_cmd = /usr/bin/X
# xorg setup command # Xorg setup command
#x_cmd_setup = /etc/ly/xsetup.sh #x_cmd_setup = /etc/ly/xsetup.sh
# xorg xauthority edition tool # Xorg xauthority edition tool
#xauth_cmd = /usr/bin/xauth #xauth_cmd = /usr/bin/xauth
# xorg desktop environments # Xorg desktop environments
#xsessions = /usr/share/xsessions #xsessions = /usr/share/xsessions

45
res/lang/cat.ini Executable file
View 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
View 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
View 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

View File

@@ -36,10 +36,10 @@ err_xsessions_dir = failed to find sessions folder
err_xsessions_open = failed to open sessions folder err_xsessions_open = failed to open sessions folder
f1 = F1 shutdown f1 = F1 shutdown
f2 = F2 reboot f2 = F2 reboot
login = login: login = login
logout = logged out logout = logged out
numlock = numlock numlock = numlock
password = password: password = password
shell = shell shell = shell
wayland = wayland wayland = wayland
xinitrc = xinitrc xinitrc = xinitrc

View File

@@ -15,7 +15,7 @@ err_pam_auth = error de autenticación
err_pam_authinfo_unavail = error al obtener información del usuario err_pam_authinfo_unavail = error al obtener información del usuario
err_pam_authok_reqd = token expirado err_pam_authok_reqd = token expirado
err_pam_buf = error de la memoria intermedia 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_expired = credenciales expiradas
err_pam_cred_insufficient = credenciales insuficientes err_pam_cred_insufficient = credenciales insuficientes
err_pam_cred_unavail = error al obtener credenciales 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_perm_user = error al degradar los permisos del usuario
err_pwnam = error al obtener la información del usuario err_pwnam = error al obtener la información del usuario
err_user_gid = error al establecer el GID 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_user_uid = error al establecer el UID del usuario
err_xsessions_dir = error al buscar la carpeta de sesiones err_xsessions_dir = error al buscar la carpeta de sesiones
err_xsessions_open = error al abrir la carpeta de sesiones err_xsessions_open = error al abrir la carpeta de sesiones
f1 = F1 apagar f1 = F1 apagar
f2 = F2 reiniciar f2 = F2 reiniciar
login = iniciar sesion: login = iniciar sesión
logout = cerrar sesion logout = cerrar sesión
numlock = Bloq Num numlock = Bloq Num
password = contraseña: password = contraseña
shell = shell shell = shell
wayland = wayland wayland = wayland
xinitrc = xinitrc xinitrc = xinitrc

View File

@@ -5,7 +5,7 @@ err_chdir = échec de l'ouverture du répertoire home
err_console_dev = échec d'accès à la console err_console_dev = échec d'accès à la console
err_dgn_oob = message err_dgn_oob = message
err_domain = domaine invalide 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_mlock = échec du verrouillage mémoire
err_null = pointeur null err_null = pointeur null
err_pam = échec de la transaction pam 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_dir = échec de changement de répertoire
err_perm_group = échec du déclassement des permissions de groupe err_perm_group = échec du déclassement des permissions de groupe
err_perm_user = échec du déclassement des permissions utilisateur 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_gid = échec de modification du GID
err_user_init = échec d'initialisation de l'utilisateur err_user_init = échec d'initialisation de l'utilisateur
err_user_uid = échec de modification du UID 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 err_xsessions_open = échec de l'ouverture du dossier de sessions
f1 = F1 éteindre f1 = F1 éteindre
f2 = F2 redémarrer f2 = F2 redémarrer
login = identifiant : login = identifiant
logout = déconnection logout = déconnection
numlock = verr.num numlock = verr.num
password = mot de passe : password = mot de passe
shell = shell shell = shell
wayland = wayland wayland = wayland
xinitrc = xinitrc xinitrc = xinitrc

45
res/lang/it.ini Normal file
View 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
View 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

View File

@@ -1,45 +1,45 @@
capslock = caixa alta capslock = capslock
err_alloc = alocação de memória malsucedida err_alloc = erro na atribuição de memória
err_bounds = índice fora de limites err_bounds = índice fora de limites
err_chdir = não foi possível abrir o diretório home err_chdir = erro ao abrir a pasta home
err_console_dev = não foi possível acessar o console err_console_dev = erro ao aceder à consola
err_dgn_oob = mensagem de log err_dgn_oob = mensagem de registo
err_domain = domínio inválido err_domain = domínio inválido
err_hostname = não foi possível obter o nome do host err_hostname = erro ao obter o nome do host
err_mlock = bloqueio da memória de senha malsucedido err_mlock = erro de bloqueio de memória
err_null = ponteiro nulo 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_abort = transação pam abortada
err_pam_acct_expired = conta expirada err_pam_acct_expired = conta expirada
err_pam_auth = erro de autenticação err_pam_auth = erro de autenticação
err_pam_authinfo_unavail = não foi possível obter informações do usuário err_pam_authinfo_unavail = erro ao obter informação do utilizador
err_pam_authok_reqd = token expirada err_pam_authok_reqd = token expirado
err_pam_buf = erro de buffer de memória 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_expired = credenciais expiradas
err_pam_cred_insufficient = credenciais insuficientes 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_maxtries = limite máximo de tentativas atingido
err_pam_perm_denied = permissão negada err_pam_perm_denied = permissão negada
err_pam_session = erro de sessão err_pam_session = erro de sessão
err_pam_sys = erro de sistema err_pam_sys = erro de sistema
err_pam_user_unknown = usuário desconhecido err_pam_user_unknown = utilizador desconhecido
err_path = não foi possível definir o caminho err_path = erro ao definir o caminho de acesso
err_perm_dir = não foi possível alterar o diretório atual err_perm_dir = erro ao alterar o diretório atual
err_perm_group = não foi possível reduzir as permissões de grupo err_perm_group = erro ao reduzir as permissões do grupo
err_perm_user = não foi possível reduzir as permissões de usuário err_perm_user = erro ao reduzir as permissões do utilizador
err_pwnam = não foi possível obter informações do usuário err_pwnam = erro ao obter informação do utilizador
err_user_gid = não foi possível definir o GID do usuário err_user_gid = erro ao definir o GID do utilizador
err_user_init = não foi possível iniciar o usuário err_user_init = erro ao iniciar o utilizador
err_user_uid = não foi possível definir o UID do usuário err_user_uid = erro ao definir o UID do utilizador
err_xsessions_dir = não foi possível encontrar a pasta das sessões err_xsessions_dir = erro ao localizar a pasta das sessões
err_xsessions_open = não foi possível abrir a pasta das sessões err_xsessions_open = erro ao abrir a pasta das sessões
f1 = F1 desligar f1 = F1 encerrar
f2 = F2 reiniciar f2 = F2 reiniciar
login = conectar: login = iniciar sessão
logout = desconectado logout = terminar sessão
numlock = numlock numlock = numlock
password = senha: password = palavra-passe
shell = shell shell = shell
wayland = wayland wayland = wayland
xinitrc = xinitrc xinitrc = xinitrc

45
res/lang/pt_BR.ini Normal file
View 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

View File

@@ -36,10 +36,10 @@ err_perm_user = nu s-a putut face downgrade permisiunilor de utilizator
f1 = F1 opreşte sistemul f1 = F1 opreşte sistemul
f2 = F2 resetează f2 = F2 resetează
login = utilizator: login = utilizator
logout = opreşte sesiunea logout = opreşte sesiunea
numlock = numlock numlock = numlock
password = parolă: password = parolă
shell = shell shell = shell
wayland = wayland wayland = wayland
xinitrc = xinitrc xinitrc = xinitrc

View File

@@ -10,17 +10,17 @@ err_mlock = сбой блокировки памяти
err_null = нулевой указатель err_null = нулевой указатель
err_pam = pam транзакция не удалась err_pam = pam транзакция не удалась
err_pam_abort = pam транзакция прервана err_pam_abort = pam транзакция прервана
err_pam_acct_expired = срок действия аккаунта истек err_pam_acct_expired = срок действия аккаунта истёк
err_pam_auth = ошибка аутентификации err_pam_auth = ошибка аутентификации
err_pam_authinfo_unavail = не удалось получить информацию о пользователе err_pam_authinfo_unavail = не удалось получить информацию о пользователе
err_pam_authok_reqd = токен истек err_pam_authok_reqd = токен истёк
err_pam_buf = ошибка буфера памяти err_pam_buf = ошибка буфера памяти
err_pam_cred_err = не удалось установить полномочия err_pam_cred_err = не удалось установить полномочия
err_pam_cred_expired = полномочия истекли err_pam_cred_expired = полномочия истекли
err_pam_cred_insufficient = недостаточо полномочий err_pam_cred_insufficient = недостаточно полномочий
err_pam_cred_unavail = не удалось получить полномочия err_pam_cred_unavail = не удалось получить полномочия
err_pam_maxtries = лимит попыток исчерпан err_pam_maxtries = лимит попыток исчерпан
err_pam_perm_denied = доступ запрещен err_pam_perm_denied = доступ запрещён
err_pam_session = ошибка сессии err_pam_session = ошибка сессии
err_pam_sys = системная ошибка err_pam_sys = системная ошибка
err_pam_user_unknown = неизвестный пользователь err_pam_user_unknown = неизвестный пользователь
@@ -36,10 +36,10 @@ err_xsessions_dir = не удалось найти сессионную папк
err_xsessions_open = не удалось открыть сессионную папку err_xsessions_open = не удалось открыть сессионную папку
f1 = F1 выключить f1 = F1 выключить
f2 = F2 перезагрузить f2 = F2 перезагрузить
login = логин: login = логин
logout = logged out logout = logged out
numlock = numlock numlock = numlock
password = пароль: password = пароль
shell = shell shell = shell
wayland = wayland wayland = wayland
xinitrc = xinitrc xinitrc = xinitrc

45
res/lang/sr.ini Normal file
View 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
View 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
View 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
View 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
View 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
View 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}

View File

@@ -0,0 +1,4 @@
#!/bin/sh
[ -r conf ] && . ./conf
exec utmpset -w ${TTY}

13
res/ly-runit-service/run Normal file
View 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}"

View File

@@ -51,4 +51,4 @@ case $SHELL in
;; ;;
esac esac
exec $@ exec "$@"

View File

@@ -90,6 +90,7 @@ elif [ -f /etc/X11/Xresources ]; then
xrdb -merge /etc/X11/Xresources xrdb -merge /etc/X11/Xresources
fi fi
[ -f $HOME/.Xresources ] && xrdb -merge $HOME/.Xresources [ -f $HOME/.Xresources ] && xrdb -merge $HOME/.Xresources
[ -f $XDG_CONFIG_HOME/X11/Xresources ] && xrdb -merge $XDG_CONFIG_HOME/X11/Xresources
if [ -f "$USERXSESSION" ]; then if [ -f "$USERXSESSION" ]; then
. "$USERXSESSION" . "$USERXSESSION"

146
src/bigclock.h Normal file
View 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;
}
}

View File

@@ -161,12 +161,15 @@ void config_load(const char *cfg_path)
{"animation", &config.animation, config_handle_u8}, {"animation", &config.animation, config_handle_u8},
{"asterisk", &config.asterisk, config_handle_char}, {"asterisk", &config.asterisk, config_handle_char},
{"bg", &config.bg, config_handle_u8}, {"bg", &config.bg, config_handle_u8},
{"bigclock", &config.bigclock, config_handle_bool},
{"blank_box", &config.blank_box, config_handle_bool}, {"blank_box", &config.blank_box, config_handle_bool},
{"blank_password", &config.blank_password, 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}, {"console_dev", &config.console_dev, config_handle_str},
{"default_input", &config.default_input, config_handle_u8}, {"default_input", &config.default_input, config_handle_u8},
{"fg", &config.fg, config_handle_u8}, {"fg", &config.fg, config_handle_u8},
{"hide_borders", &config.hide_borders, config_handle_bool}, {"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}, {"input_len", &config.input_len, config_handle_u8},
{"lang", &config.lang, config_handle_str}, {"lang", &config.lang, config_handle_str},
{"load", &config.load, config_handle_bool}, {"load", &config.load, config_handle_bool},
@@ -189,6 +192,7 @@ void config_load(const char *cfg_path)
{"wayland_specifier", &config.wayland_specifier, config_handle_bool}, {"wayland_specifier", &config.wayland_specifier, config_handle_bool},
{"waylandsessions", &config.waylandsessions, config_handle_str}, {"waylandsessions", &config.waylandsessions, config_handle_str},
{"x_cmd", &config.x_cmd, 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}, {"x_cmd_setup", &config.x_cmd_setup, config_handle_str},
{"xauth_cmd", &config.xauth_cmd, config_handle_str}, {"xauth_cmd", &config.xauth_cmd, config_handle_str},
{"xsessions", &config.xsessions, config_handle_str}, {"xsessions", &config.xsessions, config_handle_str},
@@ -267,10 +271,12 @@ void config_defaults()
config.animation = 0; config.animation = 0;
config.asterisk = '*'; config.asterisk = '*';
config.bg = 0; config.bg = 0;
config.bigclock = false;
config.blank_box = true; config.blank_box = true;
config.blank_password = false; config.blank_password = false;
config.clock = NULL;
config.console_dev = strdup("/dev/console"); config.console_dev = strdup("/dev/console");
config.default_input = PASSWORD_INPUT; config.default_input = LOGIN_INPUT;
config.fg = 9; config.fg = 9;
config.hide_borders = false; config.hide_borders = false;
config.input_len = 34; config.input_len = 34;
@@ -295,6 +301,7 @@ void config_defaults()
config.wayland_specifier = false; config.wayland_specifier = false;
config.waylandsessions = strdup("/usr/share/wayland-sessions"); config.waylandsessions = strdup("/usr/share/wayland-sessions");
config.x_cmd = strdup("/usr/bin/X"); config.x_cmd = strdup("/usr/bin/X");
config.xinitrc = strdup("~/.xinitrc");
config.x_cmd_setup = strdup(DATADIR "/xsetup.sh"); config.x_cmd_setup = strdup(DATADIR "/xsetup.sh");
config.xauth_cmd = strdup("/usr/bin/xauth"); config.xauth_cmd = strdup("/usr/bin/xauth");
config.xsessions = strdup("/usr/share/xsessions"); config.xsessions = strdup("/usr/share/xsessions");
@@ -351,6 +358,7 @@ void lang_free()
void config_free() void config_free()
{ {
free(config.clock);
free(config.console_dev); free(config.console_dev);
free(config.lang); free(config.lang);
free(config.mcookie_cmd); free(config.mcookie_cmd);
@@ -363,6 +371,7 @@ void config_free()
free(config.wayland_cmd); free(config.wayland_cmd);
free(config.waylandsessions); free(config.waylandsessions);
free(config.x_cmd); free(config.x_cmd);
free(config.xinitrc);
free(config.x_cmd_setup); free(config.x_cmd_setup);
free(config.xauth_cmd); free(config.xauth_cmd);
free(config.xsessions); free(config.xsessions);

View File

@@ -65,12 +65,15 @@ struct config
uint8_t animation; uint8_t animation;
char asterisk; char asterisk;
uint8_t bg; uint8_t bg;
bool bigclock;
bool blank_box; bool blank_box;
bool blank_password; bool blank_password;
char* clock;
char* console_dev; char* console_dev;
uint8_t default_input; uint8_t default_input;
uint8_t fg; uint8_t fg;
bool hide_borders; bool hide_borders;
bool hide_f1_commands;
uint8_t input_len; uint8_t input_len;
char* lang; char* lang;
bool load; bool load;
@@ -93,6 +96,7 @@ struct config
bool wayland_specifier; bool wayland_specifier;
char* waylandsessions; char* waylandsessions;
char* x_cmd; char* x_cmd;
char* xinitrc;
char* x_cmd_setup; char* x_cmd_setup;
char* xauth_cmd; char* xauth_cmd;
char* xsessions; char* xsessions;

View File

@@ -5,6 +5,7 @@
#include "utils.h" #include "utils.h"
#include "config.h" #include "config.h"
#include "draw.h" #include "draw.h"
#include "bigclock.h"
#include <ctype.h> #include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
@@ -14,7 +15,9 @@
#include <string.h> #include <string.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <time.h>
#if defined(__DragonFly__) || defined(__FreeBSD__) #if defined(__DragonFly__) || defined(__FreeBSD__)
#include <sys/kbio.h> #include <sys/kbio.h>
@@ -48,7 +51,7 @@ void draw_init(struct term_buf* buf)
+ (config.input_len + 1) + (config.input_len + 1)
+ buf->labels_max_len; + buf->labels_max_len;
#if defined(__linux__) #if defined(__linux__) || defined(__FreeBSD__)
buf->box_chars.left_up = 0x250c; buf->box_chars.left_up = 0x250c;
buf->box_chars.left_down = 0x2514; buf->box_chars.left_down = 0x2514;
buf->box_chars.right_up = 0x2510; buf->box_chars.right_up = 0x2510;
@@ -69,11 +72,22 @@ void draw_init(struct term_buf* buf)
#endif #endif
} }
static void doom_free(struct term_buf* buf);
static void matrix_free(struct term_buf* buf);
void draw_free(struct term_buf* buf) void draw_free(struct term_buf* buf)
{ {
if (config.animate) if (config.animate)
{ {
free(buf->tmp_buf); switch (config.animation)
{
case 0:
doom_free(buf);
break;
case 1:
matrix_free(buf);
break;
}
} }
} }
@@ -118,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 c1 = {buf->box_chars.top, config.fg, config.bg};
struct tb_cell c2 = {buf->box_chars.bot, config.fg, config.bg}; struct tb_cell c2 = {buf->box_chars.bot, config.fg, config.bg};
for (uint8_t i = 0; i < buf->box_width; ++i) for (uint16_t i = 0; i < buf->box_width; ++i)
{ {
tb_put_cell( tb_put_cell(
box_x + i, box_x + i,
@@ -134,7 +148,7 @@ void draw_box(struct term_buf* buf)
c1.ch = buf->box_chars.left; c1.ch = buf->box_chars.left;
c2.ch = buf->box_chars.right; c2.ch = buf->box_chars.right;
for (uint8_t i = 0; i < buf->box_height; ++i) for (uint16_t i = 0; i < buf->box_height; ++i)
{ {
tb_put_cell( tb_put_cell(
box_x - 1, box_x - 1,
@@ -152,9 +166,9 @@ void draw_box(struct term_buf* buf)
{ {
struct tb_cell blank = {' ', config.fg, config.bg}; struct tb_cell blank = {' ', config.fg, config.bg};
for (uint8_t i = 0; i < buf->box_height; ++i) for (uint16_t i = 0; i < buf->box_height; ++i)
{ {
for (uint8_t k = 0; k < buf->box_width; ++k) for (uint16_t k = 0; k < buf->box_width; ++k)
{ {
tb_put_cell( tb_put_cell(
box_x + k, box_x + k,
@@ -165,6 +179,105 @@ void draw_box(struct term_buf* buf)
} }
} }
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* strn_cell(char* s, uint16_t len) // throws
{ {
struct tb_cell* cells = malloc((sizeof (struct tb_cell)) * len); struct tb_cell* cells = malloc((sizeof (struct tb_cell)) * len);
@@ -481,18 +594,118 @@ static void doom_init(struct term_buf* buf)
{ {
buf->init_width = buf->width; buf->init_width = buf->width;
buf->init_height = buf->height; buf->init_height = buf->height;
buf->astate.doom = malloc(sizeof(struct doom_state));
uint16_t tmp_len = buf->width * buf->height; if (buf->astate.doom == NULL)
buf->tmp_buf = malloc(tmp_len);
tmp_len -= buf->width;
if (buf->tmp_buf == NULL)
{ {
dgn_throw(DGN_ALLOC); dgn_throw(DGN_ALLOC);
} }
memset(buf->tmp_buf, 0, tmp_len); uint16_t tmp_len = buf->width * buf->height;
memset(buf->tmp_buf + tmp_len, DOOM_STEPS - 1, buf->width); 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) void animate_init(struct term_buf* buf)
@@ -501,11 +714,16 @@ void animate_init(struct term_buf* buf)
{ {
switch(config.animation) switch(config.animation)
{ {
default: case 0:
{ {
doom_init(buf); doom_init(buf);
break; break;
} }
case 1:
{
matrix_init(buf);
break;
}
} }
} }
} }
@@ -534,7 +752,7 @@ static void doom(struct term_buf* term_buf)
uint16_t dst; uint16_t dst;
uint16_t w = term_buf->init_width; uint16_t w = term_buf->init_width;
uint8_t* tmp = term_buf->tmp_buf; uint8_t* tmp = term_buf->astate.doom->buf;
if ((term_buf->width != term_buf->init_width) || (term_buf->height != term_buf->init_height)) if ((term_buf->width != term_buf->init_width) || (term_buf->height != term_buf->init_height))
{ {
@@ -573,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) void animate(struct term_buf* buf)
{ {
buf->width = tb_width(); buf->width = tb_width();
@@ -582,11 +926,16 @@ void animate(struct term_buf* buf)
{ {
switch(config.animation) switch(config.animation)
{ {
default: case 0:
{ {
doom(buf); doom(buf);
break; break;
} }
case 1:
{
matrix(buf);
break;
}
} }
} }
} }

View File

@@ -19,6 +19,31 @@ struct box
uint32_t right; 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 struct term_buf
{ {
uint16_t width; uint16_t width;
@@ -34,7 +59,7 @@ struct term_buf
uint16_t box_width; uint16_t box_width;
uint16_t box_height; uint16_t box_height;
uint8_t* tmp_buf; union anim_state astate;
}; };
void draw_init(struct term_buf* buf); void draw_init(struct term_buf* buf);
@@ -61,4 +86,7 @@ void animate_init(struct term_buf* buf);
void animate(struct term_buf* buf); void animate(struct term_buf* buf);
bool cascade(struct term_buf* buf, uint8_t* 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 #endif

View File

@@ -7,6 +7,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <ctype.h>
void handle_desktop(void* input_struct, struct tb_event* event) void handle_desktop(void* input_struct, struct tb_event* event)
{ {
@@ -14,11 +15,11 @@ void handle_desktop(void* input_struct, struct tb_event* event)
if ((event != NULL) && (event->type == TB_EVENT_KEY)) 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); 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); input_desktop_left(target);
} }
@@ -76,13 +77,14 @@ void handle_text(void* input_struct, struct tb_event* event)
void input_desktop(struct desktop* target) void input_desktop(struct desktop* target)
{ {
target->list = NULL; target->list = NULL;
target->list_simple = NULL;
target->cmd = NULL; target->cmd = NULL;
target->display_server = NULL; target->display_server = NULL;
target->cur = 0; target->cur = 0;
target->len = 0; target->len = 0;
input_desktop_add(target, strdup(lang.shell), strdup(""), DS_SHELL); 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 #if 0
input_desktop_add(target, strdup(lang.wayland), strdup(""), DS_WAYLAND); input_desktop_add(target, strdup(lang.wayland), strdup(""), DS_WAYLAND);
#endif #endif
@@ -176,6 +178,7 @@ void input_desktop_add(
{ {
++(target->len); ++(target->len);
target->list = realloc(target->list, target->len * (sizeof (char*))); target->list = realloc(target->list, 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->cmd = realloc(target->cmd, target->len * (sizeof (char*)));
target->display_server = realloc( target->display_server = realloc(
target->display_server, target->display_server,
@@ -191,6 +194,21 @@ void input_desktop_add(
} }
target->list[target->cur] = name; 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->cmd[target->cur] = cmd;
target->display_server[target->cur] = display_server; target->display_server[target->cur] = display_server;
} }

View File

@@ -23,6 +23,7 @@ struct text
struct desktop struct desktop
{ {
char** list; char** list;
char** list_simple;
char** cmd; char** cmd;
enum display_server* display_server; enum display_server* display_server;

View File

@@ -214,21 +214,13 @@ void env_init(struct passwd* pwd)
// clean env // clean env
environ[0] = NULL; environ[0] = NULL;
if (term != NULL) setenv("TERM", term ? term : "linux", 1);
{
setenv("TERM", term, 1);
}
else
{
setenv("TERM", "linux", 1);
}
setenv("HOME", pwd->pw_dir, 1); setenv("HOME", pwd->pw_dir, 1);
setenv("PWD", pwd->pw_dir, 1); setenv("PWD", pwd->pw_dir, 1);
setenv("SHELL", pwd->pw_shell, 1); setenv("SHELL", pwd->pw_shell, 1);
setenv("USER", pwd->pw_name, 1); setenv("USER", pwd->pw_name, 1);
setenv("LOGNAME", 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 // Set PATH if specified in the configuration
if (strlen(config.path)) if (strlen(config.path))
@@ -242,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) switch (display_server)
{ {
case DS_WAYLAND: case DS_WAYLAND:
@@ -272,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( void add_utmp_entry(
struct utmp *entry, struct utmp *entry,
char *username, char *username,
@@ -304,10 +301,51 @@ void remove_utmp_entry(struct utmp *entry) {
endutent(); 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]; char xauthority[256];
snprintf(xauthority, 256, "%s/%s", dir, ".lyxauth"); snprintf(xauthority, 256, "%s/%s", xauth_dir, xauth_file);
setenv("XAUTHORITY", xauthority, 1); setenv("XAUTHORITY", xauthority, 1);
setenv("DISPLAY", display_name, 1); setenv("DISPLAY", display_name, 1);
@@ -343,18 +381,10 @@ void xorg(
const char* vt, const char* vt,
const char* desktop_cmd) 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]; char display_name[4];
snprintf(display_name, 3, ":%d", get_free_display()); 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 // start xorg
pid_t pid = fork(); pid_t pid = fork();
@@ -471,6 +501,13 @@ void auth(
{ {
int ok; 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 // open pam session
const char* creds[2] = {login->text, password->text}; const char* creds[2] = {login->text, password->text};
struct pam_conv conv = {login_conv, creds}; struct pam_conv conv = {login_conv, creds};
@@ -578,14 +615,14 @@ void auth(
} }
// get a display // get a display
char tty_id [3];
char vt[5]; char vt[5];
snprintf(tty_id, 3, "%d", config.tty);
snprintf(vt, 5, "vt%d", config.tty); snprintf(vt, 5, "vt%d", config.tty);
// set env // set env (this clears the environment)
env_init(pwd); 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()) if (dgn_catch())
{ {
@@ -600,9 +637,6 @@ void auth(
putenv(env[i]); putenv(env[i]);
} }
// add xdg variables
env_xdg(tty_id, desktop->display_server[desktop->cur]);
// execute // execute
int ok = chdir(pwd->pw_dir); int ok = chdir(pwd->pw_dir);

View File

@@ -14,12 +14,15 @@
#include <stdio.h> #include <stdio.h>
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#define ARG_COUNT 7 #define ARG_COUNT 7
// things you can define:
// GIT_VERSION_STRING #ifndef LY_VERSION
#define LY_VERSION "0.6.0"
#endif
// global // global
struct lang lang; struct lang lang;
@@ -28,16 +31,14 @@ struct config config;
// args handles // args handles
void arg_help(void* data, char** pars, const int pars_count) 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) void arg_version(void* data, char** pars, const int pars_count)
{ {
#ifdef GIT_VERSION_STRING printf("Ly version %s\n", LY_VERSION);
printf("Ly version %s\n", GIT_VERSION_STRING); exit(0);
#else
printf("Ly version unknown\n");
#endif
} }
// low-level error messages // low-level error messages
@@ -108,11 +109,7 @@ int main(int argc, char** argv)
} }
config_load(config_path); config_load(config_path);
if (strcmp(config.lang, "en") != 0)
{
lang_load(); lang_load();
}
void* input_structs[3] = void* input_structs[3] =
{ {
@@ -139,13 +136,27 @@ int main(int argc, char** argv)
// init visible elements // init visible elements
struct tb_event event; struct tb_event event;
struct term_buf buf; struct term_buf buf;
uint8_t active_input = config.default_input;
(*input_handles[active_input])(input_structs[active_input], NULL); //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;
}
// init drawing stuff // init drawing stuff
draw_init(&buf); 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) if (config.animate)
{ {
animate_init(&buf); animate_init(&buf);
@@ -174,10 +185,14 @@ int main(int argc, char** argv)
{ {
if (auth_fails < 10) if (auth_fails < 10)
{ {
(*input_handles[active_input])(input_structs[active_input], NULL);
tb_clear(); tb_clear();
animate(&buf); animate(&buf);
draw_bigclock(&buf);
draw_box(&buf); draw_box(&buf);
draw_clock(&buf);
draw_labels(&buf); draw_labels(&buf);
if(!config.hide_f1_commands)
draw_f_commands(); draw_f_commands();
draw_lock_state(&buf); draw_lock_state(&buf);
position_input(&buf, &desktop, &login, &password); position_input(&buf, &desktop, &login, &password);
@@ -195,7 +210,30 @@ int main(int argc, char** argv)
tb_present(); 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) if (error < 0)
{ {
@@ -221,8 +259,10 @@ int main(int argc, char** argv)
if (active_input > 0) if (active_input > 0)
{ {
input_text_clear(input_structs[active_input]); input_text_clear(input_structs[active_input]);
update = true;
} }
break; break;
case TB_KEY_CTRL_K:
case TB_KEY_ARROW_UP: case TB_KEY_ARROW_UP:
if (active_input > 0) if (active_input > 0)
{ {
@@ -230,6 +270,7 @@ int main(int argc, char** argv)
update = true; update = true;
} }
break; break;
case TB_KEY_CTRL_J:
case TB_KEY_ARROW_DOWN: case TB_KEY_ARROW_DOWN:
if (active_input < 2) if (active_input < 2)
{ {
@@ -242,7 +283,7 @@ int main(int argc, char** argv)
if (active_input > 2) if (active_input > 2)
{ {
active_input = PASSWORD_INPUT; active_input = SESSION_SWITCH;
} }
update = true; update = true;
break; break;
@@ -304,8 +345,7 @@ int main(int argc, char** argv)
{ {
execl("/bin/sh", "sh", "-c", config.shutdown_cmd, NULL); execl("/bin/sh", "sh", "-c", config.shutdown_cmd, NULL);
} }
else if (reboot)
if (reboot)
{ {
execl("/bin/sh", "sh", "-c", config.restart_cmd, NULL); execl("/bin/sh", "sh", "-c", config.restart_cmd, NULL);
} }