geommer / yabar Goto Github PK
View Code? Open in Web Editor NEWA modern and lightweight status bar for X window managers.
License: MIT License
A modern and lightweight status bar for X window managers.
License: MIT License
It would be nice if yabar could draw borders around itself. I know that i can achieve this by launching two instances of yabar. But I would like to avoid this trick.
Here what i mean:
https://i.imgur.com/Xpskb0Q.png
I'm trying to get yabar to work with i3, and it's been very nice so far, but now I want to add workspace support similar to i3bar.
I can generate a list of workspaces from i3-msg -t get_workspaces
json output, but I can't display them in the bar the way I want: each workspace as a separate block, while hiding non-active workspaces and with different underline/overline/background/foreground depending on the workspaces' state.
Here's how I see it:
In the config, it should look just like a usual block, except that the command outputs several lines instead of a single one. For example, command seq 1 10
would give us 10 blocks from 1 to 10.
And then, the usual formatting is also applied to each of the resulting blocks, so this for example:
1
"!Y u0xff0000 Y!2"
3
would give us 3 blocks, block 2
with red underline, the rest with default settings (inherited from the block/bar).
Command button actions can be then handled with a new env variable ${YABAR_BLOCK_NAME}
containing block text stripped of !Y..Y!
formatting.
It would be very helpful if you could add the examples in the screenshots to the examples
and then maybe link them in the README
.
I think that it would be helpful for new users if we had a tutorial or quick start guide on the wiki. It also can store in for on how each block affects the output of you want.
Using Archlinux with XFCE4 (xfdesktop 4.12.3-1) with composite enable
Starting yabar xfdesktop goes blank (desktop icons disappear), and yabar doesn't appear
With composite disabled same thing, but there's a black bar
$ yabar -c example.config
Your first release compiled fine, but every subsequent release has failed to compile. Here is the output during the make.
cc -std=c99 -pedantic -Wall -O2 `pkg-config --cflags pango pangocairo libconfig` -DVERSION=\"0.2.2-5-gfe14a6d\" -DYABAR_RANDR -c -o src/ya_exec.o src/ya_exec.c
In file included from /usr/include/sys/wait.h:29:0,
from src/yabar.h:20,
from src/ya_exec.c:9:
/usr/include/signal.h:156:29: error: unknown type name ‘siginfo_t’
extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
^
src/ya_exec.c: In function ‘ya_exec_redir_period’:
src/ya_exec.c:36:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
pipe(opipe);
^
src/ya_exec.c: In function ‘ya_exec_redir_persist’:
src/ya_exec.c:58:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
pipe(opipe);
^
src/ya_exec.c: In function ‘ya_exec_redir_once’:
src/ya_exec.c:16:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
pipe(opipe);
^
<builtin>: recipe for target 'src/ya_exec.o' failed
make: *** [src/ya_exec.o] Error 1
In your internal config example, the ya_ws has different icons to represent the current workstation. It would be fantastic to be able to have all open workspaces listed with a highlight or color block over the workspace that is currently open.
For multi-monitor setups, most of the bar configurations have quite a bit in common but currently must be specified seperately. I propose an extends
option that will insert the specified bar's configuration into the new bar's configuration.
foreground-color-rgb:0xeeeeee;
underline-color-rgb:0x373b41;
overline-color-rgb:0x373b41;
i have this in my config but the underline/overlines are never shown. foreground and background colors do work tho.
using 0.23
Hi,
I tried the experimental randr support, but it seems not to be working on my setup, the 2 bars are showing on the primary monitor. I am on a laptop with closed screen on a docking station, and 2 external monitors. LVDS1 is my laptop built-in screen, which is connected but not used. The 2 other monitors are VGA1 and DP3. Here is my config file:
bar-list = ["firstbar","secondbar"];
firstbar:{
font: "Droid Sans";
block-list: ["title"];
position: "bottom";
height: 20;
width: 1680;
monitor: "DP3";
title:{
exec: "echo 'i am DP3'";
align: "left";
fixed-size: 90;
type: "persist";
}
}
secondbar:{
font: "Droid Sans";
block-list: ["title"];
position: "bottom";
height: 20;
width: 1680;
monitor: "VGA1";
title:{
exec: "echo 'i am VGA1'";
align: "left";
fixed-size: 90;
type: "persist";
}
}
$ xrandr -q
Screen 0: minimum 320 x 200, current 3360 x 1050, maximum 8192 x 8192
LVDS1 connected (normal left inverted right x axis y axis)
1600x900 59.99 + 40.00
1024x768 60.00
800x600 60.32 56.25
640x480 59.94
VGA1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
1680x1050 59.95*+
1280x1024 75.02 60.02
1152x864 75.00
1024x768 75.08 60.00
800x600 75.00 60.32
640x480 75.00 60.00
720x400 70.08
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 473mm x 296mm
1680x1050 59.95*+
1280x1024 75.02 60.02
1152x864 75.00
1024x768 75.08 60.00
800x600 75.00 60.32
640x480 75.00 60.00
720x400 70.08
I think that with this config I should have one bar on each screen, however both bars are on the primary screen (VGA1).
Thanks in advance for your help
Hi,
Using the example config I don't see any text in the bar. I have ttf-droid and ttf-font-awesome installed which seem to be the fonts it wants, but I've also tried specifying other fonts with no luck.
I'm on Arch with herbstluftm. I just submitted packages to the AUR btw.
This doesn't show anything either:
bar-list: ["bar1"];
bar1: {
block-list: ["block1"];
block1: {
exec: "date";
}
}
using slack option in the bar config does not draw any blank space between my blocks. using latest master from git.
I use bspwm and will add yabar for my panel,yabar only can display Font Awesome then i try font awesome in internal-prefix and cannot display the icon.
$ make cc -o yabar src/ya_parse.o src/ya_exec.o src/ya_draw.o src/ya_main.o src/intern_blks/ya_intern.o -lxcb -lpthread -lxcb-randr -lxcb-ewmh``pkg-config --libs pango pangocairo libconfig gdk-pixbuf-2.0`` src/ya_parse.o: In function``ya_config_parse': ya_parse.c:(.text+0x4ca): undefined reference to``config_lookup_from' ya_parse.c:(.text+0xb44): undefined reference to``config_lookup_from' collect2: error: ld returned 1 exit status Makefile:18: recipe for target 'yabar' failed make: *** [yabar] Error 1
I have installed the necessary dependencies.
After application goes full screen and back it takes around 5 seconds (not all blocks at the same time) for the blocks to return to their original state.
Not all of them do though, I have two blocks simulating gaps (having maximum opacity), but after return from full screen their opacity is gone and they aren't transparent anymore, but having default background color.
I'm going to make a Gentoo ebuild for this but would like to confirm what exact dependencies Yabar requires? Maybe include them in the README?
I'm running Debian. When I try to make yabar, it's giving me the following error:
cc -o yabar src/ya_parse.o src/ya_exec.o src/ya_draw.o src/ya_main.o src/intern_blks/ya_intern.o -lxcb -lpthread -lxcb-randr
pkg-config --libs pango pangocairo libconfig
src/ya_parse.o: In function ya_config_parse': ya_parse.c:(.text+0x8b3): undefined reference to
config_setting_lookup'
ya_parse.c:(.text+0x9db): undefined reference to `config_setting_lookup'
collect2: error: ld returned 1 exit status
Makefile:17: recipe for target 'yabar' failed
make: *** [yabar] Error 1
Hi! I love yabar and I'm using on my home PC. But recently I set it up on my laptop and so displaying battery status is pretty important. So here part of my yabar.conf:
ya_bat: {
exec: "YABAR_BATTERY";
align: "center";
fixed-size: 70;
interval: 1;
internal-suffix: "%";
internal-option1: "BAT0";
internal-option2: " ";
#internal-spacing: true;
}
And yabar shows error: No type is defined for block: ya_bat, skipping this block...
Ofc, If I try any other block-type (YABAR_MEMORY
, for instance) it works fine.
Fixed width bars could be placed offset on the top and bottom of the screen to provide a more artistic feel. Also, it would allow users to set up multi-monitor configurations (although built in multi-monitor support would be amazing as well, but that's a seperate issue).
Is providing a system tray as an internal block possible?
I've been having yabar crash on me a couple of times in the last few days. I'm not really sure what the reason is. Mostly it's just core dumped on some random event. Here's the output I've gotten the last time it happened. http://pastebin.com/KCcHCrD4
FYI, I'm using
I'm having some trouble configuring YABAR_WORKSPACE to work like i3bar.
The problem (whether a bug or not) is that, say I have 10 workspaces from 1 to 0.
And I create a window in workspace 1 and 2.
Now I want to create a window in workspace 9.
YABAR_WORKSPACE somehow gets buggy about how it shows the title of the workspace.
If I skipped workspace 3, then workspace 9 will have '3' instead of '9'...
In another word, yabar assumes that the user will only create windows in workspaces in order, not in a random sequence directed by the user.
EDIT: I got a work around using a script.
Also, is there any way to tweak the yabar.conf to change the color accordingly to `i3-msg -t get_workspaces' output?
My goal is to display all of my available workspaces on the left of my yabar.
Then to change the bg fg colors of the block that's being focused by i3 to a different color.
By giving scripts a block position on the screen to work with, they can more accurately place new windows and whatnot rather than relying on the cursor position after the event.
For example, a small window containing a calendar might be positioned directly above, and aligned with, a date block when clicked. Without knowing the position and dimensions of the block, the calendar would be difficult to position accurately and consistently.
I propose the environment variables $YABAR_BLOCK_X
, $YABAR_BLOCK_Y
, $YABAR_BLOCK_WIDTH
, and $YABAR_BLOCK_HEIGHT
, relative to the screen, should be set to the clicked block's position and size when running a command using command-button#
.
You have passed wrong dependencies for Ubuntu. Yabar is compiling after installing this packages:
libcairo2-dev libpango1.0-dev libconfig-dev libxcb-randr0-dev
Well, if you are new to yabar, I am the author (meh who cares anyway...). I opened this issue to know if anyone would really like to have right or left bars. Currently yabar only supports top bars
and bottom bars
. I myself use and will use only topbars. However, I made some reservations in the code if right and left are implemented. I really would like to see some discussion, guides or proposals about this feature if implemented.
I propose:
I suggest to reuse a higher level build system than your current small make file so that powerful checks for software features will become easier.
I'm getting
No package 'gdk-pixbuf-2.0' found
same with pango.h
In Conky, there is a setting called use_spacer
which adds spaces around numerical values to prevent them from moving, compared to normal (i.e. when CPU usage goes from 9 to 10%, for example, the whole text shifts to the left or right depending on text centering). Could we have a setting for this in the form of spacer: #
, where # is the largest length and # - number_length
spaces are added to the left of the number?
I would like to point out that an identifier like "_YABAR_H
" does not fit to the expected naming convention of the C language standard.
Would you like to adjust your selection for unique names?
If I add more blocks to the right part, wouldn't it be more useful to show them on the left?
This way first block gets first priority.
Edit: Maybe this could be an optional setting.
Since bars are usually centered by default, it would only make sense for them to be centered even when width
is specified and horizontal-gap
is not.
Note: I'll fix this. It was an after thought after adding the width
option.
Hello - using spectrwm V2.7.2 on Fedora 23. I am having trouble getting yabar to display on all workspaces? Maybe I dont understand the documentation. I've tried reserving screen in my .spectrwm.conf, not reserving a screen, and launching yabar with the baraction in .spectrwm.conf and as a script that calls yabar.
Calling yabar in .xinitrc starts yabar fine on WS 1. Any idea what I could be doing wrong (other than using spectrwm :)
The function "exit" does not belong to the list of async-signal-safe functions.
I guess that a different program design will be needed for your function "ya_sighandler".
I cloned the project onto my computer and downloaded the required libraries. The linker fails with the error message:
ya_exec.c:(.text+0x14c4): undefined reference to `config_setting_lookup'
ya_exec.c:(.text+0x14f7): undefined reference to `config_setting_lookup'
collect2: error: ld returned 1 exit status
Using Ubuntu 14.04. All the necessary libraries are installed as far as I'm aware. Full make output (hopefully) attached: makeoutput.txt.
So far, the code is mostly uncommented. Being a small project, it isn't currently that hard to figure out how things work, but as it grows, it might become unweildy.
It would be useful to at least have functions commented as to what they do, accept, and return. Also, if there is any specific commenting style that is prefered, it should probably be mentioned here (so I can follow it, and comment existing functions).
I propose we add support for using either YAML or JSON for the configuration syntax to improve consistancy between tools and to make it easier to implement any moderately intricate configuration features (such as #25).
This could also be added in addition to the current format by either using a new command line flag or by checking the configuration file's extention.
If I am correct the current interal workspaces block only displays the current visible workspace. Is it do-able to add an option to display all existing workspaces as well?
I've compiled yabar
successfully, but when I try to run it with the example configs I get a Segmentation fault
. I'm using Openbox on Debian Jessie.
Would you like to add more error handling for return values from functions like the following?
if i set no bgcolor for my block it uses black.
Is it possible to define default bacground color for blocks or let blocks without bgcolor use bar bg color?
my current config
bar-list = ["topbar"];
topbar:{
font: "Droid Sans, FontAwesome Bold 9";
block-list: ["desktop", "title", "date"];
position: "top";
height: 24;
//If you want transparency, use argb, not rgb
background-color-rgb: 0x1c2126;
foreground-color-rgb: 0xffffff;
underline-size: 2;
overline-size: 0;
slack-size: 4;
desktop:{
exec: "bspc subscribe report";
align: "left";
fixed-size: 120;
type: "persist";
justify: "left";
}
title:{
exec: "xtitle -s";
align: "left";
fixed-size: 350;
type: "persist";
justify: "left";
}
date:{
exec: "date +'%a %d %b, %I:%M'";
align: "right";
fixed-size: 150;
type: "periodic";
interval: 1;
}
}
could u replace internal-prefix with prefix.
currently i have to configure something like this to get my prefix:
ya_cpu: {
exec: "echo -n ' ' && cat /proc/loadavg| awk '{print $1}'";
type: "periodic";
align: "right";
fixed-size: 60;
interval: 1;
background-color-rgb:0x98D9B6;
underline-color-rgb:0xE97F02;
}
but i would prefer if i could use prefix for any type of block:
ya_cpu: {
exec: "cat /proc/loadavg| awk '{print $1}'";
type: "periodic";
align: "right";
fixed-size: 60;
interval: 1;
prefix: " ";
background-color-rgb:0x98D9B6;
underline-color-rgb:0xE97F02;
}
Hi, can you or anyone tell me how to use yabar with XMonad workspaces ?
512 character limit can be too low for a status block containing lots of pango formatting
It'd be really cool if yabar would support images, like an option icon: path
for a block which would show the icon on said path, and perhaps an icon-exec: "command"
where the command should return the path to an icon, also executed in intervals/... . I'd be happy with just XBM/XPM support.
Especially the icon-exec would be useful, as that would allow dynamic images, like a battery icon or a wifi icon displaying battery/signal strenght.
(Am I correct in assuming the current screenshots use unicode glyphs for "icons"?)
Hi was wondering if you have implemented a way to incorporate bspwm workspaces into Yabar? Couldn't see anything in the documentation.
i need multiple colors in one block (shuld display workspaces)
using this i get reg fg and the other color printet to panel:
Y fg 0xffff0000 Y!red !Y fg 0xff00ff00 Y!green !Y fg 0xff0000ff Y!blue'
sample config to reproduce:
bar-list = ["topbar"];
topbar:{
font: "Droid Sans, FontAwesome Bold 9";
block-list: ["rgb"];
position: "top";
height: 24;
//If you want transparency, use argb, not rgb
background-color-rgb: 0x1c2126;
foreground-color-rgb: 0xffffff;
underline-size: 2;
overline-size: 0;
slack-size: 4;
rgb:{
exec: "echo '!Y fg 0xffff0000 Y!red !Y fg 0xff00ff00 Y!green !Y fg 0xff0000ff Y!blue'";
align: "right";
fixed-size: 340;
type: "once";
interval: 1;
}
}
will yabar support usage via the "status_command" so that we can have the benefit of i3bars systray?
When trying to use the 'inherit' options, regardless of bar naming, I can't seem to get yabar to find the referenced bar, which then results in yabar seg faulting. It's possible I could just be doing something wrong.
To help the debugging a bit, I've tried:
Here is my config: https://gist.github.com/Lindenk/2b85beafb47ff0b658a3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.