Add initial files
This commit is contained in:
parent
203069260d
commit
12f4e63ea9
10 changed files with 215 additions and 0 deletions
12
cpp/CMakeLists.txt
Normal file
12
cpp/CMakeLists.txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
project(sht)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
add_executable(vsleep vsleep.cpp)
|
||||
install(TARGETS vsleep
|
||||
RUNTIME DESTINATION /usr/bin
|
||||
)
|
||||
|
||||
add_executable(pause pause.cpp)
|
||||
install(TARGETS sleep RUNTIME DESTINATION /usr/bin)
|
1
cpp/README.md
Normal file
1
cpp/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
This folder contains older versions of the helper tools that were previously written in C++.
|
32
cpp/pause.cpp
Normal file
32
cpp/pause.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
*
|
||||
* Pause CPP
|
||||
* COPYRIGHT 2023 Tara Piccari
|
||||
*
|
||||
*
|
||||
* This file is a part of Pause (https://github.com/zontreck/PauseCpp)
|
||||
* It is Licensed under the GPL v3.
|
||||
*
|
||||
* Please submit any changes or improvements to the Github in the form of a ticket or a pull request.
|
||||
*
|
||||
* Thank you.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
#include <chrono>
|
||||
#include <stdio.h>
|
||||
#include <thread>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
|
||||
cout << "Press enter to continue\r";
|
||||
cin.ignore();
|
||||
cout << endl;
|
||||
return 0;
|
||||
}
|
54
cpp/vsleep.cpp
Normal file
54
cpp/vsleep.cpp
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
*
|
||||
* VERBOSE SLEEP
|
||||
* COPYRIGHT 2023 Tara Piccari
|
||||
*
|
||||
*
|
||||
* This file is a part of Verbose Sleep (https://github.com/zontreck/VerboseSleep)
|
||||
* It is Licensed under the GPL v3.
|
||||
*
|
||||
* Please submit any changes or improvements to the Github in the form of a ticket or a pull request.
|
||||
*
|
||||
* Thank you.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
using namespace std;
|
||||
using namespace chrono_literals;
|
||||
using namespace chrono;
|
||||
using namespace this_thread;
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
if(argc<2){
|
||||
cout << "Verbose Sleep\nhttps://github.com/zontreck/VerboseSleep\nCopyright 2023 Tara Piccari\n\n" << argv[0] <<
|
||||
" [seconds]\n\n"
|
||||
|
||||
<< "[seconds]\t\t-\tThe number of seconds to sleep and countdown"
|
||||
<< endl
|
||||
<< endl;
|
||||
return 1;
|
||||
}
|
||||
int paramx = atoi(argv[1]);
|
||||
//cout << "Argument 1 : " << argv[1] << endl;
|
||||
while(paramx>0)
|
||||
{
|
||||
|
||||
printf("\rWaiting for %d second(s) \r", paramx);
|
||||
cout << flush;
|
||||
|
||||
sleep_for(seconds(1));
|
||||
paramx--;
|
||||
}
|
||||
|
||||
|
||||
//cout << endl;
|
||||
cout << "\r \r";
|
||||
return paramx;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue