diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b62abc..2016c96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,12 @@ 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) @@ -19,7 +26,7 @@ target_link_libraries(RapidMenu PRIVATE tomlplusplus::tomlplusplus) set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DRAGONTOS") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcpptoml-dev") 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_GENERATOR DEBIAN) set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") @@ -27,7 +34,7 @@ set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") set(CPACK_PACKAGE_VENDOR "DRAGONTOS") set(CPACK_RPM_PACKAGE_REQUIRES "tomlplusplus-devel") 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_PACKAGE_RELEASE_DIST ON) set(CPACK_GENERATOR RPM) diff --git a/README.md b/README.md index f7d19a3..e4eb7ae 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Utilize configuration files to create runner scripts. # Requirements - cpptoml +- tomlplusplus - a runner like rofi, dmenu etc # Installing @@ -66,17 +67,18 @@ It is required to have the [runner] section in the configuration. Example: ``` [runner] -rname = "Dashboard:" (name if needed) -rtheme = "-show-icons -theme ~/.config/rofi/themes/rounded-purple-dark.rasi" (theme if needed) -rcommand = "rofi -dmenu -p" (dmenu, rofi, bemenu etc) +rname = "Dashboard:" #(name if needed) +rtheme = "-show-icons -theme ~/.config/rofi/themes/rounded-purple-dark.rasi" #(theme if needed) +rcommand = "rofi -dmenu -p" #(dmenu, rofi, bemenu etc) ``` An example of something to add to the configuration. ``` -[Disk] (To set the name) -names = "Disk" (To set the in the runner) -description = "You chose Disk." (No required but can be set) -command = "kitty -e /home/$USER/.config/RapidMenu/hdd.bash" (bash command) +[Disk] #(To set the name) +names = "Disk" #(To set the name in the runner) +description = "You chose Disk." #(Not required but can be set) +command = "kitty -e /home/$USER/.config/RapidMenu/hdd.bash" #(bash command) ``` # Contributors - DRAGONTOS +- maukkis diff --git a/props.json b/props.json new file mode 100644 index 0000000..c284c02 --- /dev/null +++ b/props.json @@ -0,0 +1,3 @@ +{ + "version": "0.2.1" +} diff --git a/src/main.cpp b/src/main.cpp index d638695..9dc89ea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,13 +18,13 @@ void clearBuffer(){ } inline void checkIfExtractionFailed(){ - if (!std::cin){ // if previous extraction failed - if (std::cin.eof()){ // check if eof and if yes aborts the program + if (!std::cin){ // if previous extraction failed + if (std::cin.eof()){ // check if eof and if yes aborts the program std::abort(); } std::cin.clear(); //put std::cin back into normal mode - clearBuffer(); // remove bad input + clearBuffer(); // remove bad input } }