mirror of
https://github.com/javalsai/lidm.git
synced 2025-07-03 14:25:03 +02:00
Merge pull request #6 from DeaDvey/master
Mostly README changes but other shit too.
This commit is contained in:
commit
3a80aaa663
21
Makefile
21
Makefile
@ -24,3 +24,24 @@ lidm: $(OBJ)
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(ODIR)/*.o *- li $(INCDIR)/*-
|
||||
|
||||
# Copy lidm to /usr/bin
|
||||
install: lidm
|
||||
install -m755 ./lidm /usr/bin
|
||||
install -m755 ./themes/default.ini /etc/lidm.ini
|
||||
|
||||
install-service:
|
||||
@if command -v systemctl &> /dev/null; then \
|
||||
make install-service-systemd; \
|
||||
elif command -v dinitctl &> /dev/null; then \
|
||||
make install-service-dinit; \
|
||||
else \
|
||||
printf '\x1b[1;31m%s\x1b[0m\n' "Unknown init system, skipping install..."; \
|
||||
fi
|
||||
|
||||
install-service-systemd:
|
||||
install -m755 ./assets/services/systemd.service /etc/systemd/system/lidm.service
|
||||
@printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 'systemctl enable lidm'"
|
||||
install-service-dinit:
|
||||
install -m755 ./assets/services/dinit /etc/dinit.d/lidm
|
||||
@printf '\x1b[1m%s\x1b[0m\n\n' " don't forget to run 'dinitctl enable lidm'"
|
||||
|
107
README.md
107
README.md
@ -1,83 +1,111 @@
|
||||
# lidm
|
||||
Lidm is a really light display manager made in C, highly customizable and held together by hopes and prayers 🙏
|
||||
# LiDM
|
||||
LiDM is a really light display manager made in C, highly customizable and held together by hopes and prayers 🙏.
|
||||
|
||||

|
||||
> *this is shown as in a terminal emulator, actual linux console doesn't support as much color and decorations*
|
||||

|
||||
> *This is shown as in a terminal emulator, actual linux console doesn't support as much color and decorations.*
|
||||
|
||||
> *but all colors and strings are fully customizable*
|
||||
|
||||
> *I'm open if anybody wants to contact me to record a proper demo of the program, my laptop can't handle it and idk how to config obs for hyprland (ended up doing it, spent 40min processing a 2min video just to give 1fps)*
|
||||
> *But all colors and strings are fully customizable.*
|
||||
|
||||
# Index
|
||||
(TODO, VSC(odium) does this automatically, I'm on nvim rn 😎)
|
||||
(TODO, VSC(odium) does this automatically, I'm on nvim rn 😎).
|
||||
|
||||
## Features
|
||||
* Builds fast af
|
||||
* Works everywhere you can get gcc to compile
|
||||
* Fast and possibly efficient
|
||||
* Builds fast as FUCK.
|
||||
* 2.830s: laptop, -O3, -j2, `AMD E-450 APU with Radeon(tm) HD Graphics`
|
||||
* 0.172s: desktop, -O3, -j12, `AMD Ryzen 5 5600G with Radeon Graphics`
|
||||
* Works everywhere you can get gcc to compile.
|
||||
* Fast and possibly efficient.
|
||||
* Fully customizable, from strings, through action keys, to colors (I hope you know ansi escape codes)
|
||||
* Automatically detects xorg and wayland sessions, plus allowing to launch the default user shell (if enabled in config)
|
||||
* Automatically detects xorg and wayland sessions, plus allowing to launch the default user shell (If enabled in config)
|
||||
* Starts with many init systems eg: systemd and dinit.
|
||||
|
||||
## WIP
|
||||
* desktop's file `TryExec` key
|
||||
* Save last selection
|
||||
* Show/hide passwd switch
|
||||
* Long sessions, strings, usernames, passwords... they will just overflow or f\*ck your terminal, I know it and I don't know if I'll fix it.
|
||||
* Desktop's file `TryExec` key.
|
||||
* Save last selection.
|
||||
* Show/hide passwd switch.
|
||||
* Long sessions, strings, usernames, passwords... they will just overflow or fuck your terminal, I know it and I don't know if I'll fix it.
|
||||
|
||||
## Forget it
|
||||
* Any kind of arguments
|
||||
* UTF characters, I'm using `strlen()` and treating characters as per byte basis, UTF-8 chars might work or not actually, might fix it by replacing some `strlen()` with a utflen one.
|
||||
|
||||
> [!CAUTION]
|
||||
> (they should add `> [!DISCLAIMER]` fr) I wrote this readme with the same quality as the code, behing this keyboard there's half a brainrotcell left writing what it remembers of this program, so don't take this to seriously, I'm typing as I think without filter lol, but the program works, or should. Also, about any "TODO" in this readme (or the code), I didn't forget finishing it, I actually don't care. And, references to ~~code~~ **anything** are likely to be outdated, check the commit history to know what I was refering to exactly if you care.
|
||||
> (They should add `> [!DISCLAIMER]` fr) I wrote this readme with the same quality as the code, behing this keyboard there's half a brainrotcell left writing what it remembers of this program, so don't take this to seriously, I'm typing as I think without filter lol, but the program works, or should. Also, about any "TODO" in this readme (Or the code), I didn't forget finishing it, I actually don't care. And, references to ~~code~~ **anything** are likely to be outdated, check the commit history to know what I was refering to exactly if you care.
|
||||
|
||||
# Ideology
|
||||
We all know that the most important thing in a project is the ideology of the author and the movements he wants to support, so [**#stopchatcontrol**](https://stopchatcontrol.eu).
|
||||
<!-- doubt markdown will allow me to render this properly -->
|
||||
[  ](https://stopchatcontrol.eu)
|
||||
> *there's also a [change.org post](https://www.change.org/p/stoppt-die-chatkontrolle-grundrechte-gelten-auch-im-netz)*
|
||||
> *there's also a [change.org post](https://www.change.org/p/stoppt-die-chatkontrolle-grundrechte-gelten-auch-im-netz).*
|
||||
|
||||
# Backstory
|
||||
I went into summer travel to visit family with an old laptop that barely supports x86_64, and ly recently added some avx2 instructions I think (I just get invalid op codes), manually building (any previous commit too) didn't work because of something in the `build.zig` file, so out of boredom I decided to craft up my own simple display manager on the only language this thing can handle, ✨C✨ (I hate this and reserve the right for the rust rewrite, actually solid).
|
||||
I travelling in the summer to visit family with an old laptop that barely supports x86_64, and ly recently added some avx2 instructions I think (I just get invalid op codes), manually building (any previous commit too) didn't work because of something in the `build.zig` file, so out of boredom I decided to craft up my own simple display manager on the only language this thing can handle, ✨C✨ (I hate this and reserve the right for the rust rewrite, actually solid).
|
||||
|
||||
I spedrun it, basically did in in 3 days on the same couch on [unhelty back positions (even worse)](https://i.redd.it/4bkje8amisu61.png) while touching *some* grass (:o), and I'm bad af in C, so this is spaghetti code on **another** level. I think it doesn't do almost anything unsafe, I mean, I didn't check allocations and it's capable of reallocating memory until your username uses all memory and crashes the system due to a off by 1 error, but pretty consistent otherwise (probably).
|
||||
I spedrun it, basically did in in 3 days on the same couch on [unhelty back positions (even worse)](https://i.redd.it/4bkje8amisu61.png) while touching *some* grass (:o), and I'm bad af in C, so this is spaghetti code on **another** level. I think it doesn't do almost anything unsafe, I mean, I didn't check allocations and it's capable of reallocating memory until your username uses all memory and crashes the system due to a off by 1 error, but pretty consistent otherwise (Probably).
|
||||
|
||||
The name is just ly but changing "y" with "i", that had a reason but forgot it, (maybe the i in *simple*), so I remembered this sh*tty laptop with a lid, this thing is also a display manager (dm, ly command is also `ly-dm`), so just did lidm due to all that.
|
||||
The name is just ly but changing "y" with "i", that had a reason but forgot it, (maybe the i in *simple*), so I remembered this sh*tty laptop with a lid, this thing is also a display manager (Dm, ly command is also `ly-dm`), so just did lidm due to all that.
|
||||
|
||||
 <!--gif's likely broken-->
|
||||
|
||||
Btw, this laptop is so bad that I can't even render markdown in reasonable time, I'll just push this and fix render issues live :)
|
||||
FYI, this laptop is so bad that I can't even render markdown in reasonable time, I'll just push this and fix render issues live :).
|
||||
|
||||
# Requirements
|
||||
* A computer with unix based system.
|
||||
* That system should have the resources neccessary for this program to make sense (sessions, users...)
|
||||
* A compiler (optional, you can compile by hand, but I doubt you want to see the code)
|
||||
* Make (also optional, but does things atomatically, make sure `gcc` and `mkdir -p` work as expected)
|
||||
* That system should have the resources neccessary for this program to make sense (Sessions, users...).
|
||||
* A compiler (optional, you can compile by hand, but I doubt you want to see the code).
|
||||
* Make (Also optional, but does things atomatically, make sure `gcc` and `mkdir -p` work as expected).
|
||||
|
||||
# Usage
|
||||
On top of pure intuition:
|
||||
* you can change focus of session/user/passwd with up/down arrows
|
||||
* in case arrow keys do nothing on the focused input (either is empty text or doesn't have more options), it tries to change session and if there's only one session it changes user
|
||||
* typing anything will allow to put a custom user or shell command too, you can use arrow keys to move
|
||||
* ESC and then left/right arrows will force to change the option of the focused input, useful if you're editing the current input and arrow keys just move
|
||||
* editing a predefined option on a user or a shell session, will put you in edit mode preserving the original value, other cases start from scratch
|
||||
Regarding arguments: If a single argument is provided (don't even do `--` or standard parsing...), it passes that argument to `chvt` on startup, used (at least) by the dinit service.
|
||||
|
||||
# Compiling
|
||||
On top of pure intuition:
|
||||
* You can change focus of session/user/passwd with up/down arrows.
|
||||
* In case arrow keys do nothing on the focused input (Either is empty text or doesn't have more options), it tries to change session and if there's only one session it changes user.
|
||||
* Typing anything will allow to put a custom user or shell command too, you can use arrow keys to move.
|
||||
* ESC and then left/right arrows will force to change the option of the focused input, useful if you're editing the current input and arrow keys just move.
|
||||
* Editing a predefined option on a user or a shell session, will put you in edit mode preserving the original value, other cases start from scratch.
|
||||
|
||||
# Building from source
|
||||
```sh
|
||||
git clone https://github.com/javalsai/lidm.git
|
||||
cd lidm
|
||||
make # 👍
|
||||
```
|
||||
|
||||
# Installation
|
||||
* You can put the compiled binary anywhere you want tbh, you can even setuid it if you want to run it with any user, but code's not too safe 😬.
|
||||
* Prepare the [configuration](#configuring)
|
||||
* Prepare the [configuration](#configuring).
|
||||
```sh
|
||||
# place binary in /usr/bin and copy
|
||||
# default theme to /etc
|
||||
make install
|
||||
```
|
||||
* Make a service file for this if you want it on launch, just check how ly does it, this works pretty much the same way.
|
||||
```sh
|
||||
# automatically detects init system
|
||||
# and installs service file (for tty7)
|
||||
make install-service
|
||||
|
||||
# There's manual scripts too:
|
||||
make install-service-systemd # systemd
|
||||
make install-service-dinit # dinit
|
||||
```
|
||||
|
||||
|
||||
# Disabling other DM's with systemd
|
||||
You may want to disable your current Display Manager for instance:
|
||||
```sh
|
||||
sudo systemctl disable sddm # Disables SDDM (KDE's dm)
|
||||
sudo systemctl disable lightdm # Disables lightDM (popular lightweight DM)
|
||||
sudo systemctl disable gdm # Disables GDM (Gnomes DM)
|
||||
sudo systemctl disable ly # Disables LYDM (tui dm)
|
||||
```
|
||||
|
||||
# Configuring
|
||||
Copy any `.ini` file from [`themes/`](./themes/) (`default.ini` will always be updated) to `/etc/lidm.ini` and/or configure it to your liking. Also, don't place empty lines (for now).
|
||||
|
||||
Also configurable colors are just gonna be put inside `\x1b[...m`, ofc you can add an m to break this and this can f* up really bad or even make some nice UI effect possible, but please don't, you should also be able to embed the `\x1b` byte in the config as I won't parse escape codes, I think that the parser is just gonna grab anything in the config file from the space after the `=` (yes, I'ma enforce that space, get good taste if you don't like it) until the newline, you can put any abomination in there.
|
||||
|
||||
Btw, the default fg style should disable decorators set up in other elements (cursive, underline... it's just adding 20 to the number btw, so if cursive is 4 (iirc), disabling it is 24).
|
||||
The default fg style should disable decorators set up in other elements (cursive, underline... it's just adding 20 to the number btw, so if cursive is 4 (iirc), disabling it is 24).
|
||||
|
||||
# Contributing
|
||||
Don't do this to yourself, but you can ofc, you can also fork or whatever (make sure to comply with GNU's GPLv3), but I want to do the rust rewrite 😡 (after it, I'll leave this around in case somebody with ancient hardware needs it, or if somebody wants to port it for a microwave...)
|
||||
@ -86,15 +114,18 @@ This is also GPLv3 bcs I was too lazy to look for the "do anything I don't care"
|
||||
|
||||
# Contributors
|
||||
Special thanks to:
|
||||
* Javalsai, Maintainer and everyone's second favourite penguin!!!
|
||||
* DeaDvey, the most awesomest of all, did some pretty HARDCORE gramer cheking.
|
||||
* KillerTofus, [made the AUR package](https://github.com/javalsai/lidm/pull/2)! Saved me from reading the Arch Wiki 💀.
|
||||
* ChatGPT, in times of slow laptops where pages take ages to load, a single tab connected to a bunch of burning cloud GPUs feeding corporate hype is all you need to get quick answers for your questions, as long as you know how to filter AI crap ofc.
|
||||
* [My lack of gf](https://www.instagram.com/reel/C8sa3Gltmtq/?igsh=NO_ZUCKERBERG__FUCK_OFF_YOUR_FINGERPRINGTING_QUERY__OBVIOUSLY_STANDS_FOR_INSTAGRAM_SHARE_ID_FFS), can't imagine this project being possible if somebody actually cared about me daily.
|
||||
|
||||
# Milestones
|
||||
* If this ~~video~~ **repo** gets to 100 ~~likes~~ **stars**, I'll make an arch aur package and properly document installation on multiple init systems.
|
||||
* (I might also make a nix flake if yall nix nerds ask me for it)
|
||||
* (I might also make a nix flake if yall nix nerds ask me for it).
|
||||
|
||||
# Recommendations
|
||||
Hope you didn't expect actual project recommendations, but these songs are 🔥
|
||||
Hope you didn't expect actual project recommendations, but these songs are 🔥:
|
||||
* "Sixpence None the Richer - Kiss Me"
|
||||
* "Avril Lavigne - Complicated"
|
||||
* "Shawn Mendes - There's Nothing Holdin' Me Back"
|
||||
@ -110,6 +141,8 @@ Hope you didn't expect actual project recommendations, but these songs are 🔥
|
||||
* "The Neighbourhood - Sweater Weather"
|
||||
* "Cascada - Everytime We Touch" (potentially the sped up versoin if better)
|
||||
* "Mitski - My Love Mine All Mine"
|
||||
* "Dutch Melrose - RUNRUNRUN"
|
||||
* "Bring Me The Horizon - Happy Song"
|
||||
|
||||
Oh, an actual recommendation, if you don't like a element you can change the fg color of it to be the same as the bg.
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
8
assets/services/dinit
Normal file
8
assets/services/dinit
Normal file
@ -0,0 +1,8 @@
|
||||
type = process
|
||||
command = /sbin/agetty tty7 linux-c -n -l /bin/lidm -o 7
|
||||
restart = true
|
||||
depends-on = login.target
|
||||
termsignal = HUP
|
||||
smooth-recovery = true
|
||||
inittab-id = 7
|
||||
inittab-line = tty7
|
17
assets/services/systemd.service
Normal file
17
assets/services/systemd.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=TUI display manager
|
||||
After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||
After=getty@tty3.service
|
||||
Conflicts=getty@tty3.service
|
||||
|
||||
[Service]
|
||||
Type=idle
|
||||
ExecStart=/usr/bin/lidm
|
||||
StandardError=journal
|
||||
StandardInput=tty
|
||||
TTYPath=/dev/tty3
|
||||
TTYReset=yes
|
||||
TTYVHangup=yes
|
||||
|
||||
[Install]
|
||||
Alias=display-manager.service
|
85
src/auth.c
85
src/auth.c
@ -5,12 +5,14 @@
|
||||
#include <security/pam_misc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <auth.h>
|
||||
#include <sessions.h>
|
||||
#include <ui.h>
|
||||
#include <unistd.h>
|
||||
#include <util.h>
|
||||
|
||||
int pam_conversation(int num_msg, const struct pam_message **msg,
|
||||
struct pam_response **resp, void *appdata_ptr) {
|
||||
@ -51,6 +53,11 @@ pam_handle_t *get_pamh(char *user, char *passwd) {
|
||||
}
|
||||
#undef CHECK_PAM_RET
|
||||
|
||||
void *shmalloc(size_t size) {
|
||||
return mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS,
|
||||
-1, 0);
|
||||
}
|
||||
|
||||
void moarEnv(char *user, struct session session, struct passwd *pw) {
|
||||
chdir(pw->pw_dir);
|
||||
setenv("HOME", pw->pw_dir, true);
|
||||
@ -96,45 +103,66 @@ bool launch(char *user, char *passwd, struct session session,
|
||||
return false;
|
||||
}
|
||||
|
||||
// point of no return
|
||||
// TODO: move this to get_pamh, before first setcred, like login does
|
||||
if (cb != NULL)
|
||||
cb();
|
||||
|
||||
if (setgid(pw->pw_gid) == -1) {
|
||||
perror("setgid");
|
||||
exit(EXIT_FAILURE);
|
||||
bool *reach_session = shmalloc(sizeof(bool));
|
||||
if (reach_session == NULL) {
|
||||
perror("error allocating shared memory");
|
||||
return false;
|
||||
}
|
||||
if (initgroups(user, pw->pw_gid) == -1) {
|
||||
perror("init groups");
|
||||
exit(EXIT_FAILURE);
|
||||
*reach_session = false;
|
||||
|
||||
uint pid = fork();
|
||||
if (pid == 0) { // child
|
||||
char *TERM = NULL;
|
||||
char *_GETTERM = getenv("TERM");
|
||||
if (_GETTERM != NULL)
|
||||
strcln(&TERM, _GETTERM);
|
||||
if (clearenv() != 0) {
|
||||
print_errno("clearenv");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
char **envlist = pam_getenvlist(pamh);
|
||||
if (envlist == NULL) {
|
||||
perror("pam_getenvlist");
|
||||
exit(EXIT_FAILURE);
|
||||
print_errno("pam_getenvlist");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// TODO: chown stdin to user
|
||||
|
||||
if (setuid(pw->pw_uid) == -1) {
|
||||
perror("setuid");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
system("clear");
|
||||
printf("\x1b[0m\x1b[H");
|
||||
for (uint i = 0; envlist[i] != NULL; i++) {
|
||||
putenv(envlist[i]);
|
||||
}
|
||||
// NOTE: path hotfix
|
||||
// FIXME: path hotfix
|
||||
putenv("PATH=/bin:/usr/bin");
|
||||
if (TERM != NULL) {
|
||||
setenv("TERM", TERM, true);
|
||||
free(TERM);
|
||||
}
|
||||
|
||||
free(envlist);
|
||||
moarEnv(user, session, pw);
|
||||
|
||||
uint pid = fork();
|
||||
if (pid == 0) { // child
|
||||
// TODO: chown stdin to user
|
||||
// does it inherit stdin from parent and
|
||||
// does parent need to reclaim it after
|
||||
// this dies?
|
||||
|
||||
if (setgid(pw->pw_gid) == -1) {
|
||||
print_errno("setgid");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
if (initgroups(user, pw->pw_gid) == -1) {
|
||||
print_errno("initgroups");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (setuid(pw->pw_uid) == -1) {
|
||||
perror("setuid");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (cb != NULL)
|
||||
cb();
|
||||
|
||||
*reach_session = true;
|
||||
|
||||
// TODO: these will be different due to TryExec
|
||||
// and, Exec/TryExec might contain spaces as args
|
||||
if (session.type == SHELL) {
|
||||
@ -152,6 +180,11 @@ bool launch(char *user, char *passwd, struct session session,
|
||||
pam_setcred(pamh, PAM_DELETE_CRED);
|
||||
pam_close_session(pamh, 0);
|
||||
pam_end(pamh, PAM_SUCCESS);
|
||||
|
||||
if (*reach_session == false) {
|
||||
return false;
|
||||
} else
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
11
src/main.c
11
src/main.c
@ -9,7 +9,18 @@
|
||||
#include <ui.h>
|
||||
#include <users.h>
|
||||
|
||||
void chvt(char *arg) {
|
||||
size_t bsize = snprintf(NULL, 0, "chvt %s", arg) + 1;
|
||||
char *buf = malloc(bsize);
|
||||
snprintf(buf, bsize, "chvt %s", arg);
|
||||
system(buf);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc == 2)
|
||||
chvt(argv[1]);
|
||||
|
||||
struct config *config = parse_config("/etc/lidm.ini");
|
||||
if (config == NULL) {
|
||||
fprintf(stderr, "error parsing config\n");
|
||||
|
@ -40,6 +40,7 @@ static u_int16_t used_size = 0;
|
||||
static struct session *sessions = NULL;
|
||||
static struct sessions_list *__sessions_list = NULL;
|
||||
|
||||
// NOTE: commented printf's here would be nice to have debug logs if I ever implement it
|
||||
static enum session_type session_type;
|
||||
static int fn(const char *fpath, const struct stat *sb, int typeflag) {
|
||||
// practically impossible to reach this
|
||||
@ -47,12 +48,14 @@ static int fn(const char *fpath, const struct stat *sb, int typeflag) {
|
||||
if (used_size == 0xffff)
|
||||
return 0;
|
||||
|
||||
if (!S_ISREG(sb->st_mode))
|
||||
if (sb == NULL || !S_ISREG(sb->st_mode))
|
||||
return 0;
|
||||
|
||||
/*printf("gonna open %s\n", fpath);*/
|
||||
FILE *fd = fopen(fpath, "r");
|
||||
if (fd == NULL) {
|
||||
fprintf(stderr, "error opening file (r) %s", fpath);
|
||||
perror("fopen");
|
||||
fprintf(stderr, "error opening file (r) %s\n", fpath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -63,6 +66,7 @@ static int fn(const char *fpath, const struct stat *sb, int typeflag) {
|
||||
char *exec_buf = NULL;
|
||||
char *tryexec_buf = NULL;
|
||||
while (true) {
|
||||
/*printf(".");*/
|
||||
char *buf = malloc(sb->st_blksize);
|
||||
ssize_t read_size = getline(&buf, &alloc_size, fd);
|
||||
if (read_size == -1) {
|
||||
@ -91,11 +95,13 @@ static int fn(const char *fpath, const struct stat *sb, int typeflag) {
|
||||
if (found == 0b111)
|
||||
break;
|
||||
}
|
||||
/*printf("\nend parsing...\n");*/
|
||||
|
||||
fclose(fd);
|
||||
|
||||
// just add this to the list
|
||||
if (name_buf != NULL && exec_buf != NULL) {
|
||||
/*printf("gonna add to session list\n");*/
|
||||
if (used_size >= alloc_size) {
|
||||
alloc_size += bs;
|
||||
sessions = realloc(sessions, alloc_size * unit_size);
|
||||
@ -128,6 +134,7 @@ struct sessions_list *get_avaliable_sessions() {
|
||||
|
||||
for (uint i = 0; i < sources_size; i++) {
|
||||
session_type = sources[i].type;
|
||||
/*printf("recurring into %s\n", sources[i].dir);*/
|
||||
ftw(sources[i].dir, &fn, 1);
|
||||
}
|
||||
|
||||
|
2
src/ui.c
2
src/ui.c
@ -569,7 +569,7 @@ void print_errno(const char *descr) {
|
||||
origin.x, theme.colors.err, errno, strerror(errno));
|
||||
else {
|
||||
fprintf(stderr, "\x1b[%d;%dH\x1b[%sm%s(%d): %s", origin.y - 1, origin.x,
|
||||
descr, theme.colors.err, errno, strerror(errno));
|
||||
theme.colors.err, descr, errno, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user