]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/outputs.c
Optionally change i3bar color on focused output, implements #2020
[i3/i3] / i3bar / src / outputs.c
index df3bc69b81b8a39069408d306cb04b8bb358b904..841a7565c6e8257d2d79fe53b5e9d23ba57aeea2 100644 (file)
@@ -302,3 +302,17 @@ i3_output *get_output_by_name(char *name) {
 
     return walk;
 }
+
+/*
+ * Returns true if the output has the currently focused workspace
+ *
+ */
+bool output_has_focus(i3_output *output) {
+    i3_ws *ws_walk;
+    TAILQ_FOREACH(ws_walk, output->workspaces, tailq) {
+        if (ws_walk->focused) {
+            return true;
+        }
+    }
+    return false;
+}