Re: [i3] [GoogleTechTalks] i3 - An Improved Tiling Window Manager

2012-06-18 Thread José Luis Pereira
Nice! I just learned some more stuff that i missed while scrolling the
guide, sweet!
--
José Pereira
Personal blog 




On Mon, Jun 18, 2012 at 10:23 PM, Mateusz Loskot  wrote:

> Hi,
>
> I haven't seen it announced here yet, so here it comes.
> GoogleTechTalks just uploaded i3 talk presented by Michael:
>
> http://www.youtube.com/watch?v=QnYN2CTb1hM
>
> Great stuff Michael!
>
> Happy watching
> --
> Mateusz Loskot, http://mateusz.loskot.net
>


Re: [i3] faq.i3wm.org launched

2012-06-06 Thread José Luis Pereira
Michael, nice addition to the project!

Best
--
José Pereira


On Wed, Jun 6, 2012 at 12:32 AM, BRAGA, Bruno  wrote:

> Michael,
>
> That is a great idea! I reckon the faq style is much easier to track,
> follow up and search than mailing lists!
>
> I will try to participate as much as I can!
>
> Regards,
>
> --
> *Braga, Bruno*
> www.brunobraga.net
> bruno.br...@gmail.com
>
>
>
> On Tue, Jun 5, 2012 at 1:01 AM, Jan Krcmar  wrote:
>
>> hey,
>>
>> this is really cool.
>> nicely done!
>>
>> thanks
>> jan
>>
>> 2012/6/4 Michael Stapelberg :
>> > Hey,
>> >
>> > in an attempt to provide useful answers to questions about i3 and
>> > related topics, I set up http://faq.i3wm.org/. It’s a
>> stackexchange-like
>> > site where you can post (or find) questions and answers.
>> >
>> > Please give it a shot for your next question and, whenever you get a
>> > question answered on a different way (for example on this mailing list,
>> > on IRC or even in real life), please post your question + answer on that
>> > site so that other people can read the answer, too :).
>> >
>> > Best regards,
>> > Michael
>>
>
>


Re: [i3] tray_output for primary display

2012-04-05 Thread José Luis Pereira
Thanks, looking forward to add some more :P

Btw, i have the following question, is there a way to be passively notified
of changes on a determined workspace?
For instance, i'm running a console in workspace 3 and it issues a system
bell, i could see the workspace in i3bar with a different color stating
that a window changed...
Not sure if i make my point...

Best

--
José Pereira


On Thu, Apr 5, 2012 at 1:45 PM, Michael Stapelberg  wrote:

> Hi José,
>
> Excerpts from José Luis Pereira's message of 2012-04-01 16:08:05 +0200:
> > I apologize for the delay. I think it is good this time, i'm kinda of
> noob
> > on git patch things..
> I’m sorry, I should have mentioned that patches should be done against the
> 'next' branch in our git repository. You did yours against the master
> branch :).
>
> No big deal, though, I’ve merged this into the next branch and your
> changes are
> now online.
>
> Thanks for your contribution!
>
> Best regards,
> Michael
>


Re: [i3] tray_output for primary display

2012-04-01 Thread José Luis Pereira
I apologize for the delay. I think it is good this time, i'm kinda of noob
on git patch things..

Best
--
José Pereira


On Mon, Mar 26, 2012 at 5:33 PM, Michael Stapelberg wrote:

> Hi José,
>
> Excerpts from José Luis Pereira's message of 2012-03-21 10:22:53 +0100:
> > Here you have, packed a doc, removed whitespace and changed if order.
> I just tested your patch and it works fine for me. Two little things are
> missing before I can merge this:
>
> 1) The patch against docs/userguide doesn’t apply cleanly anymore. Can you
>   rebase this?
>
> 2) You only supplied a patch. Can you use git format-patch instead please
> so
>   that we have proper author information?
>
> Thanks!
> Best regards,
> Michael
>


0001-i3bar-Added-option-to-select-primary-display-on-tray.patch
Description: Binary data


Re: [i3] tray_output for primary display

2012-03-21 Thread José Luis Pereira
Here you have, packed a doc, removed whitespace and changed if order.

Best Regards

--
José Pereira


On Wed, Mar 21, 2012 at 12:36 AM, Fernando Lemos wrote:

