You are not logged in.

#1 2016-03-14 12:16:28

geommer
Member
Registered: 2016-03-13
Posts: 7

Yabar - A modern and lightweight status bar for X window managers

Hello Arch community, I have been using archlinux since 2 years now and I've always wanted to make some contribution to this great community.

https://github.com/geommer/yabar

Yabar is intended to be a better alternative to lemonbar for those who are okay with pango (Xft may be supported in the future). I liked lemonbar but its configuration is somewhat a mess and I also needed a correct rendering for arabic fonts support so I made yabar. Please have a look at yabar features and request what you think is needed to be done!

Last edited by geommer (2016-03-14 15:14:09)

Offline

#2 2016-03-15 06:44:30

oliver
Member
Registered: 2007-12-12
Posts: 448

Re: Yabar - A modern and lightweight status bar for X window managers

Aesthetically I like this a lot.  I'm currently using i3blocks but I might give this a whirl.

Offline

#3 2016-03-31 07:25:47

regitator
Member
Registered: 2010-08-10
Posts: 26

Re: Yabar - A modern and lightweight status bar for X window managers

I just tried it and I like its configuration style. I'm using it with bspwm and have some issues to display infos from bspc subscribe.

I set up a test block like this:

	test:{
	exec: "~/.config/yabar/test.sh";
	type: "persist";
	align: "right";
	fixed-size: 250;

with test.sh:

bspc subscribe node_flag | cut -d' ' -f5-

Yabar doesn't display any text from this this block. test.sh seems to work when executed in the shell outputting "private on", "private off" etc as expected.

Any tips?

Offline

#4 2016-03-31 10:29:31

chickenPie4tea
Member
Registered: 2012-08-21
Posts: 309

Re: Yabar - A modern and lightweight status bar for X window managers

I also tested it briefly, it looks nice but I need to see more example scripts of how I can use it. The great thing abt lemonbar is there are so many examples to look at for ideas.


You can like linux without becoming a fanatic!

Offline

#5 2016-03-31 16:30:44

Next7
Member
Registered: 2011-12-07
Posts: 44

Re: Yabar - A modern and lightweight status bar for X window managers

This bar does not show its window under cwm window manager. The process is running but nothing is displayed. The bar is drawn OK under fvwm window manager or in pure X.

Offline

#6 2016-04-01 09:23:50

geommer
Member
Registered: 2016-03-13
Posts: 7

Re: Yabar - A modern and lightweight status bar for X window managers

regitator wrote:

I just tried it and I like its configuration style. I'm using it with bspwm and have some issues to display infos from bspc subscribe.

I set up a test block like this:

	test:{
	exec: "~/.config/yabar/test.sh";
	type: "persist";
	align: "right";
	fixed-size: 250;

with test.sh:

bspc subscribe node_flag | cut -d' ' -f5-

Yabar doesn't display any text from this this block. test.sh seems to work when executed in the shell outputting "private on", "private off" etc as expected.

Any tips?

Your block config looks fine to me, if it prints on terminal, it should print on the bar. Is this the only block that does not work for you? Because there was a bug (fixed now) that show no text on the bar with optimization flag -O2. Please use the git version if you install from AUR. The other AUR package is old.

Offline

#7 2016-04-01 09:30:38

geommer
Member
Registered: 2016-03-13
Posts: 7

Re: Yabar - A modern and lightweight status bar for X window managers

chickenPie4tea wrote:

I also tested it briefly, it looks nice but I need to see more example scripts of how I can use it. The great thing abt lemonbar is there are so many examples to look at for ideas.

Thank you. I first thought to add my scripts (mostly similar to i3blocks). Then I decided to add internal blocks in plain c just to make yabar less CPU intensive (e.g. avoid exec and fork just to get date from a bash script every second), currently yabar has 6 or 7 internal blocks but not yet documented in README (will be updated in the incoming couple of days).

Offline

#8 2016-04-01 09:38:55

geommer
Member
Registered: 2016-03-13
Posts: 7

Re: Yabar - A modern and lightweight status bar for X window managers

Next7 wrote:

This bar does not show its window under cwm window manager. The process is running but nothing is displayed. The bar is drawn OK under fvwm window manager or in pure X.

Thank you for reporting this. I usually test my code on bspwm and i3 but I will get cwm and try to understand what is wrong.

Offline

#9 2016-04-01 16:48:00

regitator
Member
Registered: 2010-08-10
Posts: 26

Re: Yabar - A modern and lightweight status bar for X window managers

geommer wrote:
regitator wrote:

I just tried it and I like its configuration style. I'm using it with bspwm and have some issues to display infos from bspc subscribe.

I set up a test block like this:

	test:{
	exec: "~/.config/yabar/test.sh";
	type: "persist";
	align: "right";
	fixed-size: 250;

with test.sh:

bspc subscribe node_flag | cut -d' ' -f5-

Yabar doesn't display any text from this this block. test.sh seems to work when executed in the shell outputting "private on", "private off" etc as expected.

Any tips?

Your block config looks fine to me, if it prints on terminal, it should print on the bar. Is this the only block that does not work for you? Because there was a bug (fixed now) that show no text on the bar with optimization flag -O2. Please use the git version if you install from AUR. The other AUR package is old.

The other blocks and example blocks show up fine. I'm already running the git version.

It would be nice to have a debug mode where Yabar could output its content also to stdout so you can see it receives?

Offline

#10 2016-04-03 10:40:10

geommer
Member
Registered: 2016-03-13
Posts: 7

Re: Yabar - A modern and lightweight status bar for X window managers

regitator wrote:

The other blocks and example blocks show up fine. I'm already running the git version.

It would be nice to have a debug mode where Yabar could output its content also to stdout so you can see it receives?

Maybe this block throws the text to stderr and not stdout. Yabar only consumes what is in stdout.
For a debug mode, yes, I intend to add something like that using a conditional compilation flag.

Offline

#11 2016-04-15 20:05:33

stupidus
Member
Registered: 2012-02-27
Posts: 124

Re: Yabar - A modern and lightweight status bar for X window managers

I am trying to write a python script that lists the i3 workspaces. However, I can't get it to work with yabar.

This is the script:

#!/usr/bin/env python

import i3

def print_workspaces():
    workspaces = i3.get_workspaces()
    outputlist=[]
    for i in workspaces:
        if i['focused']==True:
            output = "*"+i['name']+"*"
        else:
            output = i['name']
        outputlist.append(output)
    print(" ".join(outputlist))

print_workspaces()

def list_workspaces(event, data, subscription):
    if 'change' in event:
        print_workspaces()

subscription = i3.Subscription(list_workspaces, 'workspace')

If I run it in the terminal, it works as expected and prints out a new line with the current workspaces, everytime I switch to a different workspace.
However, yabar only shows the initial status and does not update.

This is my yabar.conf:

bar-list: ["bar1"];

bar1: {
    position: "top";
    block-list: ["block1"];
    block1: {
        exec: "python ~/.i3/list-workspaces.py";
        type: "persist";
        align: "left";
        justify: "left";
        fixed-size: 900;
    }
}

I tested if it is some problem with python with the following simple script.

i=1
while True:
    print(i)
    i+=1

This works as expected with yabar.

I don't understand why yabar does not pick up on the new lines in the first script?

EDIT: I found the problem. It is necessary to run the script with python -u (cf. here)
Also there is a bug with i3-py and unicode characters. It is better to use i3ipc.

Last edited by stupidus (2016-04-15 23:26:43)

Offline

Board footer

Powered by FluxBB