Commited uncommited files
This commit is contained in:
parent
bea164468b
commit
af1377bc7c
9 changed files with 285 additions and 253 deletions
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>
|
||||||
154
etc/man.c
154
etc/man.c
|
|
@ -1,78 +1,78 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "man.h"
|
#include "man.h"
|
||||||
|
|
||||||
// Color Codes:
|
// Color Codes:
|
||||||
// Reset: \033[0m
|
// Reset: \033[0m
|
||||||
// Red: \033[0;31m
|
// Red: \033[0;31m
|
||||||
// Green: \033[0;32m
|
// Green: \033[0;32m
|
||||||
// Yellow: \033[0;33m
|
// Yellow: \033[0;33m
|
||||||
// Blue: \033[0;34m
|
// Blue: \033[0;34m
|
||||||
// Magenta: \033[0;35m
|
// Magenta: \033[0;35m
|
||||||
// Cyan: \033[0;36m
|
// Cyan: \033[0;36m
|
||||||
// BoldRed: \033[1;31m
|
// BoldRed: \033[1;31m
|
||||||
// BoldGreen: \033[1;32m
|
// BoldGreen: \033[1;32m
|
||||||
// BoldYellow: \033[1;33m
|
// BoldYellow: \033[1;33m
|
||||||
// BoldBlue: \033[1;34m
|
// BoldBlue: \033[1;34m
|
||||||
// BoldMagenta: \033[1;35m
|
// BoldMagenta: \033[1;35m
|
||||||
// BoldCyan: \033[1;36m
|
// BoldCyan: \033[1;36m
|
||||||
|
|
||||||
//Main function to start man is at the bottom
|
//Main function to start man is at the bottom
|
||||||
|
|
||||||
//MAN ENTRIES
|
//MAN ENTRIES
|
||||||
|
|
||||||
//LS
|
//LS
|
||||||
void manEntry_ls(){
|
void manEntry_ls(){
|
||||||
printf("\033[0;33m##################\033[0m\n");
|
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# Manual of \033[0;36m'ls' \033[0;33m#\033[0m\n");
|
||||||
printf("\033[0;33m##################\033[0m\n\n");
|
printf("\033[0;33m##################\033[0m\n\n");
|
||||||
printf("\033[0;33mNAME\033[0m\n");
|
printf("\033[0;33mNAME\033[0m\n");
|
||||||
printf("\t\033[0;36mls - list directory contents\033[0m\n\n");
|
printf("\t\033[0;36mls - list directory contents\033[0m\n\n");
|
||||||
printf("\033[0;33mUSAGE\033[0m\n");
|
printf("\033[0;33mUSAGE\033[0m\n");
|
||||||
printf("\t\033[0;36mls \033[0;35m[DIRECTORY]\033[0m\n\n");
|
printf("\t\033[0;36mls \033[0;35m[DIRECTORY]\033[0m\n\n");
|
||||||
printf("\033[0;33mDESCRIPTION\033[0m\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");
|
printf("\t\033[0;36mList files and directorys in the given directory. Sorts entries alphabetically.\033[0m\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//CD
|
//CD
|
||||||
void manEntry_cd(){
|
void manEntry_cd(){
|
||||||
printf("\033[0;33m##################\033[0m\n");
|
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# Manual of \033[0;36m'cd' \033[0;33m#\033[0m\n");
|
||||||
printf("\033[0;33m##################\033[0m\n");
|
printf("\033[0;33m##################\033[0m\n");
|
||||||
printf("\033[0;33mNAME\033[0m\n");
|
printf("\033[0;33mNAME\033[0m\n");
|
||||||
printf("\t\033[0;36mcd - change directory\033[0m\n\n");
|
printf("\t\033[0;36mcd - change directory\033[0m\n\n");
|
||||||
printf("\033[0;33mUSAGE\033[0m\n");
|
printf("\033[0;33mUSAGE\033[0m\n");
|
||||||
printf("\t\033[0;36mcd \033[0;35m[DIRECTORY]\033[0m\n\n");
|
printf("\t\033[0;36mcd \033[0;35m[DIRECTORY]\033[0m\n\n");
|
||||||
printf("\033[0;33mDESCRIPTION\033[0m\n");
|
printf("\033[0;33mDESCRIPTION\033[0m\n");
|
||||||
printf("\t\033[0;36mChanged the currently selected directory.\033[0m\n\n");
|
printf("\t\033[0;36mChanged the currently selected directory.\033[0m\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//MAN
|
//MAN
|
||||||
void manEntry_man(){
|
void manEntry_man(){
|
||||||
printf("\033[0;33m###################\033[0m\n");
|
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# Manual of \033[0;36m'man' \033[0;33m#\033[0m\n");
|
||||||
printf("\033[0;33m###################\033[0m\n\n");
|
printf("\033[0;33m###################\033[0m\n\n");
|
||||||
printf("\033[0;33mNAME\033[0m\n");
|
printf("\033[0;33mNAME\033[0m\n");
|
||||||
printf("\t\033[0;36mman - manual\033[0m\n\n");
|
printf("\t\033[0;36mman - manual\033[0m\n\n");
|
||||||
printf("\033[0;33mUSAGE\033[0m\n");
|
printf("\033[0;33mUSAGE\033[0m\n");
|
||||||
printf("\t\033[0;36mman \033[0;35m[COMMAND]\033[0m\n\n");
|
printf("\t\033[0;36mman \033[0;35m[COMMAND]\033[0m\n\n");
|
||||||
printf("\033[0;33mDESCRIPTION\033[0m\n");
|
printf("\033[0;33mDESCRIPTION\033[0m\n");
|
||||||
printf("\t\033[0;36mShows the manual of given command.\033[0m\n\n");
|
printf("\t\033[0;36mShows the manual of given command.\033[0m\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//MAIN FUNCTION
|
//MAIN FUNCTION
|
||||||
void showManEntry(char *arg[]){
|
void showManEntry(char *arg[]){
|
||||||
if(!strcmp(arg[1], "man")){
|
if(!strcmp(arg[1], "man")){
|
||||||
manEntry_man();
|
manEntry_man();
|
||||||
} else if(!strcmp(arg[1], "ls")){
|
} else if(!strcmp(arg[1], "ls")){
|
||||||
manEntry_ls();
|
manEntry_ls();
|
||||||
} else if(!strcmp(arg[1], "cd")){
|
} else if(!strcmp(arg[1], "cd")){
|
||||||
manEntry_cd();
|
manEntry_cd();
|
||||||
} else {
|
} else {
|
||||||
printf("Entry not found.\n");
|
printf("Entry not found.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,38 +1,38 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "your-reality.h"
|
#include "your-reality.h"
|
||||||
|
|
||||||
//Lyrics from "Your Reality" by Dan Salvato
|
//Lyrics from "Your Reality" by Dan Salvato
|
||||||
|
|
||||||
//fs -> flush & sleep
|
//fs -> flush & sleep
|
||||||
void fs(int milliseconds){
|
void fs(int milliseconds){
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
usleep(milliseconds*1000);
|
usleep(milliseconds*1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
//p -> printf
|
//p -> printf
|
||||||
void p(char* txt){
|
void p(char* txt){
|
||||||
printf(txt);
|
printf(txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void yourReality(){
|
void yourReality(){
|
||||||
|
|
||||||
printf("\e[?25l");
|
printf("\e[?25l");
|
||||||
p("Loading ");
|
p("Loading ");
|
||||||
for(int i = 0; i < 2; i++){
|
for(int i = 0; i < 2; i++){
|
||||||
//\033[XC => X columns right
|
//\033[XC => X columns right
|
||||||
//\033[XD => X columns left
|
//\033[XD => X columns left
|
||||||
printf("\033[3D "); printf("\033[3D");
|
printf("\033[3D "); printf("\033[3D");
|
||||||
fs(500); printf("."); fs(500); printf("."); fs(500); printf("."); fs(500);
|
fs(500); printf("."); fs(500); printf("."); fs(500); printf("."); fs(500);
|
||||||
|
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("\033[0;33mEvery "); fs(350); printf("day, ");
|
printf("\033[0;33mEvery "); fs(350); printf("day, ");
|
||||||
fs(700);
|
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(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("i "); fs(300); p("can "); fs(300); p("be "); fs(300); p("with "); fs(300); p("you.");
|
||||||
|
|
||||||
p("\033[0m");
|
p("\033[0m");
|
||||||
printf("\e[?25h");
|
printf("\e[?25h");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _YOUR_REALITY_H
|
#ifndef _YOUR_REALITY_H
|
||||||
#define _YOUR_REALITY_H
|
#define _YOUR_REALITY_H
|
||||||
|
|
||||||
void yourReality();
|
void yourReality();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,101 +1,101 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.38.2 -->
|
<!-- Generated with glade 3.38.2 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.22"/>
|
<requires lib="gtk+" version="3.22"/>
|
||||||
<object class="GtkWindow" id="window">
|
<object class="GtkWindow" id="window">
|
||||||
<property name="width-request">300</property>
|
<property name="width-request">300</property>
|
||||||
<property name="height-request">230</property>
|
<property name="height-request">230</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="resizable">False</property>
|
<property name="resizable">False</property>
|
||||||
<property name="window-position">center</property>
|
<property name="window-position">center</property>
|
||||||
<property name="default-width">300</property>
|
<property name="default-width">300</property>
|
||||||
<property name="default-height">230</property>
|
<property name="default-height">230</property>
|
||||||
<property name="icon">../logo.png</property>
|
<property name="icon">../logo.png</property>
|
||||||
<property name="gravity">center</property>
|
<property name="gravity">center</property>
|
||||||
<signal name="focus-in-event" handler="on_window_focus_in_event" swapped="no"/>
|
<signal name="focus-in-event" handler="on_window_focus_in_event" swapped="no"/>
|
||||||
<signal name="focus-out-event" handler="on_window_focus_out_event" swapped="no"/>
|
<signal name="focus-out-event" handler="on_window_focus_out_event" swapped="no"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFixed" id="fixed1">
|
<object class="GtkFixed" id="fixed1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="button1">
|
<object class="GtkButton" id="button1">
|
||||||
<property name="label" translatable="yes">Ok</property>
|
<property name="label" translatable="yes">Ok</property>
|
||||||
<property name="width-request">100</property>
|
<property name="width-request">100</property>
|
||||||
<property name="height-request">31</property>
|
<property name="height-request">31</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">True</property>
|
<property name="receives-default">True</property>
|
||||||
<property name="tooltip-text" translatable="yes">Pink Fluffy Unicorns</property>
|
<property name="tooltip-text" translatable="yes">Pink Fluffy Unicorns</property>
|
||||||
<signal name="clicked" handler="on_button1_clicked" swapped="no"/>
|
<signal name="clicked" handler="on_button1_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="x">135</property>
|
<property name="x">135</property>
|
||||||
<property name="y">183</property>
|
<property name="y">183</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="label">
|
<object class="GtkLabel" id="label">
|
||||||
<property name="width-request">369</property>
|
<property name="width-request">369</property>
|
||||||
<property name="height-request">20</property>
|
<property name="height-request">20</property>
|
||||||
<property name="visible">True</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="halign">center</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="justify">center</property>
|
<property name="justify">center</property>
|
||||||
<property name="max-width-chars">50</property>
|
<property name="max-width-chars">50</property>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="font-desc" value="System-ui Bold 10"/>
|
<attribute name="font-desc" value="System-ui Bold 10"/>
|
||||||
<attribute name="stretch" value="normal"/>
|
<attribute name="stretch" value="normal"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="y">57</property>
|
<property name="y">57</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCheckButton" id="check">
|
<object class="GtkCheckButton" id="check">
|
||||||
<property name="label" translatable="yes">Toggle</property>
|
<property name="label" translatable="yes">Toggle</property>
|
||||||
<property name="width-request">107</property>
|
<property name="width-request">107</property>
|
||||||
<property name="height-request">24</property>
|
<property name="height-request">24</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="receives-default">False</property>
|
<property name="receives-default">False</property>
|
||||||
<property name="draw-indicator">True</property>
|
<property name="draw-indicator">True</property>
|
||||||
<signal name="toggled" handler="on_gay_check_toggled" swapped="no"/>
|
<signal name="toggled" handler="on_gay_check_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="x">140</property>
|
<property name="x">140</property>
|
||||||
<property name="y">153</property>
|
<property name="y">153</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSpinner" id="useless_spinner">
|
<object class="GtkSpinner" id="useless_spinner">
|
||||||
<property name="width-request">40</property>
|
<property name="width-request">40</property>
|
||||||
<property name="height-request">40</property>
|
<property name="height-request">40</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="active">True</property>
|
<property name="active">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="x">324</property>
|
<property name="x">324</property>
|
||||||
<property name="y">179</property>
|
<property name="y">179</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLevelBar" id="level">
|
<object class="GtkLevelBar" id="level">
|
||||||
<property name="width-request">100</property>
|
<property name="width-request">100</property>
|
||||||
<property name="height-request">20</property>
|
<property name="height-request">20</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="max-value">100</property>
|
<property name="max-value">100</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="x">8</property>
|
<property name="x">8</property>
|
||||||
<property name="y">201</property>
|
<property name="y">201</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,28 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "clear_screen.h"
|
#include "clear_screen.h"
|
||||||
|
|
||||||
|
|
||||||
void clearScreen(){
|
void clearScreen(){
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||||
int rows;
|
int rows;
|
||||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
||||||
rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
||||||
for(int i = 0; i < rows; i++){
|
for(int i = 0; i < rows; i++){
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
struct winsize w;
|
struct winsize w;
|
||||||
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
|
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
|
||||||
for(int i = 0; i < w.ws_row; i++){
|
for(int i = 0; i < w.ws_row; i++){
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _CLEAR_SCREEN_H_
|
#ifndef _CLEAR_SCREEN_H_
|
||||||
#define _CLEAR_SCREEN_H_
|
#define _CLEAR_SCREEN_H_
|
||||||
|
|
||||||
void clearScreen();
|
void clearScreen();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in a new issue