commit 994f2e2cdd7a0c2a41ca3e74cd566aa65ce42427 Author: potkan Date: Tue Apr 28 23:17:24 2026 +0200 initial shit thing diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..e1dd209 --- /dev/null +++ b/install.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +echo Are you using sudo or doas? (root permisions) +echo (1=sudo,2=doas) +read rootperms + +if [ $rootperms == 1] +then + make + sudo make install + sudo systemctl enable 4y.service + sudo systemctl disable getty@tty2.service + echo Installation finished. + echo Do you wish to proceed to 4y menu? + read proceed +elif [ $rootperms == 2 ] +then + make + doas make install + doas systemctl enable 4y.service + doas systemctl disable getty@tty2.service + echo Installation finished. + echo Do you wish to proceed to 4y menu? [Y/N] + read proceed +else + echo error: you can only choose sudo or doas. If you use something different youre gonna need to proceed to manual installation + echo exiting installation. + +if [ $proceed == Y] +then + systemctl start 4y +else + echo installation finished successfully, exiting. diff --git a/license.md b/license.md new file mode 100644 index 0000000..5c93f45 --- /dev/null +++ b/license.md @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/makefile b/makefile new file mode 100644 index 0000000..a842e62 --- /dev/null +++ b/makefile @@ -0,0 +1,106 @@ +NAME = 4y +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')\" +LINK = -lpam -lxcb +VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full --suppressions=../res/valgrind.supp +CMD = ./$(NAME) + +OS:= $(shell uname -s) +ifeq ($(OS), Linux) + FLAGS+= -D_DEFAULT_SOURCE +endif + +BIND = bin +OBJD = obj +SRCD = src +SUBD = sub +RESD = res +TESTD = tests + +DATADIR ?= ${DESTDIR}/etc/4y +FLAGS+= -DDATADIR=\"$(DATADIR)\" + +INCL = -I$(SRCD) +INCL+= -I$(SUBD)/ctypes +INCL+= -I$(SUBD)/argoat/src +INCL+= -I$(SUBD)/configator/src +INCL+= -I$(SUBD)/dragonfail/src +INCL+= -I$(SUBD)/termbox_next/src + +SRCS = $(SRCD)/main.c +SRCS += $(SRCD)/config.c +SRCS += $(SRCD)/draw.c +SRCS += $(SRCD)/inputs.c +SRCS += $(SRCD)/login.c +SRCS += $(SRCD)/utils.c +SRCS += $(SUBD)/argoat/src/argoat.c +SRCS += $(SUBD)/configator/src/configator.c +SRCS += $(SUBD)/dragonfail/src/dragonfail.c + +SRCS_OBJS:= $(patsubst %.c,$(OBJD)/%.o,$(SRCS)) +SRCS_OBJS+= $(SUBD)/termbox_next/bin/termbox.a + +.PHONY: final +final: $(BIND)/$(NAME) + +$(OBJD)/%.o: %.c + @echo "building object $@" + @mkdir -p $(@D) + @$(CC) $(INCL) $(FLAGS) -c -o $@ $< + +$(SUBD)/termbox_next/bin/termbox.a: + @echo "building static object $@" + @(cd $(SUBD)/termbox_next && $(MAKE)) + +$(BIND)/$(NAME): $(SRCS_OBJS) + @echo "compiling executable $@" + @mkdir -p $(@D) + @$(CC) -o $@ $^ $(LINK) + +run: + @cd $(BIND) && $(CMD) + +leak: leakgrind +leakgrind: $(BIND)/$(NAME) + @rm -f valgrind.log + @cd $(BIND) && valgrind $(VALGRIND) 2> ../valgrind.log $(CMD) + @less valgrind.log + +install: $(BIND)/$(NAME) + @echo "installing" + @install -dZ ${DESTDIR}/etc/4y + @install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin + @install -DZ $(RESD)/config.ini -t ${DESTDIR}/etc/4y + @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)/4y.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system + @install -DZ $(RESD)/pam.d/4y -m 644 -t ${DESTDIR}/etc/pam.d + +installnoconf: $(BIND)/$(NAME) + @echo "installing without the configuration file" + @install -dZ ${DESTDIR}/etc/4y + @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)/4y.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system + @install -DZ $(RESD)/pam.d/4y -m 644 -t ${DESTDIR}/etc/pam.d + +uninstall: + @echo "uninstalling" + @rm -rf ${DESTDIR}/etc/4y + @rm -rf $(DATADIR) + @rm -f ${DESTDIR}/usr/bin/4y + @rm -f ${DESTDIR}/usr/lib/systemd/system/4y.service + @rm -f ${DESTDIR}/etc/pam.d/4y + +clean: + @echo "cleaning" + @rm -rf $(BIND) $(OBJD) valgrind.log + @(cd $(SUBD)/termbox_next && $(MAKE) clean) diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..204dfee --- /dev/null +++ b/readme.md @@ -0,0 +1,96 @@ +# 4y - Ly Fork - TUI display manager +![Ly screenshot](https://user-images.githubusercontent.com/5473047/88958888-65efbf80-d2a1-11ea-8ae5-3f263bce9cce.png "Ly screenshot") + +# WARNING! +this fork of Ly is unfinished. please dont hate on it its still in development. + + +4y is a fork of Ly, It is made to be easier and have an auto install command. +Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD. + +## Dependencies + - a C99 compiler (tested with tcc and gcc) + - a C standard library + - GNU make + - pam + - xcb + - xorg + - xorg-xauth + - mcookie + - 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. + +## Support +The following desktop environments were tested with success + - bspwm + - budgie + - cinnamon + - deepin + - dwm + - enlightenment + - gnome + - i3 + - kde + - lxde + - lxqt + - mate + - qtile + - sway + - xfce + - pantheon + - maxx + - windowmaker + +4y should work with any X desktop environment, and provides +basic wayland support (sway works very well, for example). + +## systemd? +For the autoinstall script. youre gonna need systemd. however, +with some tinkering you dont need systemd to do this! + +## Installing +just do "git clone --recurse-submodules https://github.com/M4RT1NDEV/4y.git" + "cd 4y" + "bash install.sh" or "./install.sh" + +## Configuration +You can find all the configuration in `/etc/4y/config.ini`. +The file is commented, and includes the default values. + +## Controls +Use the up and down arrow keys to change the current field, and the +left and right arrow keys to change the target desktop environment +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: +``` +#!/bin/sh +``` + +## Tips +The numlock and capslock state is printed in the top-right corner. +Use the F1 and F2 keys to respectively shutdown and reboot. +Take a look at your .xsession if X doesn't start, as it can interfere +(this file is launched with X to configure the display properly). + +## PSX DOOM fire animation +To enable the famous PSX DOOM fire described by [Fabien Sanglard](http://fabiensanglard.net/doom_fire_psx/index.html), +just uncomment `animate = true` in `/etc/ly/config.ini`. You may also +disable the main box borders with `hide_borders = true`. + +## Additional Information +The name "4y" comes from the 4 in M4RT1NDEV and the y is from +the name ly which is the login manager this is a fork of. + +The name "Ly" is a tribute to the fairy from the game Rayman. +Ly was tested by oxodao, who is some seriously awesome dude.