LemonBoy / bar

A featherweight, lemon-scented, bar based on xcb
MIT License
1.61k stars 194 forks source link

Launchers and .svg/.png icons #218

Closed jlj2 closed 3 years ago

jlj2 commented 5 years ago
  1. Are application launchers possible in lemonbar; in other words, integrating a 'docky'-style section in lemonbar?
  2. If so, could the lemonbar launcher icons be of types .svg, .png, etc.?

Having searched on the internet re using .svg/.png style icons over font symbols (e.g. Fontawesome) in lemonbar particularly, the only hints I could find were as follows:-

https://github.com/LemonBoy/bar/pull/96

https://forums.bunsenlabs.org/viewtopic.php?id=2463

If possible, could sample code for these launchers please be spelled out? Hopefully, the code would contain a line demonstrating where an .svg/.png file would appear (or even a .desktop file, which contains a reference to a .svg/.png-type icon).

Many thanks in advance!

domsson commented 4 years ago
  1. yes
  2. no

What you're looking for is the %{A} format option. Example:

echo "%{A:xclock:}Clock%{A}" | lemonbar -p

Now, when you click the "Clock" text, lemonbar will print xclock to stdout, which enables you to run that by whatever means suit your needs.

Combine that with a font that contains nice icons, like siji and you can create pretty decent results.