Skip to content

Commit

Permalink
update to i3-4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Jun 21, 2016
1 parent b329144 commit 1357549
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 239 deletions.
6 changes: 3 additions & 3 deletions README.md
@@ -1,5 +1,5 @@
# i3-qubes
Qubes OS rpm for i3 4.8
Qubes OS rpm for i3 4.12

You'll find the full installation instructions and more information on https://sietse.no/i3-wm-in-qubes-os

Expand All @@ -25,13 +25,13 @@ user@vm$ make rpms

Then, copy the rpm to your Dom0:
```
user@Dom0$ qvm-run --pass-io <vmname> 'cat /path/to/rpm/x86_64/i3-4.8-3.f20.x86_64.rpm' > i3-4.8-3.f20.x86_64.rpm
user@Dom0$ qvm-run --pass-io <vmname> 'cat /path/to/rpm/x86_64/i3-4.12-3.f23.x86_64.rpm' > i3-4.12-3.f23.x86_64.rpm
```

And finally install it:

```
user@Dom0$ sudo yum localinstall i3-4.8-3.f20.x86_64.rpm
user@Dom0$ sudo yum localinstall i3-4.12-3.f23.x86_64.rpm
```

Log out, log in again and configure to your needs!
Expand Down
177 changes: 88 additions & 89 deletions i3/0001-Show-qubes-domain-in-non-optional-colored-borders.patch
@@ -1,16 +1,16 @@
diff -uNr i3-4.8/include/atoms.xmacro i3-4.8p/include/atoms.xmacro
--- i3-4.8/include/atoms.xmacro 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/include/atoms.xmacro 2016-05-13 09:28:23.231844563 +0200
@@ -34,3 +34,5 @@
diff -uNr i3-4.12/include/atoms_rest.xmacro i3-4.12p/include/atoms_rest.xmacro
--- i3-4.12/include/atoms_rest.xmacro 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/include/atoms_rest.xmacro 2016-05-12 16:50:08.958369525 +0200
@@ -17,3 +17,5 @@
xmacro(_NET_REQUEST_FRAME_EXTENTS)
xmacro(_NET_FRAME_EXTENTS)
xmacro(_MOTIF_WM_HINTS)
+xmacro(_QUBES_VMNAME)
+xmacro(_QUBES_LABEL)
diff -uNr i3-4.8/include/data.h i3-4.8p/include/data.h
--- i3-4.8/include/data.h 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/include/data.h 2016-05-13 09:28:23.232844563 +0200
@@ -348,6 +348,12 @@
diff -uNr i3-4.12/include/data.h i3-4.12p/include/data.h
--- i3-4.12/include/data.h 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/include/data.h 2016-05-12 15:51:46.499369525 +0200
@@ -377,6 +377,12 @@
/** The name of the window. */
i3String *name;

Expand All @@ -23,10 +23,10 @@ diff -uNr i3-4.8/include/data.h i3-4.8p/include/data.h
/** The WM_WINDOW_ROLE of this window (for example, the pidgin buddy window
* sets "buddy list"). Useful to match specific windows in assignments or
* for_window. */
diff -uNr i3-4.8/include/window.h i3-4.8p/include/window.h
--- i3-4.8/include/window.h 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/include/window.h 2016-05-13 09:28:23.233844563 +0200
@@ -33,6 +33,20 @@
diff -uNr i3-4.12/include/window.h i3-4.12p/include/window.h
--- i3-4.12/include/window.h 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/include/window.h 2016-05-12 15:51:46.501369525 +0200
@@ -39,6 +39,20 @@
void window_update_name_legacy(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt);

