Skip to content

Commit

Permalink
fix: fixed the bottom to top problem
Browse files Browse the repository at this point in the history
  • Loading branch information
DRAGONTOS committed Jan 18, 2024
1 parent 6d01349 commit 0f21c99
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assets/dashboard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ command = "systemctl --user restart pipestart"
[Browser]
names = "Browser"
description = "You chose floorp."
command = "floorp"
command = "floorp"
23 changes: 16 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,32 @@ int main(int argc, char* argv[]) {

setenv("LC_CTYPE", "", 1);
string namesList;
vector<string> reversedNamesList;

bool isFirst = true;


for (const auto& tableItem : *config) {
try {
Action a;
from_toml(*tableItem.second->as_table(), a);
namesList += a.names + "\n";

reversedNamesList.push_back(a.names);

} catch (const invalid_argument& e) {
cerr << invalidvalue.c_str() << e.what() << endl;
return 1;
}
}

reverse(reversedNamesList.begin(), reversedNamesList.end());
for (const auto& name : reversedNamesList) {
if (!namesList.empty()) {
namesList += "\n";
}
namesList += name;
}

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");
Expand Down Expand Up @@ -148,13 +162,8 @@ int main(int argc, char* argv[]) {

cout << "What do you want to call your executable?: ";
cin >> bexeout;

if (bexeout.empty()) {
cerr << "Error: Executable name cannot be empty." << endl;
return 1;
}

const char* bexe = bexeout.c_str();
bexe = bexeout.c_str();

system(("touch /home/$USER/.local/bin/" + string(bexe)).c_str());
system(("chmod +x /home/$USER/.local/bin/" + string(bexe)).c_str());
Expand Down

0 comments on commit 0f21c99

Please sign in to comment.