Compare commits

...
This repository has been archived on 2026-03-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.

7 commits
dev ... master

Author SHA1 Message Date
netbenix
8b5909e2b1 Inital commit 2021-06-21 11:50:50 +02:00
netbenix
5d2c46afd0 Update makefile 2021-05-08 20:11:20 +02:00
netbenix
7c4e266424 Updated .gitignore 2021-05-08 20:08:47 +02:00
netbenix
ccbeb0578a Updated .gitignore 2021-05-08 20:07:59 +02:00
netbenix
88f11da06f Update 0.2.6 2021-05-08 20:06:22 +02:00
netbenix
8b6f6b88e0 Merge branch 'master' of https://github.com/netbenix/netbenixCMD
# Conflicts:
#	.gitignore
#	etc/man.c
#	etc/your-reality.c
#	etc/your-reality.h
#	main.c
#	makefile
2020-11-19 12:33:57 +01:00
netbenix
7e5b44c61c Merge branch 'dev' 2020-11-19 12:32:41 +01:00
8 changed files with 331 additions and 237 deletions

3
.gitignore vendored
View file

@ -14,8 +14,5 @@ change_dir.o
update_check.o update_check.o
man.o man.o
calc.o calc.o
<<<<<<< HEAD
math_ext.o math_ext.o
=======
>>>>>>> f1cf6269f94065bfb8498dd7ef06bfbb61442b80
your-reality.o your-reality.o

BIN
clear_screen.o Normal file

Binary file not shown.

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -46,4 +47,52 @@ void showManEntry(char *arg[]){
} else { } else {
printf("Entry not found.\n"); printf("Entry not found.\n");
} }
=======
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Color Codes:
// Reset: \033[0m
// Red: \033[0;31m
// Green: \033[0;32m
// Yellow: \033[0;33m
// Blue: \033[0;34m
// Magenta: \033[0;35m
// Cyan: \033[0;36m
// BoldRed: \033[1;31m
// BoldGreen: \033[1;32m
// BoldYellow: \033[1;33m
// BoldBlue: \033[1;34m
// BoldMagenta: \033[1;35m
// BoldCyan: \033[1;36m
//Main function to start man is at the bottom
//MAN ENTRIES
//LS
void manEntry_ls(){
printf("\033[0;33m##################\033[0m\n");
printf("\033[0;33m# Manual of \033[0;36m'ls' \033[0;33m#\033[0m\n");
printf("\033[0;33m##################\033[0m\n\n");
printf("\033[0;33mNAME\033[0m\n");
printf("\t\033[0;36mls - list directory contents\033[0m\n\n");
printf("\033[0;33mUSAGE\033[0m\n");
printf("\t\033[0;36mls \033[0;35m[DIRECTORY]\033[0m\n\n");
printf("\033[0;33mDESCRIPTION\033[0m\n");
printf("\t\033[0;36mList files and directorys in the given directory. Sorts entries alphabetically.\033[0m\n\n");
}
//MAIN FUNCTION
void showManEntry(char *arg[]){
if(!strcmp(arg[1], "man")){
printf("Coming soon.\n");
} else if(!strcmp(arg[1], "ls")){
manEntry_ls();
} else {
printf("Entry not found.\n");
}
>>>>>>> f1cf6269f94065bfb8498dd7ef06bfbb61442b80
} }

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
@ -36,3 +37,43 @@ void yourReality(){
p("\033[0m"); p("\033[0m");
printf("\e[?25h"); printf("\e[?25h");
} }
=======
#include <stdio.h>
#include <unistd.h>
#include "your-reality.h"
//Lyrics from "Your Reality" by Dan Salvato
//fs -> flush & sleep
void fs(int milliseconds){
fflush(stdout);
usleep(milliseconds*1000);
}
//p -> printf
void p(char* txt){
printf(txt);
}
void yourReality(){
printf("\e[?25l");
p("Loading ");
for(int i = 0; i < 2; i++){
//\033[XC => X columns right
//\033[XD => X columns left
printf("\033[3D "); printf("\033[3D");
fs(500); printf("."); fs(500); printf("."); fs(500); printf("."); fs(500);
}
printf("\n");
printf("\033[0;33mEvery "); fs(350); printf("day, ");
fs(700);
p("I "); fs(450); p("imagine "); fs(350); p("a "); fs(350); p("future "); fs(350); p("where "); fs(750);
p("i "); fs(300); p("can "); fs(300); p("be "); fs(300); p("with "); fs(300); p("you.");
p("\033[0m");
printf("\e[?25h");
}
>>>>>>> f1cf6269f94065bfb8498dd7ef06bfbb61442b80

View file

@ -1,6 +1,14 @@
<<<<<<< HEAD
#ifndef _YOUR_REALITY_H #ifndef _YOUR_REALITY_H
#define _YOUR_REALITY_H #define _YOUR_REALITY_H
void yourReality(); void yourReality();
=======
#ifndef _YOUR_REALITY_H
#define _YOUR_REALITY_H
void yourReality();
>>>>>>> f1cf6269f94065bfb8498dd7ef06bfbb61442b80
#endif #endif