/**
Expand All @@ -47,44 +47,42 @@ diff -uNr i3-4.8/include/window.h i3-4.8p/include/window.h
* Updates the CLIENT_LEADER (logical parent window).
*
*/
diff -uNr i3-4.8/src/commands.c i3-4.8p/src/commands.c
--- i3-4.8/src/commands.c 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/src/commands.c 2016-05-13 09:34:54.964844563 +0200
@@ -836,23 +836,17 @@
diff -uNr i3-4.12/src/commands.c i3-4.12p/src/commands.c
--- i3-4.12/src/commands.c 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/src/commands.c 2016-05-12 17:02:53.529369525 +0200
@@ -730,22 +730,16 @@
if (strcmp(border_style_str, "toggle") == 0) {
border_style++;
border_style %= 3;
- if (border_style == BS_NORMAL)
- tmp_border_width = 2;
- con_border_width = 2;
- else if (border_style == BS_NONE)
- tmp_border_width = 0;
- con_border_width = 0;
- else if (border_style == BS_PIXEL)
- tmp_border_width = 1;
+ tmp_border_width = 3;
- con_border_width = 1;
+ con_border_width = 3;
} else {
if (strcmp(border_style_str, "normal") == 0)
if (strcmp(border_style_str, "normal") == 0) {
border_style = BS_NORMAL;
else if (strcmp(border_style_str, "pixel") == 0)
} else if (strcmp(border_style_str, "pixel") == 0) {
border_style = BS_PIXEL;
- else if (strcmp(border_style_str, "1pixel") == 0) {
+ else if (strcmp(border_style_str, "1pixel") == 0 ||
+ strcmp(border_style_str, "none") == 0) {
- } else if (strcmp(border_style_str, "1pixel") == 0) {
+ } else if (strcmp(border_style_str, "1pixel") == 0 ||
+ strcmp(border_style_str, "none") == 0) {
border_style = BS_PIXEL;
- tmp_border_width = 1;
- } else if (strcmp(border_style_str, "none") == 0)
- con_border_width = 1;
- } else if (strcmp(border_style_str, "none") == 0) {
- border_style = BS_NONE;
- else {
+ tmp_border_width = 3;
+ } else {
+ con_border_width = 3;
} else {
ELOG("BUG: called with border_style=%s\n", border_style_str);
ysuccess(false);
return;
diff -uNr i3-4.8/src/config.c i3-4.8p/src/config.c
--- i3-4.8/src/config.c 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/src/config.c 2016-05-13 09:28:23.237844563 +0200
@@ -264,6 +264,12 @@
diff -uNr i3-4.12/src/config.c i3-4.12p/src/config.c
--- i3-4.12/src/config.c 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/src/config.c 2016-05-12 15:51:46.507369525 +0200
@@ -236,6 +236,12 @@

parse_configuration(override_configpath);
parse_configuration(override_configpath, true);

+ /* redefine defaults, to overwrite user settings easily */
+ config.default_border = BS_NORMAL;
Expand All @@ -94,10 +92,10 @@ diff -uNr i3-4.8/src/config.c i3-4.8p/src/config.c
+
if (reload) {
translate_keysyms();
grab_all_keys(conn, false);
diff -uNr i3-4.8/src/manage.c i3-4.8p/src/manage.c
--- i3-4.8/src/manage.c 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/src/manage.c 2016-05-13 09:28:23.239844563 +0200
grab_all_keys(conn);
diff -uNr i3-4.12/src/manage.c i3-4.12p/src/manage.c
--- i3-4.12/src/manage.c 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/src/manage.c 2016-05-12 15:51:46.510369525 +0200
@@ -87,7 +87,7 @@
xcb_get_window_attributes_reply_t *attr = NULL;

Expand All @@ -106,7 +104,7 @@ diff -uNr i3-4.8/src/manage.c i3-4.8p/src/manage.c
+ utf8_title_cookie, title_cookie, qubes_vmname_cookie, qubes_label_cookie,
class_cookie, leader_cookie, transient_cookie,
role_cookie, startup_id_cookie, wm_hints_cookie,
wm_normal_hints_cookie, motif_wm_hints_cookie;
wm_normal_hints_cookie, motif_wm_hints_cookie, wm_user_time_cookie, wm_desktop_cookie;
@@ -152,6 +152,8 @@
strut_cookie = GET_PROPERTY(A__NET_WM_STRUT_PARTIAL, UINT32_MAX);
state_cookie = GET_PROPERTY(A__NET_WM_STATE, UINT32_MAX);
Expand All @@ -116,7 +114,7 @@ diff -uNr i3-4.8/src/manage.c i3-4.8p/src/manage.c
leader_cookie = GET_PROPERTY(A_WM_CLIENT_LEADER, UINT32_MAX);
transient_cookie = GET_PROPERTY(XCB_ATOM_WM_TRANSIENT_FOR, UINT32_MAX);
title_cookie = GET_PROPERTY(XCB_ATOM_WM_NAME, 128);
@@ -188,6 +190,8 @@
@@ -176,6 +178,8 @@
window_update_class(cwindow, xcb_get_property_reply(conn, class_cookie, NULL), true);
window_update_name_legacy(cwindow, xcb_get_property_reply(conn, title_cookie, NULL), true);
window_update_name(cwindow, xcb_get_property_reply(conn, utf8_title_cookie, NULL), true);
Expand All @@ -125,10 +123,10 @@ diff -uNr i3-4.8/src/manage.c i3-4.8p/src/manage.c
window_update_leader(cwindow, xcb_get_property_reply(conn, leader_cookie, NULL));
window_update_transient_for(cwindow, xcb_get_property_reply(conn, transient_cookie, NULL));
window_update_strut_partial(cwindow, xcb_get_property_reply(conn, strut_cookie, NULL));
diff -uNr i3-4.8/src/window.c i3-4.8p/src/window.c
--- i3-4.8/src/window.c 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/src/window.c 2016-05-13 09:28:23.240844563 +0200
@@ -120,6 +120,57 @@
diff -uNr i3-4.12/src/window.c i3-4.12p/src/window.c
--- i3-4.12/src/window.c 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/src/window.c 2016-05-12 15:51:46.511369525 +0200
@@ -148,6 +148,57 @@
}

/*
Expand Down Expand Up @@ -186,10 +184,10 @@ diff -uNr i3-4.8/src/window.c i3-4.8p/src/window.c
* Updates the CLIENT_LEADER (logical parent window).
*
*/
diff -uNr i3-4.8/src/x.c i3-4.8p/src/x.c
--- i3-4.8/src/x.c 2014-06-15 19:12:43.000000000 +0200
+++ i3-4.8p/src/x.c 2016-05-13 09:33:27.623844563 +0200
@@ -348,6 +348,50 @@
diff -uNr i3-4.12/src/x.c i3-4.12p/src/x.c
--- i3-4.12/src/x.c 2016-03-06 16:17:18.000000000 +0100
+++ i3-4.12p/src/x.c 2016-05-12 17:45:52.819369525 +0200
@@ -394,6 +394,50 @@
else
p->color = &config.client.unfocused;

Expand All @@ -199,73 +197,74 @@ diff -uNr i3-4.8/src/x.c i3-4.8p/src/x.c
+ DLOG("con->qubes_label is %d\n", win->qubes_label);
+ switch (win->qubes_label) {
+ case 0: // dom0
+ p->color->text = get_colorpixel("#ffffff");
+ p->color->background = get_colorpixel(in_focus ? "#474747" : "#303030");
+ p->color->text = draw_util_hex_to_color("#ffffff");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#474747" : "#303030");
+ break;
+ case 1: // red
+ p->color->text = get_colorpixel("#000000");
+ p->color->background = get_colorpixel(in_focus ? "#ff0000" : "#ba0000");
+ p->color->text = draw_util_hex_to_color("#000000");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#ff0000" : "#ba0000");
+ break;
+ case 2: // orange
+ p->color->text = get_colorpixel("#0059FF");
+ p->color->background = get_colorpixel(in_focus ? "#ffa500" : "#b87700");
+ p->color->text = draw_util_hex_to_color("#0059FF");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#ffa500" : "#b87700");
+ break;
+ case 3: // yellow
+ p->color->text = get_colorpixel("#000000");
+ p->color->background = get_colorpixel(in_focus ? "#ffff00" : "#baba00");
+ p->color->text = draw_util_hex_to_color("#000000");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#ffff00" : "#baba00");
+ break;
+ case 4: // green
+ p->color->text = get_colorpixel("#ffffff");
+ p->color->background = get_colorpixel(in_focus ? "#347235" : "#214822");
+ p->color->text = draw_util_hex_to_color("#ffffff");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#347235" : "#214822");
+ break;
+ case 5: // gray
+ p->color->text = get_colorpixel("#ffffff");
+ p->color->background = get_colorpixel(in_focus ? "#777775" : "#5d5d5b");
+ p->color->text = draw_util_hex_to_color("#ffffff");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#777775" : "#5d5d5b");
+ break;
+ case 6: // blue
+ p->color->text = get_colorpixel("#000000");
+ p->color->background = get_colorpixel(in_focus ? "#1e5ef3" : "#133b98");
+ p->color->text = draw_util_hex_to_color("#000000");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#1e5ef3" : "#133b98");
+ break;
+ case 7: // purple
+ p->color->text = get_colorpixel("#ffffff");
+ p->color->background = get_colorpixel(in_focus ? "#9a219b" : "#621562");
+ p->color->text = draw_util_hex_to_color("#ffffff");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#9a219b" : "#621562");
+ break;
+ case 8: // black
+ p->color->text = get_colorpixel("#ffffff");
+ p->color->background = get_colorpixel(in_focus ? "#2f2f2f" : "#000000");
+ p->color->text = draw_util_hex_to_color("#ffffff");
+ p->color->background = draw_util_hex_to_color(in_focus ? "#2f2f2f" : "#000000");
+ break;
+ }
+ }
+
p->border_style = con_border_style(con);

Rect *r = &(con->rect);
@@ -492,7 +536,6 @@
set_font_colors(parent->pm_gc, p->color->text, p->color->background);
@@ -527,7 +571,6 @@
/* 6: draw the title */
int text_offset_y = (con->deco_rect.height - config.font.height) / 2;

- struct Window *win = con->window;
if (win == NULL) {
/* we have a split container which gets a representation
* of its children as title
@@ -531,10 +574,16 @@
//DLOG("indent_level = %d, indent_mult = %d\n", indent_level, indent_mult);
int indent_px = (indent_level * 5) * indent_mult;
i3String *title;
if (con->title_format == NULL) {
@@ -603,13 +646,19 @@
FREE(formatted_mark);
}

- draw_text(win->name,
- parent->pixmap, parent->pm_gc,
- con->deco_rect.x + 2 + indent_px, con->deco_rect.y + text_offset_y,
- con->deco_rect.width - 2 - indent_px);
+ /* set window title, include qubes vmname */
+ char *vmname_and_name;
+ sasprintf(&vmname_and_name, "[%s] %s", i3string_as_utf8(win->qubes_vmname), i3string_as_utf8(win->name));
+
+ draw_text_ascii(vmname_and_name,
+ parent->pixmap, parent->pm_gc,
+ con->deco_rect.x + 2 + indent_px, con->deco_rect.y + text_offset_y,
+ con->deco_rect.width - 2 - indent_px);
+
+ free(vmname_and_name);
i3String *title = con->title_format == NULL ? win->name : con_parse_title_format(con);
+ char *title_buf;
+ sasprintf(&title_buf, "[%s] %s", i3string_as_utf8(win->qubes_vmname), i3string_as_utf8(title));
+ if (con->title_format != NULL)
+ I3STRING_FREE(title);
+ title = i3string_from_utf8(title_buf);
+ FREE(title_buf);
draw_util_text(title, &(parent->frame_buffer),
p->color->text, p->color->background,
con->deco_rect.x + logical_px(2) + indent_px, con->deco_rect.y + text_offset_y,
con->deco_rect.width - logical_px(2) - indent_px - mark_width - logical_px(2));
- if (con->title_format != NULL)
- I3STRING_FREE(title);
+ I3STRING_FREE(title);

after_title:
/* Since we don’t clip the text at all, it might in some cases be painted
x_draw_decoration_after_title(con, p);
36 changes: 0 additions & 36 deletions i3/0002-Bugfix-add-a-sync-call-to-i3bar-to-confirm-reparents.patch

This file was deleted.

0 comments on commit 1357549

Please sign in to comment.