diff --git a/include/config.hpp b/include/config.hpp index a530844..4670b77 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -41,9 +41,10 @@ class Config std::string sep_reset; std::string gui_bg_image; std::string ascii_logo_type; - std::uint16_t offset = 0; - std::uint16_t logo_padding_left = 0; - std::uint16_t logo_padding_top = 0; + std::uint16_t offset = 0; + std::uint16_t logo_padding_left = 0; + std::uint16_t logo_padding_top = 0; + std::uint16_t layout_padding_top = 0; bool gui = false; std::vector layouts; @@ -162,9 +163,12 @@ offset = 5 # Padding between the start and the ascii art logo-padding-left = 0 -# Padding of the logo from the top +# Padding of the ascii art from the top logo-padding-top = 0 +# Padding of the layout from the top +layout-padding-top = 0 + # Colors can be with: hexcodes (#55ff88) and for bold put '!' (!#55ff88) # OR ANSI escape code colors like "\e[1;34m" # remember to add ${0} where you want to reset color diff --git a/src/config.cpp b/src/config.cpp index 6489caa..0904938 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -67,22 +67,22 @@ void Config::loadConfigFile(const std::string_view filename, colors_t& colors) }); // clang-format off - this->gui = this->getConfigValue("gui.enable", false); - this->ascii_logo_type = this->getConfigValue("config.ascii-logo-type", ""); - - this->source_path = this->getConfigValue("config.source-path", "os"); - this->data_dir = this->getConfigValue("config.data-dir", "/usr/share/customfetch"); - this->sep_reset = this->getConfigValue("config.sep-reset", ":"); - this->offset = this->getConfigValue("config.offset", 5); + this->gui = this->getConfigValue("gui.enable", false); + this->ascii_logo_type = this->getConfigValue("config.ascii-logo-type", ""); + this->source_path = this->getConfigValue("config.source-path", "os"); + this->data_dir = this->getConfigValue("config.data-dir", "/usr/share/customfetch"); + this->sep_reset = this->getConfigValue("config.sep-reset", ":"); + this->offset = this->getConfigValue("config.offset", 5); this->logo_padding_left = this->getConfigValue("config.logo-padding-left", 0); - this->font = this->getConfigValue("gui.font", "Liberation Mono Normal 12"); - this->gui_bg_image = this->getConfigValue("gui.bg-image", "disable"); - this->logo_padding_top = this->getConfigValue("config.logo-padding-top", 0); - - this->uptime_d_fmt = this->getConfigValue("os.uptime.days", " days"); - this->uptime_h_fmt = this->getConfigValue("os.uptime.hours", " hours"); - this->uptime_m_fmt = this->getConfigValue("os.uptime.mins", " mins"); - this->uptime_s_fmt = this->getConfigValue("os.uptime.secs", " secs"); + this->layout_padding_top = this->getConfigValue("config.layout-padding-top", 0); + this->font = this->getConfigValue("gui.font", "Liberation Mono Normal 12"); + this->gui_bg_image = this->getConfigValue("gui.bg-image", "disable"); + this->logo_padding_top = this->getConfigValue("config.logo-padding-top", 0); + + this->uptime_d_fmt = this->getConfigValue("os.uptime.days", " days"); + this->uptime_h_fmt = this->getConfigValue("os.uptime.hours", " hours"); + this->uptime_m_fmt = this->getConfigValue("os.uptime.mins", " mins"); + this->uptime_s_fmt = this->getConfigValue("os.uptime.secs", " secs"); colors.black = this->getThemeValue("config.black", "\033[1;30m"); colors.red = this->getThemeValue("config.red", "\033[1;31m"); diff --git a/src/display.cpp b/src/display.cpp index 1bad78f..699c42a 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -87,6 +87,11 @@ std::vector Display::render(const Config& config, const colors_t& c asciiArt.push_back(""); } + for (int i = 0; i < config.layout_padding_top; i++) + { + layouts.insert(layouts.begin(), ""); + } + while (std::getline(file, line)) { std::string pureOutput; diff --git a/src/main.cpp b/src/main.cpp index 91d1ae7..4412fe6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -63,6 +63,7 @@ A command-line system information tool (or neofetch like program), which its foc --bg-image Path to image to be used in the background in GUI (put "disable" for disabling in the config) --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 --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 @@ -253,11 +254,12 @@ static bool parseargs(int argc, char* argv[], Config& config, const std::string_ {"distro", required_argument, 0, 'd'}, {"source-path", required_argument, 0, 's'}, - {"logo-padding-top", required_argument, 0, "logo-padding-top"_fnv1a16}, - {"logo-padding-left",required_argument, 0, "logo-padding-left"_fnv1a16}, - {"bg-image", required_argument, 0, "bg-image"_fnv1a16}, - {"color", required_argument, 0, "color"_fnv1a16}, - {"gen-config", optional_argument, 0, "gen-config"_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} }; @@ -309,6 +311,9 @@ static bool parseargs(int argc, char* argv[], Config& config, const std::string_ case "logo-padding-left"_fnv1a16: config.logo_padding_left = std::atoi(optarg); break; + case "layout-padding-top"_fnv1a16: + config.layout_padding_top = std::atoi(optarg); break; + case "bg-image"_fnv1a16: config.gui_bg_image = optarg; break;