10
main.c
View file

@ -15,15 +15,14 @@
#include "utils/sql_test.h" #include "utils/sql_test.h"
#include "etc/logo.h" #include "etc/logo.h"
#include "etc/man.h" #include "etc/man.h"
#include "etc/math_ext.h" #include "etc/math.h"
#include "etc/your-reality.h" #include "etc/your-reality.h"
#include "utils/logger.h" #include "utils/logger.h"
#include "utils/sys_info.h" #include "utils/sys_info.h"
#include "utils/update_check.h" #include "utils/update_check.h"
#include "utils/calc.h"
#define VERSION "0.2.6" #define VERSION "0.2.5"
bool VER_CHECK_ON_START = true; bool VER_CHECK_ON_START = true;
bool DEV_MODE = false; bool DEV_MODE = false;
@ -47,6 +46,7 @@ bool FUN_CONTENT = false;
//Handles the commands //Handles the commands
int commandHandler(char *cmd){ int commandHandler(char *cmd){
char *token = strtok(cmd, " "); char *token = strtok(cmd, " ");
int argc = 1; int argc = 1;
char *arg[10]; char *arg[10];
@ -73,6 +73,7 @@ int commandHandler(char *cmd){
printf("\033[1;34mexit\033[0m : exit the program\n"); printf("\033[1;34mexit\033[0m : exit the program\n");
return 0; return 0;
} else if(!strcmp(arg[0], "version")){ } else if(!strcmp(arg[0], "version")){
printf("netbenixCMD (Version: \033[1;34m%s\033[0m)\n", VERSION); printf("netbenixCMD (Version: \033[1;34m%s\033[0m)\n", VERSION);
printf("Author: \033[1;34m%s\033[0m\n", "netbenix"); printf("Author: \033[1;34m%s\033[0m\n", "netbenix");
printf("Github: \033[1;34mhttps://github.com/netbenix/netbenixCMD\033[0m\n"); printf("Github: \033[1;34mhttps://github.com/netbenix/netbenixCMD\033[0m\n");
@ -89,9 +90,6 @@ int commandHandler(char *cmd){
} else if(!strcmp(arg[0], "man")){ } else if(!strcmp(arg[0], "man")){
showManEntry(arg); showManEntry(arg);
return 0; return 0;
} else if(!strcmp(arg[0], "calc")){
startCalc();
return 0;
} else if(!strcmp(arg[0], "rainbow") && FUN_CONTENT){ } else if(!strcmp(arg[0], "rainbow") && FUN_CONTENT){
while(1){ while(1){
printf("\033[0;31m#####"); printf("\033[0;31m#####");

View file

@ -1,8 +1,9 @@
CC= gcc CC= gcc
ARGS= -export-dynamic -ansi -std=gnu99 ARGS= -export-dynamic -ansi -std=gnu99
CFLAGS= $(shell pkg-config --cflags gtk+-3.0) -I/usr/include/mysql CFLAGS= $(shell pkg-config --cflags gtk+-3.0) -I/usr/include/mysql
LDLIBS= $(shell pkg-config --libs gtk+-3.0) -L/usr/lib/mysql -lmysqlclient -lm LDLIBS= $(shell pkg-config --libs gtk+-3.0) -L/usr/lib/mysql -lmysqlclient
OBJ= main.o logo.o logger.o help.o sys_info.o gtk_test.o sql_test.o show_dir.o change_dir.o update_check.o man.o your-reality.o math_ext.o calc.o OBJ= main.o logo.o logger.o help.o sys_info.o gtk_test.o sql_test.o show_dir.o change_dir.o update_check.o man.o your-reality.o math_ext.o calc.o
netbenixCMD: $(OBJ) netbenixCMD: $(OBJ)
$(CC) $(CFLAGS) $(ARGS) -o netbenixCMD $(OBJ) $(LDLIBS) $(CC) $(CFLAGS) $(ARGS) -o netbenixCMD $(OBJ) $(LDLIBS)
main.o: main.c main.o: main.c
@ -27,7 +28,7 @@ update_check.o: utils/update_check.c
$(CC) $(CFLAGS) -c utils/update_check.c $(CC) $(CFLAGS) -c utils/update_check.c
man.o: etc/man.c man.o: etc/man.c
$(CC) $(CFLAGS) -c etc/man.c $(CC) $(CFLAGS) -c etc/man.c
math_ext.o: etc/math_ext.c math.o: etc/math_ext.c
$(CC) $(CFLAGS) -c etc/math_ext.c $(CC) $(CFLAGS) -c etc/math_ext.c
your-reality.o: etc/your-reality.c your-reality.o: etc/your-reality.c
$(CC) $(CFLAGS) -c etc/your-reality.c $(CC) $(CFLAGS) -c etc/your-reality.c

BIN
math.o

Binary file not shown.