woops
This commit is contained in:
parent
ef2e33eb31
commit
34da973f52
1 changed files with 9 additions and 6 deletions
15
src/main.cpp
15
src/main.cpp
|
@ -12,6 +12,7 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace cpptoml;
|
||||
|
||||
const string USAGE = R"#(usage: RapidMenu [flags] [<command> [args]]
|
||||
LISTING COMMANDS:
|
||||
-c: To specify which config to use.
|
||||
|
@ -71,12 +72,10 @@ int main(int argc, char* argv[]) {
|
|||
try {
|
||||
auto config = parse_file(configFile);
|
||||
|
||||
setenv("LC_CTYPE", "", 1);
|
||||
setenv("LC_CTYPE", "en_US.UTF-8", 1);
|
||||
string namesList;
|
||||
vector<string> reversedNamesList;
|
||||
|
||||
bool isFirst = true;
|
||||
|
||||
for (const auto& tableItem : *config) {
|
||||
try {
|
||||
Action a;
|
||||
|
@ -91,13 +90,17 @@ int main(int argc, char* argv[]) {
|
|||
}
|
||||
|
||||
reverse(reversedNamesList.begin(), reversedNamesList.end());
|
||||
ostringstream namesStream;
|
||||
|
||||
for (const auto& name : reversedNamesList) {
|
||||
if (!namesList.empty()) {
|
||||
namesList += "\n";
|
||||
if (!namesStream.str().empty()) {
|
||||
namesStream << "\n";
|
||||
}
|
||||
namesList += name;
|
||||
namesStream << name;
|
||||
}
|
||||
|
||||
namesList = namesStream.str();
|
||||
|
||||
string rname = config->get_table("runner")->get_as<string>("rname").value_or("dashboard:");
|
||||
string rtheme = config->get_table("runner")->get_as<string>("rtheme").value_or("");
|
||||
string rcommand = config->get_table("runner")->get_as<string>("rcommand").value_or("rofi -dmenu -p");
|
||||
|
|
Loading…
Add table
Reference in a new issue