Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| af1377bc7c | |||
|
|
bea164468b | ||
|
|
2dc69c670b | ||
|
|
5878d588d8 | ||
|
|
860cd8cd81 |
15 changed files with 303 additions and 207 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -14,8 +14,6 @@ change_dir.o
|
|||
update_check.o
|
||||
man.o
|
||||
calc.o
|
||||
<<<<<<< HEAD
|
||||
math_ext.o
|
||||
=======
|
||||
>>>>>>> f1cf6269f94065bfb8498dd7ef06bfbb61442b80
|
||||
your-reality.o
|
||||
clear_screen.o
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
18
.idea/misc.xml
generated
Normal file
18
.idea/misc.xml
generated
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MakefileSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<MakefileProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="version" value="2" />
|
||||
</MakefileProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="MakefileWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -8,7 +8,7 @@ Tested on: *Ubuntu, Debian, Arch*
|
|||
|
||||
Used libs for Linux: *gtk+3.0, libmysqlclient*
|
||||
|
||||
Version: *0.2.6*
|
||||
Version: *0.3.1*
|
||||
|
||||
## Features:
|
||||
|
||||
|
|
|
|||
31
etc/man.c
31
etc/man.c
|
|
@ -22,6 +22,7 @@
|
|||
//Main function to start man is at the bottom
|
||||
|
||||
//MAN ENTRIES
|
||||
|
||||
//LS
|
||||
void manEntry_ls(){
|
||||
printf("\033[0;33m##################\033[0m\n");
|
||||
|
|
@ -35,14 +36,42 @@ void manEntry_ls(){
|
|||
printf("\t\033[0;36mList files and directorys in the given directory. Sorts entries alphabetically.\033[0m\n\n");
|
||||
}
|
||||
|
||||
//CD
|
||||
void manEntry_cd(){
|
||||
printf("\033[0;33m##################\033[0m\n");
|
||||
printf("\033[0;33m# Manual of \033[0;36m'cd' \033[0;33m#\033[0m\n");
|
||||
printf("\033[0;33m##################\033[0m\n");
|
||||
printf("\033[0;33mNAME\033[0m\n");
|
||||
printf("\t\033[0;36mcd - change directory\033[0m\n\n");
|
||||
printf("\033[0;33mUSAGE\033[0m\n");
|
||||
printf("\t\033[0;36mcd \033[0;35m[DIRECTORY]\033[0m\n\n");
|
||||
printf("\033[0;33mDESCRIPTION\033[0m\n");
|
||||
printf("\t\033[0;36mChanged the currently selected directory.\033[0m\n\n");
|
||||
}
|
||||
|
||||
//MAN
|
||||
void manEntry_man(){
|
||||
printf("\033[0;33m###################\033[0m\n");
|
||||
printf("\033[0;33m# Manual of \033[0;36m'man' \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;36mman - manual\033[0m\n\n");
|
||||
printf("\033[0;33mUSAGE\033[0m\n");
|
||||
printf("\t\033[0;36mman \033[0;35m[COMMAND]\033[0m\n\n");
|
||||
printf("\033[0;33mDESCRIPTION\033[0m\n");
|
||||
printf("\t\033[0;36mShows the manual of given command.\033[0m\n\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//MAIN FUNCTION
|
||||
void showManEntry(char *arg[]){
|
||||
if(!strcmp(arg[1], "man")){
|
||||
printf("Coming soon.\n");
|
||||
manEntry_man();
|
||||
} else if(!strcmp(arg[1], "ls")){
|
||||
manEntry_ls();
|
||||
} else if(!strcmp(arg[1], "cd")){
|
||||
manEntry_cd();
|
||||
} else {
|
||||
printf("Entry not found.\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#define _MAN_H_
|
||||
|
||||
void manEntry_ls();
|
||||
void manEntry_cd();
|
||||
void manEntry_man();
|
||||
void showManEntry(char *arg[]);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.36.0 -->
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="width_request">300</property>
|
||||
<property name="height_request">230</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="height-request">230</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="default_width">300</property>
|
||||
<property name="default_height">230</property>
|
||||
<property name="window-position">center</property>
|
||||
<property name="default-width">300</property>
|
||||
<property name="default-height">230</property>
|
||||
<property name="icon">../logo.png</property>
|
||||
<property name="gravity">center</property>
|
||||
<signal name="focus-in-event" handler="on_window_focus_in_event" swapped="no"/>
|
||||
|
|
@ -17,16 +17,16 @@
|
|||
<child>
|
||||
<object class="GtkFixed" id="fixed1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label" translatable="yes">Ok</property>
|
||||
<property name="width_request">100</property>
|
||||
<property name="height_request">31</property>
|
||||
<property name="width-request">100</property>
|
||||
<property name="height-request">31</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Pink Fluffy Unicorns</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="tooltip-text" translatable="yes">Pink Fluffy Unicorns</property>
|
||||
<signal name="clicked" handler="on_button1_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
@ -36,14 +36,14 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="width_request">369</property>
|
||||
<property name="height_request">20</property>
|
||||
<property name="width-request">369</property>
|
||||
<property name="height-request">20</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="max_width_chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<attributes>
|
||||
<attribute name="font-desc" value="System-ui Bold 10"/>
|
||||
<attribute name="stretch" value="normal"/>
|
||||
|
|
@ -56,12 +56,12 @@
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="check">
|
||||
<property name="label" translatable="yes">Toggle</property>
|
||||
<property name="width_request">107</property>
|
||||
<property name="height_request">24</property>
|
||||
<property name="width-request">107</property>
|
||||
<property name="height-request">24</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
<signal name="toggled" handler="on_gay_check_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
@ -71,10 +71,10 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="useless_spinner">
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">40</property>
|
||||
<property name="width-request">40</property>
|
||||
<property name="height-request">40</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="active">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
@ -84,11 +84,11 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLevelBar" id="level">
|
||||
<property name="width_request">100</property>
|
||||
<property name="height_request">20</property>
|
||||
<property name="width-request">100</property>
|
||||
<property name="height-request">20</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="max_value">100</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="max-value">100</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x">8</property>
|
||||
|
|
@ -97,8 +97,5 @@
|
|||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
|||
12
main.c
12
main.c
|
|
@ -21,9 +21,10 @@
|
|||
#include "utils/sys_info.h"
|
||||
#include "utils/update_check.h"
|
||||
#include "utils/calc.h"
|
||||
#include "utils/clear_screen.h"
|
||||
|
||||
|
||||
#define VERSION "0.2.6"
|
||||
#define VERSION "0.3.1"
|
||||
|
||||
bool VER_CHECK_ON_START = true;
|
||||
bool DEV_MODE = false;
|
||||
|
|
@ -118,6 +119,7 @@ int main(int argc, char *argv[]){
|
|||
snprintf(buffer, sizeof(buffer), "Starting netbenixCMD (Version: %s)", VERSION);
|
||||
logger(buffer);
|
||||
log_Specs(); //Log system specs
|
||||
clearScreen(); //Clear the screen
|
||||
showLogo(); //Show the logo
|
||||
logger("Logo Displayed.");
|
||||
if(argc > 2){
|
||||
|
|
@ -129,19 +131,19 @@ int main(int argc, char *argv[]){
|
|||
//Check the startup args
|
||||
if(argc == 2){
|
||||
if(!strcmp(argv[1], "--help")){
|
||||
logger("Showing Help.");
|
||||
logger("Showing help.");
|
||||
outputHelp();
|
||||
exit(0);
|
||||
} else if (!strcmp(argv[1], "--gtk-test")){
|
||||
logger("Stating GTK Test.");
|
||||
logger("Stating GTK test.");
|
||||
createGTKTestWindow();
|
||||
exit(0);
|
||||
} else if (!strcmp(argv[1], "--sys-info")){
|
||||
logger("Showing System Information.");
|
||||
logger("Showing system information.");
|
||||
print_Specs();
|
||||
exit(0);
|
||||
} else if (!strcmp(argv[1], "--sql-test")){
|
||||
logger("Starting SQL Test.");
|
||||
logger("Starting SQL test.");
|
||||
testSQLConnection();
|
||||
exit(0);
|
||||
} else if (!strcmp(argv[1], "--no-version-check")){
|
||||
|
|
|
|||
4
makefile
4
makefile
|
|
@ -2,7 +2,7 @@ CC= gcc
|
|||
ARGS= -export-dynamic -ansi -std=gnu99
|
||||
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
|
||||
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 clear_screen.o
|
||||
netbenixCMD: $(OBJ)
|
||||
$(CC) $(CFLAGS) $(ARGS) -o netbenixCMD $(OBJ) $(LDLIBS)
|
||||
main.o: main.c
|
||||
|
|
@ -33,3 +33,5 @@ your-reality.o: etc/your-reality.c
|
|||
$(CC) $(CFLAGS) -c etc/your-reality.c
|
||||
calc.o: utils/calc.c
|
||||
$(CC) $(CFLAGS) -c utils/calc.c
|
||||
clear_screen.o: utils/clear_screen.c
|
||||
$(CC) $(CFLAGS) -c utils/clear_screen.c
|
||||
BIN
math.o
BIN
math.o
Binary file not shown.
28
utils/clear_screen.c
Normal file
28
utils/clear_screen.c
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <stdio.h>
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#elif defined(__linux__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "clear_screen.h"
|
||||
|
||||
|
||||
void clearScreen(){
|
||||
#if defined(_WIN32)
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
int rows;
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
||||
rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
||||
for(int i = 0; i < rows; i++){
|
||||
printf("\n");
|
||||
}
|
||||
#elif defined(__linux__)
|
||||
struct winsize w;
|
||||
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
|
||||
for(int i = 0; i < w.ws_row; i++){
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
6
utils/clear_screen.h
Normal file
6
utils/clear_screen.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _CLEAR_SCREEN_H_
|
||||
#define _CLEAR_SCREEN_H_
|
||||
|
||||
void clearScreen();
|
||||
|
||||
#endif
|
||||
Reference in a new issue