mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
ncneofetch: accept -v
This commit is contained in:
parent
ff247c362d
commit
ae1121402d
@ -8,7 +8,7 @@ ncneofetch - Generate low-effort posts for r/unixporn
|
||||
|
||||
# SYNOPSIS
|
||||
|
||||
**ncneofetch**
|
||||
**ncneofetch** [**-v**]
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
@ -18,6 +18,8 @@ and displays some system information. It is a blatant ripoff of
|
||||
|
||||
# OPTIONS
|
||||
|
||||
**-v**: Increase verbosity.
|
||||
|
||||
# NOTES
|
||||
|
||||
Optimal display requires a terminal advertising the **rgb** terminfo(5)
|
||||
|
@ -661,13 +661,31 @@ ncneofetch(struct notcurses* nc){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(void){
|
||||
static void
|
||||
usage(const char* arg0, FILE* fp){
|
||||
fprintf(fp, "usage: %s [ -v ]\n", arg0);
|
||||
if(fp == stderr){
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
struct notcurses_options opts = {
|
||||
.flags = NCOPTION_SUPPRESS_BANNERS
|
||||
| NCOPTION_NO_ALTERNATE_SCREEN
|
||||
| NCOPTION_NO_CLEAR_BITMAPS
|
||||
| NCOPTION_PRESERVE_CURSOR,
|
||||
};
|
||||
if(argc > 2){
|
||||
usage(argv[0], stderr);
|
||||
}else if(argc == 2){
|
||||
if(strcmp(argv[1], "-v") == 0){
|
||||
opts.loglevel = NCLOGLEVEL_VERBOSE;
|
||||
}else{
|
||||
usage(argv[0], stderr);
|
||||
}
|
||||
}
|
||||
struct notcurses* nc = notcurses_init(&opts, NULL);
|
||||
if(nc == NULL){
|
||||
return EXIT_FAILURE;
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <strings.h>
|
||||
// Output of "neofetch-ripper /usr/bin/neofetch"
|
||||
// Generated on Thu Jul 15 02:57:03 AM UTC 2021
|
||||
// Generated on Mon 30 Aug 2021 04:06:25 AM UTC
|
||||
// Copyright Dylan Araps under an MIT License
|
||||
// The MIT License (MIT)
|
||||
//
|
||||
|
@ -761,6 +761,7 @@ int ncplane_resize_internal(ncplane* n, int keepy, int keepx, int keepleny,
|
||||
}
|
||||
if(n->tam){
|
||||
loginfo("TAM realloc to %d entries\n", newarea);
|
||||
// FIXME first, free any disposed auxiliary vectors!
|
||||
tament* tmptam = realloc(n->tam, sizeof(*tmptam) * newarea);
|
||||
if(tmptam == NULL){
|
||||
free(fb);
|
||||
|
@ -52,14 +52,16 @@ setup_sixel_bitmaps(tinfo* ti, int fd, bool invert80){
|
||||
}else{
|
||||
ti->pixel_init = sixel_init;
|
||||
}
|
||||
ti->pixel_scrub = sixel_scrub;
|
||||
ti->pixel_remove = NULL;
|
||||
ti->pixel_draw = sixel_draw;
|
||||
ti->pixel_draw_late = NULL;
|
||||
ti->pixel_scrub = sixel_scrub;
|
||||
ti->pixel_wipe = sixel_wipe;
|
||||
ti->pixel_remove = NULL;
|
||||
ti->pixel_commit = NULL;
|
||||
ti->pixel_move = NULL;
|
||||
ti->pixel_shutdown = sixel_shutdown;
|
||||
ti->pixel_scroll = NULL;
|
||||
ti->pixel_wipe = sixel_wipe;
|
||||
ti->pixel_shutdown = sixel_shutdown;
|
||||
ti->pixel_clear_all = NULL;
|
||||
ti->pixel_rebuild = sixel_rebuild;
|
||||
ti->pixel_trans_auxvec = sixel_trans_auxvec;
|
||||
ti->sprixel_scale_height = 6;
|
||||
@ -106,12 +108,17 @@ setup_kitty_bitmaps(tinfo* ti, int fd, kitty_graphics_e level){
|
||||
#ifdef __linux__
|
||||
static inline void
|
||||
setup_fbcon_bitmaps(tinfo* ti, int fd){
|
||||
ti->pixel_rebuild = fbcon_rebuild;
|
||||
ti->pixel_wipe = fbcon_wipe;
|
||||
ti->pixel_scrub = fbcon_scrub;
|
||||
ti->pixel_remove = NULL;
|
||||
ti->pixel_draw = NULL;
|
||||
ti->pixel_draw_late = fbcon_draw;
|
||||
ti->pixel_commit = NULL;
|
||||
ti->pixel_move = NULL;
|
||||
ti->pixel_scroll = fbcon_scroll;
|
||||
ti->pixel_scrub = fbcon_scrub;
|
||||
ti->pixel_shutdown = NULL;
|
||||
ti->pixel_clear_all = NULL;
|
||||
ti->pixel_rebuild = fbcon_rebuild;
|
||||
ti->pixel_wipe = fbcon_wipe;
|
||||
ti->pixel_trans_auxvec = kitty_trans_auxvec;
|
||||
set_pixel_blitter(fbcon_blit);
|
||||
sprite_init(ti, fd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user