You are not logged in.

#176 2014-05-04 02:40:46

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bar - Lightweight xcb-based bar

I got a question about my clickable area.  Am i doing something wrong?  Because at the moment, I have test2 as an executable script in my $PATH folder, and making a clickable area using that method on the github page like so:

FluxBB bbcode test

Only gives me an stdout out the file name.  test2 is simply a #!/bin/bash script that contains a one liner of "notify-send "hello" "

Can someone lend me a hand?    (Also, I tried replacing the test2 line with the actual command of notify-send, and that still doesn't seem to help).

Offline

#177 2014-05-04 03:36:41

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: bar - Lightweight xcb-based bar

3xOSC wrote:

I got a question about my clickable area.  Am i doing something wrong?  Because at the moment, I have test2 as an executable script in my $PATH folder, and making a clickable area using that method on the github page like so:

http://i.imgur.com/sVMAnzJ.png

Only gives me an stdout out the file name.  test2 is simply a #!/bin/bash script that contains a one liner of "notify-send "hello" "

Can someone lend me a hand?    (Also, I tried replacing the test2 line with the actual command of notify-send, and that still doesn't seem to help).

https://bbs.archlinux.org/viewtopic.php … 5#p1398915

Last edited by Stebalien (2014-05-04 03:37:05)


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#178 2014-05-04 05:00:16

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bar - Lightweight xcb-based bar

Hi Stebalien,

Thanks for the reply.  So now that I see that it goes to stdout on the console, that means I can pipe the word to, say, bash and then simply eval it?
Or does it have to go through panel_fifo first?

Offline

#179 2014-05-04 08:24:06

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

@Ploppz
Please open a ticket on github so I can remember. I guess the problem is due to the pixmap->window indirection that causes the colors to blend incorrectly.

Offline

#180 2014-05-04 17:18:19

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: bar - Lightweight xcb-based bar

3xOSC wrote:

Hi Stebalien,

Thanks for the reply.  So now that I see that it goes to stdout on the console, that means I can pipe the word to, say, bash and then simply eval it?
Or does it have to go through panel_fifo first?

bar doesn't even know about panel_fifo. It reads text to display from stdin and spits action text to stdout. So no, it doesn't have to go through panel_fifo. You can parse this action text any way you want but the simplest method is to just eval it (as long as you trust bar's input text).


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#181 2014-05-04 18:06:52

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bar - Lightweight xcb-based bar

Looking at the example you replied to me;

echo '%{A:scrot:}asdf%{A}' | bar -p | while read line; do eval "$line"; done

I have a similar function in my 'panel' file:

cat "$PANEL_FIFO" | panel_bar | bar -p -g 1394x14+22 -f "$FONT_FAMILY2","$FONT_FAMILY" -u 2 -F "$COLOR_BACKGROUND" -B "$COLOR_FOREGROUND" &

where the properties of my BAR gets defined.  Do I have to pipe the clickable area and pipe it through there?  Or is it okay to do it separately, say, in a function?

Offline

#182 2014-05-04 19:03:29

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: bar - Lightweight xcb-based bar

cat "$PANEL_FIFO" | panel_bar | bar -p -g 1394x14+22 -f "$FONT_FAMILY2","$FONT_FAMILY" -u 2 -F "$COLOR_BACKGROUND" -B "$COLOR_FOREGROUND" | ...... &
# (1)               (2)         (3)                                                                                                         (4)

1. Read data in from $PANEL_FIFO.
2. Format data read from $PANEL_FIFO into a format suitable for display by bar.
3. Display this data in a status bar.
4. Read bar's output and handle any actions. You can write a separate action-handler script that reads from stdin or you can just put your action handler inline (as shown below). For example, if you have a "play" action and you want `mpc play` to be called when you click on this action, you could do the following:

(cat "$PANEL_FIFO" | panel_bar | bar -p -g 1394x14+22 -f "$FONT_FAMILY2","$FONT_FAMILY" -u 2 -F "$COLOR_BACKGROUND" -B "$COLOR_FOREGROUND" | while read action; do
    case $action in
        play) mpc play ;;
    esac
done) &

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#183 2014-05-04 20:52:50

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bar - Lightweight xcb-based bar

Stebalien wrote:
cat "$PANEL_FIFO" | panel_bar | bar -p -g 1394x14+22 -f "$FONT_FAMILY2","$FONT_FAMILY" -u 2 -F "$COLOR_BACKGROUND" -B "$COLOR_FOREGROUND" | ...... &
# (1)               (2)         (3)                                                                                                         (4)

1. Read data in from $PANEL_FIFO.
2. Format data read from $PANEL_FIFO into a format suitable for display by bar.
3. Display this data in a status bar.
4. Read bar's output and handle any actions. You can write a separate action-handler script that reads from stdin or you can just put your action handler inline (as shown below). For example, if you have a "play" action and you want `mpc play` to be called when you click on this action, you could do the following:

(cat "$PANEL_FIFO" | panel_bar | bar -p -g 1394x14+22 -f "$FONT_FAMILY2","$FONT_FAMILY" -u 2 -F "$COLOR_BACKGROUND" -B "$COLOR_FOREGROUND" | while read action; do
    case $action in
        play) mpc play ;;
    esac
done) &

That worked beautifully, thanks so much Stebalien

Offline

#184 2014-05-06 23:15:26

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: bar - Lightweight xcb-based bar

Is it possible to have the xtitle stop right right before the Desktop numbers (as represented by the dots in my screenshot).  I find that the way it creeps past it when I have a longer than usual title makes  my BAR look, well, ugly:

picture

Offline

#185 2014-05-07 19:00:00

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

Ploppz, can you please try this branch ? I've tested it for a couple of minutes and seemed to render all the colors perfectly now smile

3xOSC Just use cut on the window title string

Offline

#186 2014-05-07 22:41:32

YvesBod
Member
Registered: 2014-05-07
Posts: 2

Re: bar - Lightweight xcb-based bar

I've got a question. I'm trying to use the following to start the bar:

/home/yves/bin/bar.sh | bar -g 1220x25+350+20 -p -B  #00222222 -F #00626262 -f "-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*" &

Executing this code from a terminal will start the bar normaly, but never on the position it's supposed to be, and puting it on '.xinitrc' starts it on it's correct position but will freeze the system (can't see mouse, can't launch anything). I'm using openbox.

Offline

#187 2014-05-08 21:45:01

YvesBod
Member
Registered: 2014-05-07
Posts: 2

Re: bar - Lightweight xcb-based bar

YvesBod wrote:

I've got a question. I'm trying to use the following to start the bar:

/home/yves/bin/bar.sh | bar -g 1220x25+350+20 -p -B  #00222222 -F #00626262 -f "-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*" &

Executing this code from a terminal will start the bar normaly, but never on the position it's supposed to be, and puting it on '.xinitrc' starts it on it's correct position but will freeze the system (can't see mouse, can't launch anything). I'm using openbox.

Just figured it out. You have to put the color codes inside quotes, or else bash gets confused. I wasn't having the problem from the terminal because of zsh.

Offline

#188 2014-06-22 12:42:12

Stalafin
Member
From: Berlin, Germany
Registered: 2007-10-26
Posts: 617

Re: bar - Lightweight xcb-based bar

Maybe I am doing it wrongly, but bar doesn't seem to be able to find my ttf fonts? Here is what happens for Dejavu Sans Mono:

% echo "muh" | bar-aint-recursive -p -g x24 -f "Dejavu Sans Mono"
Could not load font DejavuSansMono

Any ideas what's up with that?

% pacman -Qqs dejavu 
ttf-dejavu

EDIT: Just to add: this seems to be happening with pretty much every font I try.

Forgot that bar doesn't support xft fonts.

Last edited by Stalafin (2014-06-22 12:55:55)

Offline

#189 2014-07-10 21:56:44

Ploppz
Member
Registered: 2013-09-14
Posts: 311

Re: bar - Lightweight xcb-based bar

TheLemonMan wrote:

Ploppz, can you please try this branch ? I've tested it for a couple of minutes and seemed to render all the colors perfectly now smile

Sorry, didn't see your post before now. Unfortunately, it still doesn't work:

rxgxqd.png

The white square is where the "test" text would be if it wasn't for the background, which seemingly gets interpreted as full white colour (the foreground is white).

Anyway, it's not that crucial for me

Last edited by Ploppz (2014-07-10 22:08:44)

Offline

#190 2014-07-24 08:57:12

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

In case someone was wondering, there's some good support for smoothed fonts too smile

Offline

#191 2014-07-25 17:14:24

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: bar - Lightweight xcb-based bar

TheLemonMan wrote:

In case someone was wondering, there's some good support for smoothed fonts too smile

Thanks a lot! But… How do I set the font name and size? I tried the -f argument, but I don't know how to make it use something other than the default font.

Offline

#192 2014-07-25 17:21:41

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

The -f switch selects the font, I still have to make the font width configurable and re-add some little things I brutally stripped out

Offline

#193 2014-07-25 22:29:53

tb01110100
Member
From: Hoosierland
Registered: 2012-12-25
Posts: 42

Re: bar - Lightweight xcb-based bar

Hey, TheLemonMan. Bar is great, I love it. However, I was wondering if there's any particular reason why you won't/can't add xft support? Thanks.

Offline

#194 2014-07-26 08:44:31

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: bar - Lightweight xcb-based bar

tb01110100 wrote:

Hey, TheLemonMan. Bar is great, I love it. However, I was wondering if there's any particular reason why you won't/can't add xft support? Thanks.

…but he just did?

Offline

#195 2014-07-27 18:49:06

tb01110100
Member
From: Hoosierland
Registered: 2012-12-25
Posts: 42

Re: bar - Lightweight xcb-based bar

Oh. Derp tongue Didn't read back. Thanks, @TheLemonMan!

Offline

#196 2014-07-29 14:25:11

tb01110100
Member
From: Hoosierland
Registered: 2012-12-25
Posts: 42

Re: bar - Lightweight xcb-based bar

Am I doing something wrong? Is my knowledge of fonts flawed? I'm trying to use "droid sans mono 14" as the font. Here's a scrot: http://i.imgur.com/4UoaTUT.png

Offline

#197 2014-08-03 05:02:56

sie
Member
From: Latvia
Registered: 2010-06-30
Posts: 33

Re: bar - Lightweight xcb-based bar

I wrote a patch for bar that prints enter/leave mouse events, if anyone wants it.

My usecase for it is stored and described here, but I basically use it to switch from window title to buttons.

Maybe this is of use to someone.

Last edited by sie (2014-08-03 05:11:42)


a &

Offline

#198 2014-08-03 09:04:50

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: bar - Lightweight xcb-based bar

tb01110100 wrote:

Am I doing something wrong? Is my knowledge of fonts flawed? I'm trying to use "droid sans mono 14" as the font. Here's a scrot: http://i.imgur.com/4UoaTUT.png

As far as I'm aware, choosing font sizes with Xft doesn't work (yet).

Offline

#199 2014-08-03 17:09:48

Vixus
Member
Registered: 2012-11-02
Posts: 60

Re: bar - Lightweight xcb-based bar

Why is there a difference in bar height when there is a vertical offset?

No offset:
KWZC5XA.png

Offset:
99Z5AkX.png

Offline

#200 2014-08-08 11:20:46

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

Re: the font size can't be set atm in the cairo-love branch.
Re: Vixus, could you please open an issue on github including a minimal test-case ?

Offline

Board footer

Powered by FluxBB