workspacerules: Add new optional "default command" for auto-launching apps on new workspaces (#3559)

This commit is contained in:
Brenno Lemos 2023-10-22 19:11:03 -03:00 committed by GitHub
parent 59f27e7f57
commit b135bd6cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 100 additions and 30 deletions

View file

@ -1,4 +1,5 @@
#pragma once
#include <functional>
#include <vector>
#include <string>
#include "../macros.hpp"
@ -20,6 +21,15 @@ class CVarList {
std::string join(const std::string& joiner, size_t from = 0, size_t to = 0) const;
void map(std::function<void(std::string&)> func) {
for (auto& s : m_vArgs)
func(s);
}
void append(const std::string arg) {
m_vArgs.emplace_back(arg);
}
std::string operator[](const size_t& idx) const {
if (idx >= m_vArgs.size())
return "";