diff --git a/bar/src/i3remote.php b/bar/src/i3remote.php new file mode 100755 index 0000000..a23099f --- /dev/null +++ b/bar/src/i3remote.php @@ -0,0 +1,50 @@ +#!/usr/bin/env php +> /home/simon/remote_i3.log 2>>/home/simon/remote_i3.log'; + +$commandStart = "/home/simon/bin/remote_i3_server start".$commandSuffix; +$commandStop = "/home/simon/bin/remote_i3_server stop".$commandSuffix; + +if (!$isAlive) { + echo block( + 'i3remote', + [ + 'full_text' => lpspan(emoji(0xf245), '#cccccc', '#000'), + 'color' => '#cccccc', + ] + ); + + if (getenv('BLOCK_BUTTON') === '1') { + pclose(popen($commandStart, 'r')); + } +} else { + echo block( + 'i3remote', + [ + 'full_text' => lpspan(emoji(0xf245), color('warning'), '#000'), + 'color' => color('warning'), + ] + ); + + if (getenv('BLOCK_BUTTON') === '1') { + pclose(popen($commandStop, 'r')); + } +} +