The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Set a border around i3bar

asked 2014-10-19 01:16:32 +0000

jr88er gravatar image

How do I set up a 1px border around i3bar?

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-10-19 05:17:54 +0000

ANOKNUSA gravatar image

updated 2014-10-21 14:48:42 +0000

Short answer: This is not possible without hacking the source code.

Long answer: If you're looking to add a colored border around i3bar, you'd have to add new code to the existing code base. I haven't bothered looking into this myself. However, if what you're looking for is to add a 1px border of the same color as the bar, to serve as padding around the status line and workspace list, this is already done by i3bar. The height is set according to (font size) + 6 logical pixels. In <i3 source root>/i3bar/src/xcb.c:

1115 void init_xcb_late(char *fontname) {
1116     if (fontname == NULL)
1117         fontname = "-misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1";
1118
1119     /* Load the font */
1120     font = load_font(fontname, true);
1121     set_font(&font);
1122     DLOG("Calculated Font-height: %d\n", font.height);
---------------------------------------------------------------------------------
1123     bar_height = font.height + logical_px(6); <----THIS SETS THE BAR SIZE
---------------------------------------------------------------------------------
1124
1125     xcb_flush(xcb_connection);
1126
1127     if (config.hide_on_modifier == M_HIDE)
1128         register_xkb_keyevents();
1129 }

If you're willing to build i3 (or at least i3bar) from source, you can play around with that setting to tweak it to your liking.

edit flag offensive delete link more

Comments

Thank you for the answers, very helpful of you.

jr88er gravatar imagejr88er ( 2014-10-21 21:23:04 +0000 )edit

Question Tools

Stats

Asked: 2014-10-19 01:16:32 +0000

Seen: 344 times

Last updated: Oct 21 '14