> Hi,
>
> 2012/3/20 José Luis Pereira :
> > Dear Michael, All
> >
> > Here you have the patch that implements the "primary" output feature. Its
> >  working fairly well, could you add it also in the docs?
> > Also, user should be aware that the is no default primary display (at
> least
> > in my debian machine), you can make it by doing so:
> > xrandr --output  --primary
>
> Looks good, though I didn't test it. Some very minor suggestions, feel
> free to ignore them to your discretion:
>
> * I'd prefer to do the boolean comparison first in the "if" clause.
> There's no performance improvement in practice, but it seems more
> correct to me.
>
> * You've added a trailing whitespace to i3bar/outputs.h.
>
> If you can, please submit a patch for the docs. They're in the same
> Git repository. I believe you may choose to use send a different
> patch, or simply pack the changes in the same commit (specially as the
> changes should be simple enough).
>
> Regards,
>
diff --git a/docs/userguide b/docs/userguide
index e75f1ca..69eaa29 100644
--- a/docs/userguide
+++ b/docs/userguide
@@ -896,7 +896,7 @@ you can turn off the functionality entirely.
 
 *Syntax*:
 -
-tray_output 
+tray_output 
 -
 
 *Example*:
@@ -904,10 +904,18 @@ tray_output 
 # disable system tray
 tray_output none
 
+# show tray icons on the primary monitor
+tray_output primary
+
 # show tray icons on the big monitor
 tray_output HDMI2
 -
 
+Note that you might not have a primary output configured yet. To do so, run:
+-
+xrandr --output  --primary
+-
+
 === Font
 
 Specifies the font (again, X core font, not Xft, just like in i3) to be used in
