From 633d7c07ee2197abd7fc3536dc3fa14cf43d8bb0 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 6 Jan 2008 11:35:51 +0100 Subject: [PATCH] add get_current_layout() to get current layout :-) --- config.h | 8 -------- layout.c | 10 ++++++++++ layout.h | 9 +++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/config.h b/config.h index 9164903ca..754507164 100644 --- a/config.h +++ b/config.h @@ -59,14 +59,6 @@ struct Rule typedef struct AwesomeConf AwesomeConf; -typedef struct Layout Layout; -struct Layout -{ - char *image; - LayoutArrange *arrange; - Layout *next; -}; - typedef struct Key Key; struct Key { diff --git a/layout.c b/layout.c index 831795e3c..45f8b3896 100644 --- a/layout.c +++ b/layout.c @@ -72,6 +72,16 @@ arrange(int screen) restack(screen); } + +Layout * +get_current_layout(int screen) +{ + Tag **curtags = get_current_tags(screen); + Layout *l = curtags[0]->layout; + p_delete(&curtags); + return l; +} + /** Send focus to next client in stack * \param screen Screen ID * \param arg Unused diff --git a/layout.h b/layout.h index 6e2f16c76..83c95c433 100644 --- a/layout.h +++ b/layout.h @@ -28,7 +28,16 @@ typedef void (LayoutArrange)(int); +typedef struct Layout Layout; +struct Layout +{ + char *image; + LayoutArrange *arrange; + Layout *next; +}; + void arrange(int); +Layout * get_current_layout(int); void restack(int); void loadawesomeprops(int); void saveawesomeprops(int);