File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed
Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change 11#include " i3.h"
22#include " ../debug.h"
3- #include < boost/throw_exception.hpp>
4- #include < stdio.h>
53#include < sstream>
64#include < iostream>
7- #include < thread>
8- #include < chrono>
95#include < QApplication>
106
11- namespace {
12- typedef std::unique_ptr<
13- FILE,
14- decltype (&pclose)
15- > FILEptr;
16- }
17-
187using namespace std ;
198
209DesktopEnvironmentHandlerQuality i3DesktopSupport::quality () const {
@@ -42,6 +31,7 @@ const std::string i3OutputHandle::name() const {
4231
4332OutputList i3DesktopSupport::getOutputs () const {
4433 /* * FIXME: Dummy code */
34+ /* * FIXME: Parse output of i3-msg --get-outputs with a JSON parser */
4535 OutputList list;
4636 list.emplace_back ( new i3OutputHandle (" DVI-I-1" , true ) );
4737 list.emplace_back ( new i3OutputHandle (" VGA-0" , false ) );
@@ -91,11 +81,13 @@ const string i3DesktopSupport::getSocketpath() {
9181 if ( ! spath.empty () ) {
9282 return spath;
9383 }
94- /* * Socketpath not cached */
9584
96- /* * FIXME: Port this to boost or similar */
97- FILEptr fd ( popen (" i3 --get-socketpath" , " r " ), pclose );
85+ /* * FIXME: Actually check the return STRING, not just the retval */
86+ int ret = system (" i3 --get-socketpath" );
9887
88+ if ( ret == 0 ) {
89+ spath = " OK" ;
90+ }
9991
100- return " /run/user/1000/i3/ipc-socket.1468 " ;
92+ return spath ;
10193}
You can’t perform that action at this time.
0 commit comments