Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6098: Add Config Flag to hyprctl systeminfo #6160

Merged
merged 36 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3026846
Add Config Flag to hyprctl systeminfo
The-Briel-Deal May 19, 2024
5a43202
Use configCurrentPath member.
The-Briel-Deal May 19, 2024
b1234c5
Add --config as an option.
The-Briel-Deal May 19, 2024
89220ed
Add line breaks
The-Briel-Deal May 19, 2024
22800ce
Amend Bug Report Template.
The-Briel-Deal May 19, 2024
157efec
Formatting Header.
The-Briel-Deal May 19, 2024
0d02baa
layout: Fix shrinking pseudotile windows. (#6143)
The-Briel-Deal May 18, 2024
bd9796e
input: find surface pos correctly when mouse drag is active
vaxerski May 18, 2024
77889d0
xdg-shell: fixup positioner behavior with slide and resize
vaxerski May 21, 2024
f71e114
flake.lock: update
fufexan May 20, 2024
282a055
build: update meson, cmake setup
rtgiskard May 15, 2024
1056ffc
Revert "CMake: use add_custom_command for generating protocols (#6104)"
fufexan May 21, 2024
f4696a6
renderer: render fonts with pango, add global `font_family` config op…
rtgiskard May 22, 2024
2de4a5f
keybinds: Add option to disable window direction monitor fallback (#6…
shezdy May 22, 2024
3f4818f
window: guard monitor in bounding box calculations
vaxerski May 22, 2024
a17b98f
screencopy: use a simple renderer for frame passing
vaxerski May 22, 2024
9739d09
[gha] Nix: update inputs
vaxerski May 22, 2024
31209a4
internal: save previous workspace before change (#6202)
shezdy May 23, 2024
c67ddc0
tablet: fix mapping when mapped region is specified (#6206)
sifmelcara May 23, 2024
143f873
debug: Add ARM GPU info (#6212)
System64fumo May 23, 2024
2c63c91
internal: Replace monitor rule when disabling head. (#6136)
levnikmyskin May 23, 2024
bd7b32b
pointermgr: ensure compositor exist on destroy (#6216)
gulafaran May 23, 2024
b465ad4
window: fix invalid env buffer size in getEnv
vaxerski May 24, 2024
1fc8d6b
pointer: add back nvidia hardware cursor quirks (#6220)
thejch May 24, 2024
272fb9c
monitor: avoid UB on undefined auto dir
vaxerski May 24, 2024
66da111
keybinds: Added new dispatcher (sendshortcut) (#6174)
yungcxn May 24, 2024
f285660
flake.lock: update
fufexan May 24, 2024
d67e3cf
Move logging to a function.
The-Briel-Deal May 25, 2024
afc2763
Format
The-Briel-Deal May 25, 2024
ea65324
Format
The-Briel-Deal May 25, 2024
532f07d
Merge? Goofed things up during a rebase.
The-Briel-Deal May 25, 2024
1288159
Add linebreak.
The-Briel-Deal May 25, 2024
c4358fe
Read whole file instead of one line at a time.
The-Briel-Deal May 25, 2024
64a9035
Remove redundant c_str()
The-Briel-Deal May 25, 2024
dff1208
Remove redundant this->
The-Briel-Deal May 25, 2024
77e59ca
Address feedback on issue template.
The-Briel-Deal May 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ body:
- type: textarea
id: ver
attributes:
label: Hyprland Version
description: "Paste the output of `hyprctl systeminfo` here."
label: System Info and Version
description: |
Paste the output of `hyprctl systeminfo -c` here (If you are on a
version that shows you help menu, omit the `-c` and attach config files
to the issue). If you have configs outside of the main config shown
here, please attach.
value: "<details>
<summary>System/Version info</summary>

Expand Down
2 changes: 2 additions & 0 deletions hyprctl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ int main(int argc, char** argv) {
fullArgs += "r";
} else if (ARGS[i] == "-a" && !fullArgs.contains("a")) {
fullArgs += "a";
} else if ((ARGS[i] == "-c" || ARGS[i] == "--config") && !fullArgs.contains("c")) {
fullArgs += "c";
} else if (ARGS[i] == "--batch") {
fullRequest = "--batch ";
} else if (ARGS[i] == "--instance" || ARGS[i] == "-i") {
Expand Down
19 changes: 19 additions & 0 deletions src/config/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,25 @@ std::string CConfigManager::getMainConfigPath() {
return getConfigDir() + "/hypr/" + (ISDEBUG ? "hyprlandd.conf" : "hyprland.conf");
}

const std::string CConfigManager::getConfigString() {
std::string configString;
std::string currFileContent;

for (auto path : configPaths) {
std::ifstream configFile(path);
configString += ("\n\nConfig File: " + path + ": ");
if (!configFile.is_open()) {
Debug::log(LOG, "Config file not readable/found!");
configString += "Read Failed\n";
continue;
}
configString += "Read Succeeded\n";
currFileContent.assign(std::istreambuf_iterator<char>(configFile), std::istreambuf_iterator<char>());
configString.append(currFileContent);
}
return configString;
}

std::string CConfigManager::getErrors() {
return m_szConfigErrors;
}
Expand Down
1 change: 1 addition & 0 deletions src/config/ConfigManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class CConfigManager {
void onPluginLoadUnload(const std::string& name, bool load);
static std::string getConfigDir();
static std::string getMainConfigPath();
const std::string getConfigString();

SMonitorRule getMonitorRuleFor(const CMonitor&);
SWorkspaceRule getWorkspaceRuleFor(PHLWORKSPACE workspace);
Expand Down
9 changes: 9 additions & 0 deletions src/debug/HyprCtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "../devices/IKeyboard.hpp"
#include "../devices/ITouch.hpp"
#include "../devices/Tablet.hpp"
#include "config/ConfigManager.hpp"

static void trimTrailingComma(std::string& str) {
if (!str.empty() && str.back() == ',')
Expand Down Expand Up @@ -897,6 +898,12 @@ std::string systemInfoRequest(eHyprCtlOutputFormat format, std::string request)
result += std::format(" {} by {} ver {}\n", pl->name, pl->author, pl->version);
}

if (g_pHyprCtl->m_sCurrentRequestParams.sysInfoConfig) {
result += "\n======Config-Start======\n";
result += g_pConfigManager->getConfigString();
result += "\n======Config-End========\n";
}

return result;
}

Expand Down Expand Up @@ -1640,6 +1647,8 @@ std::string CHyprCtl::getReply(std::string request) {
reloadAll = true;
else if (c == 'a')
m_sCurrentRequestParams.all = true;
else if (c == 'c')
m_sCurrentRequestParams.sysInfoConfig = true;
}

if (sepIndex < request.size())
Expand Down
5 changes: 3 additions & 2 deletions src/debug/HyprCtl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class CHyprCtl {
int m_iSocketFD = -1;

struct {
bool all = false;
bool all = false;
bool sysInfoConfig = false;
} m_sCurrentRequestParams;

private:
Expand All @@ -26,4 +27,4 @@ class CHyprCtl {
std::vector<SP<SHyprCtlCommand>> m_vCommands;
};

inline std::unique_ptr<CHyprCtl> g_pHyprCtl;
inline std::unique_ptr<CHyprCtl> g_pHyprCtl;
Loading