nixers
Statusbar with icons for spectrwm - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Operating Systems (https://nixers.net/forumdisplay.php?fid=4)
+--- Forum: BSD (https://nixers.net/forumdisplay.php?fid=13)
+--- Thread: Statusbar with icons for spectrwm (/showthread.php?tid=1834)
Pages: 1 2


Statusbar with icons for spectrwm - nopc0de - 05-01-2016

Hey folks,

Do any of you have a statusbar with icons working with spectrwm?

I tried using spectrwm's status_bar with conky.
I tried using conky | dzen2
I tried using xmobar

In none of those I can get icons working. I tried using the siji font and FontAwesome font.

I can see all the siji fonts using xfd (both with the FontStruct format and xft format).
xfd -fa siji = works
xfd -fn -wuncon-siji-.. = works

But my terminals and bars show white squares...

If I set the font to siji on dzen2, I get icons but no text.
Do I need to run multiple dzen2 instances? One for every icon? (That sounds terrible workaround).

Thanks in advance


RE: Statusbar with icons for spectrwm - Wildefyr - 05-01-2016

Try lemonbar, you'll need the xft patch though.


RE: Statusbar with icons for spectrwm - neeasade - 05-01-2016

>If I set the font to siji on dzen2, I get icons but no text.

weird, I just set the default text font for dzen2, and then echo icons in whatever scripts I'm sending to it (font awesome though). It's been falling back/resolving them well enough so far.


RE: Statusbar with icons for spectrwm - z3bra - 06-01-2016

You can't use a font like siji with dzen2. dzen2 only supports one font, and XBM icons, so that's how you're supposed to get icons working.
On the other hand, lemonbar supports "fallback fonts" which lets you specify multiple fonts, so that if the first one doesn't include a glyph, it then uses the second one to display it. You can use this hack to get icons in your bar, by using, eg, siji as a fallback font.
URxvt uses the same mechanism.


RE: Statusbar with icons for spectrwm - neeasade - 06-01-2016

(06-01-2016, 06:38 AM)z3bra Wrote: You can't use a font like siji with dzen2. dzen2 only supports one font, and XBM icons, so that's how you're supposed to get icons working.
On the other hand, lemonbar supports "fallback fonts" which lets you specify multiple fonts, so that if the first one doesn't include a glyph, it then uses the second one to display it. You can use this hack to get icons in your bar, by using, eg, siji as a fallback font.
URxvt uses the same mechanism.

note that you can define an icon font inline if you want, I checked what I was doing: https://github.com/neeasade/dotfiles/blob/3bf03aa132b355ccf32742d952ddbeabca606ae8/bspwm/.config/bspwm/panel/dzen.sh#L58

edit: or would this not work because siji is only available in bdf/pcf?


RE: Statusbar with icons for spectrwm - z3bra - 06-01-2016

Ah, I forgot this part. I didn't check though, but this should work in theory


RE: Statusbar with icons for spectrwm - nopc0de - 06-01-2016

This is doing my head in

I tried defining the font inline (following neeasade's example) with no avail.
^fn(FontAwesome-10) -> dzen: error, cannot load font: 'FontAwesome-10' (it loads in xfd)
^fn(-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1) -> Works if I only use icons (As soon as I add text, the icons disappear)

I also tried to merge 2 BDF fonts (Siji+gohu) but for some reason the gohu chars take the width of the siji glyphs. I have no idea why and I think it its a bug in X11/OpenBSD.

Lemonbar doesn't compile on OpenBSD, and I don't have to skills to patch lemonbar to make it work.

hours wasted...


RE: Statusbar with icons for spectrwm - neeasade - 06-01-2016

(06-01-2016, 03:15 PM)nopc0de Wrote: ^fn(-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1) -> Works if I only use icons (As soon as I add text, the icons disappear)
you wrap _only_ the icons with that ^fn() syntax (you might be doing this just doesn't appear from your post) - my link was a function wrapper for one icon. example:

Code:
^fn(-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1) icon from siji here ^() text to be displayed (font will be from launch -fn flag)

unsure on your font awesome not working, but here's a tip on compiling lemonbar in openbsd(unsure if relevant): https://nixers.net/showthread.php?tid=1328


RE: Statusbar with icons for spectrwm - nopc0de - 06-01-2016

Yea, this is the script I pipe to dzen2: http://ix.io/neb (I also tried with ^fn())
It shows a blank bar.

Compiling lemonbar gives the following:
lemonbar.c:51: warning: declaration does not declare anything
lemonbar.c: In function 'fill_gradient':
lemonbar.c:116: error: 'rgba_t' has no member named 'r'

I don't know how to fix that, I can't write C.

Thanks for helping me btw


UPDATE:

I was able to compile lemonbar on openbsd with the following command:
LDFLAGS="-L/usr/X11R6/lib/" CFLAGS="-I/usr/X11R6/include/" CC=egcc gmake

(requires pkg_add xcb gcc)


RE: Statusbar with icons for spectrwm - neeasade - 06-01-2016

(06-01-2016, 04:58 PM)nopc0de Wrote: (I also tried with ^fn())

so you tried like so?:
Code:
#!/usr/local/bin/bash

echo -n '^fn(-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1)'
echo -e -n '\ue0a0'
echo -n '^fn()'
echo -n '^fn(-xos4-terminus-medium-r-normal--12-120-72-72-c-60-iso10646-1)'
echo -n ' = pacman'
echo -n '^fn()'
(sorry not currently in a place to test things)

sweet for the lemonbar update :)