diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp index 483ccfb0..f02790eb 100644 --- a/src/overlay_params.cpp +++ b/src/overlay_params.cpp @@ -27,7 +27,8 @@ #include #include #include -#include "X11/keysym.h" +#include +#include #include "imgui.h" #include "overlay_params.h" @@ -142,9 +143,24 @@ parse_signed(const char *str) return strtol(str, NULL, 0); } -static const char * +static std::string parse_str(const char *str) { +#ifdef _XOPEN_SOURCE + // Expand ~/ to home dir + if (str[0] == '~') { + std::string s; + wordexp_t e; + int ret; + + if (!(ret = wordexp(str, &e, 0))) + s = e.we_wordv[0]; + wordfree(&e); + + if (!ret) + return s; + } +#endif return str; }