diff --git a/assets/config-examples/config_cool.toml b/assets/config-examples/config_cool.toml index 0867175..82678ac 100644 --- a/assets/config-examples/config_cool.toml +++ b/assets/config-examples/config_cool.toml @@ -31,7 +31,7 @@ # This is really system depedent layout = [ "${red}$${0}@${cyan}$", - "───────────────────────────", + "$", "${red}$ ${cyan} $${cyan} \\<- Arch ", "${red} ^ ${green} $ \\<━━━┓", "${red} | ${green}┃", diff --git a/assets/config-examples/config_modified.toml b/assets/config-examples/config_modified.toml index 334695b..979a970 100644 --- a/assets/config-examples/config_modified.toml +++ b/assets/config-examples/config_modified.toml @@ -29,7 +29,7 @@ layout = [ "${red}$${0}@${cyan}$", - "───────────────────────────", + "$", "${red}OS -> $ $", "${yellow}Host -> $", "${!#33ffa1}Init -> $", diff --git a/cufetch.1 b/cufetch.1 index 704ceb2..933744a 100644 --- a/cufetch.1 +++ b/cufetch.1 @@ -57,12 +57,18 @@ Print the version along with the git branch it was built \fB\-\-bg\-image\fR Path to image to be used in the background in GUI (put "disable" for disabling in the config) .TP -\fB\-\-logo\-padding\-top\fR +\fB\-\-logo\-padding\-top\fR Padding of the logo from the top .TP -\fB\-\-logo\-padding\-left\fR +\fB\-\-logo\-padding\-left\fR Padding of the logo from the left .TP +\fB\-\-sep\-title\fR +A char (or string) to use in $ +.TP +\fB\-\-sep\-reset\fR +A separetor (or string) that when ecountered, will automatically reset color +.TP \fB\-\-gen\-config\fR [] Generate default config file to config folder (if path, it will generate to the path) .br diff --git a/src/display.cpp b/src/display.cpp index d112a13..faff4fc 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -163,8 +163,8 @@ std::vector Display::render(const Config& config, const colors_t& c origin += asciiArt.at(i).length(); } - size_t spaces = (maxLineLength + (config.m_disable_source ? 1 : config.offset)) - - (i < asciiArt.size() ? pureAsciiArtLens.at(i) : 0); + const size_t& spaces = (maxLineLength + (config.m_disable_source ? 1 : config.offset)) - + (i < asciiArt.size() ? pureAsciiArtLens.at(i) : 0); debug("spaces: {}", spaces); diff --git a/src/main.cpp b/src/main.cpp index 5aefab4..f523453 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,6 +64,8 @@ A command-line system information tool (or neofetch like program), which its foc --logo-padding-top Padding of the logo from the top --logo-padding-left Padding of the logo from the left --layout-padding-top Padding of the layout from the top + --sep-title A char (or string) to use in $ + --sep-reset A separetor (or string) that when ecountered, will automatically reset color --gen-config [] Generate default config file to config folder (if path, it will generate to the path) Will ask for confirmation if file exists already @@ -260,12 +262,15 @@ static bool parseargs(int argc, char* argv[], Config& config, const std::string_ {"distro", required_argument, 0, 'd'}, {"source-path", required_argument, 0, 's'}, + {"sep-reset", required_argument, 0, "sep-reset"_fnv1a16}, + {"sep-title", required_argument, 0, "sep-title"_fnv1a16}, {"logo-padding-top", required_argument, 0, "logo-padding-top"_fnv1a16}, {"logo-padding-left", required_argument, 0, "logo-padding-left"_fnv1a16}, {"layout-padding-top", required_argument, 0, "layout-padding-top"_fnv1a16}, {"bg-image", required_argument, 0, "bg-image"_fnv1a16}, {"color", required_argument, 0, "color"_fnv1a16}, {"gen-config", optional_argument, 0, "gen-config"_fnv1a16}, + {0,0,0,0} }; @@ -326,7 +331,7 @@ static bool parseargs(int argc, char* argv[], Config& config, const std::string_ case "color"_fnv1a16: { const std::string& optarg_str = optarg; - const size_t pos = optarg_str.find('='); + const size_t& pos = optarg_str.find('='); if (pos == std::string::npos) die("argument color '{}' does NOT have an equal sign '=' for separiting color name and value.\n" "for more check with --help", optarg_str); @@ -345,6 +350,12 @@ static bool parseargs(int argc, char* argv[], Config& config, const std::string_ config.generateConfig(configFile); exit(EXIT_SUCCESS); + case "sep-reset"_fnv1a16: + config.sep_reset = optarg; break; + + case "sep-title"_fnv1a16: + config.user_sep_title = optarg; break; + default: return false; }