You are not logged in.
while sleep 2 do echo -n "\l\f3\u3$(mpc current) \c\f5\u5$(date)" done | $HOME/bin/bar-bottom/bar -p &
Your solution works.
But i get a warning with my full script:
#!/bin/bash
while true ; do
if [ $(ssh tauron -q -t 'bash -c "pgrep mpdscribble"') ]
then
lastfm=enabled
else
lastfm=disabled
fi
echo -n "\l\f1\u3$(mpc current) \r\f1\u4$(echo "lastfm scrobbling: $lastfm") \c\f1\u5$(date +"%H:%M - %a, %d. %b")"
done | $HOME/bin/bar-bottom/./bar -p &
i am getting this:
carnager@caprica ~ % ./test
carnager@caprica ~ % tcsetattr: Input/output error
I just redirected 2> for now, but i am wondering why i am getting this
Last edited by Rasi (2013-07-09 19:52:11)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
That should be coming from your terminal; not related to bar itself.
I am guessing ssh (the '-t' switch) is causing that.
Note that '[' is a command, and it expects a single argument,
thus you should be quoting the ssh command.
Also, you're testing for an empty string, I'm guessing, so use '-n' or '-z'
...
if [ -n "$(ssh tauron -q -t 'bash -c "pgrep mpdscribble"')" ]
...
The script is not using any bash features, so you can also turn the shebang to '#!/bin/sh'
Last edited by c00kiemon5ter (2013-07-09 20:03:27)
.:[ git me! ] :.
Offline
sadly i still have issues, this time it seems to be bar related tho.
cant explain it really. but the script above results in this:
http://53280.de/vid/20130709222213.webm
have a look how the items in the lower bar change every couple of seconds. really odd.
Last edited by Rasi (2013-07-09 20:23:41)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
right, i had to add an empty echo afterwards. FIXED
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
try this:
#!/bin/sh
while sleep 2; do
if [ "$(ssh tauron -q -t 'sh -c "pgrep mpdscribble"')" ]
then lastfm=enabled
else lastfm=disabled
fi
echo "\l\f1\u3$(mpc current) \r\f1\u4lastfm scrobbling: $lastfm \c\f1\u5$(date +"%H:%M - %a, %d. %b")"
done | $HOME/bin/bar-bottom/bar &
and try the same without '-t' in the ssh command, to see if the previous error is fixed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
it is not that you had to add an empty echo; it is that you don't need '-n' in echo anyway.
you also don't need '-p' in bar.
Last edited by c00kiemon5ter (2013-07-09 20:40:39)
.:[ git me! ] :.
Offline
Does anyone know what the dependencies are on ubuntu based distro's? I can't seem to build it even though xcb is installed.
Here's the output of make:
┌─[tingol][sleek][~/bar]
└──╼ make
cc -lxcb -o bar bar.o
bar.o: In function `xcb_fill_rect':
bar.c:(.text+0x53): undefined reference to `xcb_poly_fill_rectangle'
bar.o: In function `cleanup':
bar.c:(.text+0x78): undefined reference to `xcb_close_font'
bar.c:(.text+0x95): undefined reference to `xcb_close_font'
bar.c:(.text+0xb2): undefined reference to `xcb_free_pixmap'
bar.c:(.text+0xcf): undefined reference to `xcb_destroy_window'
bar.c:(.text+0xec): undefined reference to `xcb_free_gc'
bar.c:(.text+0x109): undefined reference to `xcb_free_gc'
bar.c:(.text+0x126): undefined reference to `xcb_free_gc'
bar.c:(.text+0x13b): undefined reference to `xcb_disconnect'
bar.o: In function `xcb_set_fontset':
bar.c:(.text+0x184): undefined reference to `xcb_change_gc'
bar.o: In function `draw_char':
bar.c:(.text+0x238): undefined reference to `xcb_copy_area'
bar.c:(.text+0x284): undefined reference to `xcb_copy_area'
bar.c:(.text+0x2e9): undefined reference to `xcb_image_text_16'
bar.o: In function `parse':
bar.c:(.text+0x464): undefined reference to `xcb_change_gc'
bar.c:(.text+0x482): undefined reference to `xcb_change_gc'
bar.c:(.text+0x4cf): undefined reference to `xcb_change_gc'
bar.o: In function `font_load':
bar.c:(.text+0x5e2): undefined reference to `xcb_generate_id'
bar.c:(.text+0x60d): undefined reference to `xcb_open_font_checked'
bar.c:(.text+0x61c): undefined reference to `xcb_request_check'
bar.c:(.text+0x65b): undefined reference to `xcb_query_font'
bar.c:(.text+0x66d): undefined reference to `xcb_query_font_reply'
bar.c:(.text+0x681): undefined reference to `xcb_query_font_char_infos'
bar.o: In function `set_ewmh_atoms':
bar.c:(.text+0x722): undefined reference to `xcb_intern_atom'
bar.c:(.text+0x73a): undefined reference to `xcb_intern_atom'
bar.c:(.text+0x755): undefined reference to `xcb_intern_atom'
bar.c:(.text+0x76d): undefined reference to `xcb_intern_atom'
bar.c:(.text+0x788): undefined reference to `xcb_intern_atom'
bar.c:(.text+0x79c): undefined reference to `xcb_intern_atom_reply'
bar.c:(.text+0x7be): undefined reference to `xcb_intern_atom_reply'
bar.c:(.text+0x7df): undefined reference to `xcb_intern_atom_reply'
bar.c:(.text+0x800): undefined reference to `xcb_intern_atom_reply'
bar.c:(.text+0x821): undefined reference to `xcb_intern_atom_reply'
bar.c:(.text+0x84f): undefined reference to `xcb_get_property'
bar.c:(.text+0x865): undefined reference to `xcb_get_property_reply'
bar.c:(.text+0x873): undefined reference to `xcb_get_property_value'
bar.c:(.text+0x8a7): undefined reference to `xcb_change_property'
bar.c:(.text+0x8db): undefined reference to `xcb_change_property'
bar.c:(.text+0x92d): undefined reference to `xcb_change_property'
bar.c:(.text+0x961): undefined reference to `xcb_get_property_value_end'
bar.o: In function `init':
bar.c:(.text+0x989): undefined reference to `xcb_connect'
bar.c:(.text+0x996): undefined reference to `xcb_connection_has_error'
bar.c:(.text+0x9c1): undefined reference to `xcb_get_setup'
bar.c:(.text+0x9cd): undefined reference to `xcb_setup_roots_iterator'
bar.c:(.text+0xa34): undefined reference to `xcb_generate_id'
bar.c:(.text+0xa7a): undefined reference to `xcb_create_window'
bar.c:(.text+0xaab): undefined reference to `xcb_change_window_attributes'
bar.c:(.text+0xab6): undefined reference to `xcb_generate_id'
bar.c:(.text+0xadb): undefined reference to `xcb_create_pixmap'
bar.c:(.text+0xae6): undefined reference to `xcb_generate_id'
bar.c:(.text+0xb10): undefined reference to `xcb_create_gc'
bar.c:(.text+0xb1b): undefined reference to `xcb_generate_id'
bar.c:(.text+0xb3e): undefined reference to `xcb_create_gc'
bar.c:(.text+0xb49): undefined reference to `xcb_generate_id'
bar.c:(.text+0xb6c): undefined reference to `xcb_create_gc'
bar.c:(.text+0xb80): undefined reference to `xcb_map_window'
bar.c:(.text+0xba5): undefined reference to `xcb_configure_window'
bar.c:(.text+0xbb3): undefined reference to `xcb_flush'
bar.o: In function `main':
bar.c:(.text.startup+0xf4): undefined reference to `xcb_get_file_descriptor'
bar.c:(.text.startup+0x1b8): undefined reference to `xcb_poll_for_event'
bar.c:(.text.startup+0x1f4): undefined reference to `xcb_copy_area'
bar.c:(.text.startup+0x205): undefined reference to `xcb_flush'
collect2: error: ld returned 1 exit status
make: *** [bar] Error 1
Offline
A wild guess, something like libxcb1-dev?
Yeah, that's what I thought, it's installed but the errors persist.
Offline
Offline
man..i just cant get this to work at all keep getting cannot load font, even after useing xset, fc-cache and placing them even in .xinitrc, it still wont load at all. and i have terminus installed
what i cannot build, i do not understand
Offline
Today I've found some time to rework the EWMH handling and we got cleaner code and transparency support for free \o/
Since the default docking method now is the EWMH one and most of the tiling wm out there don't support it (aww) you might need to start bar with the -f switch.
Offline
I've encountered some sort of bug with termite+bar+weechat, when I get an urgency hint from the desktop with weechat on it, even though I switch to it the urgency remains untill I move the terminal in question to a different desktop and then back...
Offline
Monsterwm, you were right, it was
Offline
man..i just cant get this to work at all keep getting cannot load font, even after useing xset, fc-cache and placing them even in .xinitrc, it still wont load at all. and i have terminus installed
There's a bug in the terminus package which still hasen't been fixed for some reason, even though it was reported almost 4 month ago...
To fix, run:
sudo mkfontscale /usr/share/fonts/local
sudo mkfontsdir /usr/share/fonts/local
(The terminus package's install file runs the above commands on the wrong dir!)
And then of course you need 'xset +fp /usr/share/fonts/local' in your .xinitrc file(the 'xset fp rehash' isn't needed, btw...).
This bug only affects people which haven't had terminus installed for a long time allready, as those commands would have then been run previously...
Last edited by mhertz (2013-09-10 23:26:27)
Offline
I just started using bspwm in combination with bar. It is really quite nice.
Just so you know, the bar-aint-recursive AUR package has an outdated PKGBUILD. I fixed it up: http://ix.io/7ZE Though I think it might be good to have dwm style config.h integration… but at least my changes make it handle the git stuff properly.
Edit: Whoops, there is a bar-aint-recursive-git that I apparently skipped over which is right. Sorry for the noise.
Last edited by WonderWoofy (2013-09-12 07:58:59)
Offline
I also stumbled over bar when configuring bspwm. It seems like a very nice bar indeed, but it causes quite the CPU load: since starting X, it has not gone below 95% CPU ressources (as reported by top).
Using aur/bar-aint-recursive, any idea what could be going on there? This is the config, essentially a carbon-copy of the configuration provided with the bspwm sources:
#! /bin/sh
#
# Example panel for LemonBoy's bar
while read -r line ; do
case $line in
S*)
sys_infos="\\r\\f5${line#?}\\fr"
;;
T*)
title="\\c${line#?}"
;;
W*)
wm_infos=""
IFS=':'
set -- ${line#?}
while [ $# -gt 0 ] ; do
item=$1
name=${item#?}
case $item in
[OFU]*)
# active desktop
wm_infos="$wm_infos \\u5\\b2\\f9${name}\\fr\\br\\ur"
;;
o*)
# inactive but occupied desktop
wm_infos="$wm_infos \\f7${name}\\fr"
;;
f*)
# inactive desktop
wm_infos="$wm_infos ${name}"
;;
u*)
# urgent desktop
wm_infos="$wm_infos \\b3\\f0${name}\\fr\\br"
;;
L*)
# layout
layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/')
wm_infos="$wm_infos \\b4\\f0$layout\\br\\fr"
;;
esac
shift
done
;;
esac
printf "%s\n" "$wm_infos $title $sys_infos"
done
EDIT: Okay, turns out that the high CPU load was caused by instances of bar which should have been killed, but weren't for some reason. Not sure why they are not being killed, but the problem seems to be with one of the scripts used to start bar.
Last edited by Stalafin (2013-09-18 15:51:04)
Offline
I also stumbled over bar when configuring bspwm. It seems like a very nice bar indeed, but it causes quite the CPU load: since starting X, it has not gone below 95% CPU ressources (as reported by top).
What? I am using bar as well, and it does not do this at all. I think there must be something wrong with your setup. I did notice that because bspwm (until a couple days ago) would not kill the bar or dzen2 that if I logged out and then reran startx, I would get another instance of bar and the scripts running and feeding them info. In that case it would indeed start chewing up CPU, but it was justa matter of killing the old one and the issue was solved.
Bakersville/bloom has added a trap into the panel script in order to ensure the killing of the bar and whatnot when bspwm exits. He has included it in the examples. You might want to check that out if you haven't perused them in the last couple of days.
Also, you should use bar-aint-recursive-git, as it does a better job allowing for a customized config.h and uses the pacman 4.1 git functionality instead of downloading the sources manually in the build() function.
Edit: You should be aware though that the bar-aint-recursive-git package changes the name of the bar binary to bar-aint-recursive so that it will not conflict with something in community (which I don't use). So if you want to keep the name "bar" for the binary, you can just comment out the line that does that in the package() function.
Last edited by WonderWoofy (2013-09-18 15:51:46)
Offline
Stalafin wrote:I also stumbled over bar when configuring bspwm. It seems like a very nice bar indeed, but it causes quite the CPU load: since starting X, it has not gone below 95% CPU ressources (as reported by top).
What? I am using bar as well, and it does not do this at all. I think there must be something wrong with your setup. I did notice that because bspwm (until a couple days ago) would not kill the bar or dzen2 that if I logged out and then reran startx, I would get another instance of bar and the scripts running and feeding them info. In that case it would indeed start chewing up CPU, but it was justa matter of killing the old one and the issue was solved.
Bakersville/bloom has added a trap into the panel script in order to ensure the killing of the bar and whatnot when bspwm exits. He has included it in the examples. You might want to check that out if you haven't perused them in the last couple of days.
Also, you should use bar-aint-recursive-git, as it does a better job allowing for a customized config.h and uses the pacman 4.1 git functionality instead of downloading the sources manually in the build() function.
Edit: You should be aware though that the bar-aint-recursive-git package changes the name of the bar binary to bar-aint-recursive so that it will not conflict with something in community (which I don't use). So if you want to keep the name "bar" for the binary, you can just comment out the line that does that in the package() function.
Thanks for the reply. I think my edit and your answer clashed, unfortunately. I did indeed notice that the binary was renamed to “bar-aint-recursive” and changed the scripts accordingly. Nuttin' happened otherwise.
Now, it looks like bar-aint-recursive simply doesn't shut down, but I don't know why. I have to admit, I don't quite understand this script, in particular what the “trap” and “wait” commands do at the beginning and the end, respectively.
#! /bin/sh
trap 'trap - term; kill 0' int term quit exit
flavor=${1:-bar}
bspc config top_padding $panel_height
bspc control --put-status
xtitle -sf 't%s' > "$panel_fifo" &
clock -sf 's%a %h:%m' > "$panel_fifo" &
case "$flavor" in
bar)
cat "$panel_fifo" | panel_bar | bar-aint-recursive &
;;
dzen2)
. panel_colors
font_family='dejavu sans'
font_size=11
cat "$panel_fifo" | panel_dzen2 -f "$font_family" -s "$font_size" | dzen2 -h $panel_height -dock -ta l -title-name panel -fn "${font_family}:pixelsize=${font_size}" -fg "$color_foreground" -bg "$color_background" &
;;
esac
wait
EDIT: As this has nothing to do with bar-aint-recursive, I am taking this to the appropriate bspwm-thread [1]. Sorry about the off-topic discussion.
1: https://bbs.archlinux.org/viewtopic.php … 9#p1326259
Last edited by Stalafin (2013-09-18 16:23:24)
Offline
Really nice one! Using it now under Debian. :-) I'm trying to figure out if it's possible to set it's x11-geometry. And it will also very cool if there where support for \n(ewlines). That would be a libxcb-conky-messaging-bar-suppaduppa-app. Hehe. Small problem, in monocle-mode under dwm and bar fills the whole screen.
Sry. for bad english and thanks for great app.
Regards!
Offline
It's possible to set the geometry as in top/bottom and width, it's a bar after all heh. Did you start bar with the -f option ? Since a couple of commits ago it's necessary with WM that don't support EWMH hints.
Offline
Hi,
Sorry to bother for something I think is fairly trivial, but I haven't found any answer after a few hours of search.
The bar loads just fine (with BSPWM) when I start my session with startx or xinit; but when I start it with SLiM, it doesn't work and I get "can't load font: ...", even though this font is correctly loaded with startx. I don't get it at all, my font dirs are all configured and set up with xset +fp and I can use them just fine in other applications (even in a session started with SLiM), but for bar, it doesn't load
Note that there's something stranger: the error says bar can't load the font, and shows me an incorrect use of this font (there's too many "-*-" in the xfontsel name ), although the correct form is used in the bar binary and after re-compil; it seems as if, when started with SLiM, bar tries to use an older config (where I certainly put this wrong name myself by mistake) which doesn't exist anymore (since it loads fine with startx) (or else SLiM makes bar add this "-*-" itself, but that doesn't make any sense, huhuhu).
Thanks for help
Offline
Hrm, doublecheck the paths and try deleting the binary with the wrong configuration and see if any errors show up.
bar isn't different from other apps so if the fonts get loaded by other apps the problem is in something you do oh, and try posting the config.h
Offline