fix: fixed some typos and added version to cmake

This commit is contained in:
Kaley, Fischer 2024-07-27 23:53:26 +02:00
parent 2ed4323f9a
commit 81cfc74679
4 changed files with 25 additions and 13 deletions

View file

@ -1,5 +1,12 @@
cmake_minimum_required(VERSION 3.19) cmake_minimum_required(VERSION 3.19)
project(RapidMenu)
# Get version
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/props.json PROPS)
string(JSON VER GET ${PROPS} version)
project(RapidMenu
DESCRIPTION "Utilize configuration files to create runner scripts."
VERSION ${VER})
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 23)
@ -19,7 +26,7 @@ target_link_libraries(RapidMenu PRIVATE tomlplusplus::tomlplusplus)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DRAGONTOS") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DRAGONTOS")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcpptoml-dev") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcpptoml-dev")
set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3") set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Utilize configuration files to create runner scripts.") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_RELEASE_DIST ON) set(CPACK_DEBIAN_PACKAGE_RELEASE_DIST ON)
set(CPACK_GENERATOR DEBIAN) set(CPACK_GENERATOR DEBIAN)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
@ -27,7 +34,7 @@ set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGE_VENDOR "DRAGONTOS") set(CPACK_PACKAGE_VENDOR "DRAGONTOS")
set(CPACK_RPM_PACKAGE_REQUIRES "tomlplusplus-devel") set(CPACK_RPM_PACKAGE_REQUIRES "tomlplusplus-devel")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv3") set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
set(CPACK_RPM_PACKAGE_DESCRIPTION "Utilize configuration files to create runner scripts.") set(CPACK_RPM_PACKAGE_DESCRIPTION ${DESCRIPTION})
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
set(CPACK_GENERATOR RPM) set(CPACK_GENERATOR RPM)

View file

@ -3,6 +3,7 @@ Utilize configuration files to create runner scripts.
# Requirements # Requirements
- cpptoml - cpptoml
- tomlplusplus
- a runner like rofi, dmenu etc - a runner like rofi, dmenu etc
# Installing # Installing
@ -66,17 +67,18 @@ It is required to have the [runner] section in the configuration.
Example: Example:
``` ```
[runner] [runner]
rname = "Dashboard:" (name if needed) rname = "Dashboard:" #(name if needed)
rtheme = "-show-icons -theme ~/.config/rofi/themes/rounded-purple-dark.rasi" (theme if needed) rtheme = "-show-icons -theme ~/.config/rofi/themes/rounded-purple-dark.rasi" #(theme if needed)
rcommand = "rofi -dmenu -p" (dmenu, rofi, bemenu etc) rcommand = "rofi -dmenu -p" #(dmenu, rofi, bemenu etc)
``` ```
An example of something to add to the configuration. An example of something to add to the configuration.
``` ```
[Disk] (To set the name) [Disk] #(To set the name)
names = "Disk" (To set the in the runner) names = "Disk" #(To set the name in the runner)
description = "You chose Disk." (No required but can be set) description = "You chose Disk." #(Not required but can be set)
command = "kitty -e /home/$USER/.config/RapidMenu/hdd.bash" (bash command) command = "kitty -e /home/$USER/.config/RapidMenu/hdd.bash" #(bash command)
``` ```
# Contributors # Contributors
- DRAGONTOS - DRAGONTOS
- maukkis

3
props.json Normal file
View file

@ -0,0 +1,3 @@
{
"version": "0.2.1"
}

View file

@ -18,13 +18,13 @@ void clearBuffer(){
} }
inline void checkIfExtractionFailed(){ inline void checkIfExtractionFailed(){
if (!std::cin){ // if previous extraction failed if (!std::cin){ // if previous extraction failed
if (std::cin.eof()){ // check if eof and if yes aborts the program if (std::cin.eof()){ // check if eof and if yes aborts the program
std::abort(); std::abort();
} }
std::cin.clear(); //put std::cin back into normal mode std::cin.clear(); //put std::cin back into normal mode
clearBuffer(); // remove bad input clearBuffer(); // remove bad input
} }
} }