diff --git a/i3bar/include/outputs.h b/i3bar/include/outputs.h
index 6501c31..f9ddd54 100644
--- a/i3bar/include/outputs.h
+++ b/i3bar/include/outputs.h
@@ -40,6 +40,7 @@ i3_output* get_output_by_name(char* name);
 struct i3_output {
 char*  name;  /* Name of the output */
 bool   active;/* If the output is active */
+bool   primary;   /* If it is the primary output */
 intws;/* The number of the currently visible ws */
 rect   rect;  /* The rect (relative to the root-win) */
 
diff --git a/i3bar/src/outputs.c b/i3bar/src/outputs.c
index 9dc5cab..83a4c24 100644
--- a/i3bar/src/outputs.c
+++ b/i3bar/src/outputs.c
@@ -45,15 +45,19 @@ static int outputs_null_cb(void *params_) {
 static int outputs_boolean_cb(void *params_, int val) {
 struct outputs_json_params *params = (struct outputs_json_params*) params_;
 
-if (strcmp(params->cur_key, "active")) {
-return 0;
+if (!strcmp(params->cur_key, "active")) {
+params->outputs_walk->active = val;
+FREE(params->cur_key);
+return 1;
 }
 
-params->outputs_walk->active = val;
-
-FREE(params->cur_key);
+if (!strcmp(params->cur_key, "primary")) {
+params->outputs_walk->primary = val;
+FREE(params->cur_key);
+return 1;
+}
 
-return 1;
+return 0;
 }
 
 /*
diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c
index afcfaa3..b4df8cd 100644
--- a/i3bar/src/xcb.c
+++ b/i3bar/src/xcb.c
@@ -453,9 +453,12 @@ static void handle_client_message(xcb_client_message_event_t* event) {
 SLIST_FOREACH(walk, outputs, slist) {
 if (!walk->active)
 continue;
-if (config.tray_output &&
-strcasecmp(walk->name, config.tray_output) != 0)
-continue;
+if (config.tray_output) {
+if ((strcasecmp(walk->name, config.tray_output) != 0) &&
+(!walk->primary || strcasecmp("primary", config.tray_output) != 0))
+continue;
+}
+
 DLOG("using output %s\n", walk->name);
 output = walk;
 }
diff --git a/src/ipc.c b/src/ipc.c
index fe1464e..60533da 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -408,6 +408,9 @@ IPC_HANDLER(get_outputs) {
 ystr("active");
 y(bool, output->active);
 
+ystr("primary");
+y(bool, output->primary);
+
 ystr("rect");
 y(map_open);
 ystr("x");


Re: [i3] tray_output for primary display

2012-03-20 Thread José Luis Pereira
Dear Michael, All

Here you have the patch that implements the "primary" output feature. Its
 working fairly well, could you add it also in the docs?
Also, user should be aware that the is no default primary display (at least
in my debian machine), you can make it by doing so:
xrandr --output  --primary


Looking forward to contribute with more patches.
Best Regards
--
José Pereira

On Sun, Mar 18, 2012 at 5:09 PM, Michael Stapelberg wrote:

> Hi José,
>
> Excerpts from José Luis Pereira's message of 2012-03-18 14:34:43 +0100:
> > Thanks for your anwer. I would like to implement the feature, i have
> fairly
> Awesome!
>
> > good C knowledge for this. Would you give me some guidelines?
> > I have been looking into the code and i found out that the modification
> > should be in xbc.c on i3bar source, am i right?
> Yes, partly:
>
> Since i3bar uses IPC and doesn’t query RandR directly, I recommend
> introducing
> a new boolean member in the IPC reply for the get_outputs message (see
> i3-msg
> -t get_outputs), called "primary". Then, make i3bar handle "primary" as a
> special value (case-insensitively) in i3bar/src/xcb.c.
>
> Feel free to send patches to this mailing list for review and feel free to
> drop
> by on IRC to clarify any questions you might have.
>
> Best regards,
> Michael
>
diff --git a/i3bar/include/outputs.h b/i3bar/include/outputs.h
index 6501c31..cb336be 100644
--- a/i3bar/include/outputs.h
+++ b/i3bar/include/outputs.h
@@ -40,6 +40,7 @@ i3_output* get_output_by_name(char* name);
 struct i3_output {
 char*  name;  /* Name of the output */
 bool   active;/* If the output is active */
+bool   primary;   /* If it is the primary output */ 
 intws;/* The number of the currently visible ws */
 rect   rect;  /* The rect (relative to the root-win) */
 
diff --git a/i3bar/src/outputs.c b/i3bar/src/outputs.c
index 9dc5cab..83a4c24 100644
--- a/i3bar/src/outputs.c
+++ b/i3bar/src/outputs.c
@@ -45,15 +45,19 @@ static int outputs_null_cb(void *params_) {
 static int outputs_boolean_cb(void *params_, int val) {
 struct outputs_json_params *params = (struct outputs_json_params*) params_;
 
-if (strcmp(params->cur_key, "active")) {
-return 0;
+if (!strcmp(params->cur_key, "active")) {
+params->outputs_walk->active = val;
+FREE(params->cur_key);
+return 1;
 }
 
-params->outputs_walk->active = val;
-
-FREE(params->cur_key);
+if (!strcmp(params->cur_key, "primary")) {
+params->outputs_walk->primary = val;
+FREE(params->cur_key);
+return 1;
+}
 
-return 1;
+return 0;
 }
 
 /*
diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c
index 29ffe1c..3615603 100644
--- a/i3bar/src/xcb.c
+++ b/i3bar/src/xcb.c
@@ -452,9 +452,12 @@ static void handle_client_message(xcb_client_message_event_t* event) {
 SLIST_FOREACH(walk, outputs, slist) {
 if (!walk->active)
 continue;
-if (config.tray_output &&
-strcasecmp(walk->name, config.tray_output) != 0)
-continue;
+if (config.tray_output) {
+if ((strcasecmp(walk->name, config.tray_output) != 0) &&
+(strcasecmp("primary", config.tray_output) != 0 || !walk->primary))
+continue;
+}
+
 DLOG("using output %s\n", walk->name);
 output = walk;
 }
diff --git a/src/ipc.c b/src/ipc.c
index fe1464e..60533da 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -408,6 +408,9 @@ IPC_HANDLER(get_outputs) {
 ystr("active");
 y(bool, output->active);
 
+ystr("primary");
+y(bool, output->primary);
+
 ystr("rect");
 y(map_open);
 ystr("x");


Re: [i3] tray_output for primary display

2012-03-18 Thread José Luis Pereira
Thanks for your anwer. I would like to implement the feature, i have fairly
good C knowledge for this. Would you give me some guidelines?
I have been looking into the code and i found out that the modification
should be in xbc.c on i3bar source, am i right?
I realized i3bar uses ipc to communicate with i3wm, therefore i'm not sure
if this is the right place to modify... Also, i do not know how should i
get the primary display from xrandr..

Best


On Sat, Mar 17, 2012 at 9:45 PM, José Luis Pereira  wrote:

> Hello all,
>
> I'm a new user of i3wm, and i am very pleased with it, thank you for
> writing such a good piece of software!
> However, i want to use the same config file for my pcs, and some of them
> do not feature the same display name, i cannot have a generic file for
> i3bar.
> Is it easy to implement something like:
>
> bar {
> tray_output primary
> }
> Instead of the former "none" or display name?
>
> Best Regards
>
>  --
> José Pereira
> Personal blog <http://www.onaips.com>
>
>
>
>


[i3] tray_output for primary display

2012-03-17 Thread José Luis Pereira
Hello all,

I'm a new user of i3wm, and i am very pleased with it, thank you for
writing such a good piece of software!
However, i want to use the same config file for my pcs, and some of them do
not feature the same display name, i cannot have a generic file for i3bar.
Is it easy to implement something like:

bar {
tray_output primary
}
Instead of the former "none" or display name?

Best Regards
 --
José Pereira
Personal blog