nerdbar.widget icon indicating copy to clipboard operation
nerdbar.widget copied to clipboard

fonts arent showing

Open eambutu opened this issue 7 years ago • 1 comments

Awesome bar! Could you elaborate on how to get font awesome to work? I've installed it and dropped it into the fontbook, and it seems like it installed correctly (if i go into textedit and change the font to font awesome, and type "question-circle", it will show the icon). No matter what I try, all the icons on the bars display as squares.

eambutu avatar Oct 05 '18 21:10 eambutu

This version still uses an older version of Font Awesome. To use the newer version add this to colors.css:

.bicon {
    position: relative;
    top: 1px;
    font: 14px FontAwesome5BrandsRegular;
}
.ricon {
    position: relative;
    top: 1px;
    font: 14px FontAwesome5FreeRegular;
}
.icon {
    position: relative;
    top: 1px;
    font: 14px FontAwesome5FreeSolid;
}

The new font awesome has a few different versions: solid, regular, and brand icons. To use the new ones you can go through the .coffee files and copy-paste the icons you want out of Font Book to replace the old ones currently there. Then make sure that the class for that part of the widget is referring to the right font. For example, to change the stats.coffee cpu icon you would go into the .coffee file and change

getCPU: (cpu) ->
  cpuNum = parseFloat(cpu)
  # I have four cores, so I divide my CPU percentage by four to get the proper number
  cpuNum = cpuNum/4
  cpuNum = cpuNum.toFixed(1)
  cpuString = String(cpuNum)
  if cpuNum < 10
    cpuString = '0' + cpuString
  return "<span class='icon'>&nbsp</span>" +
         "<span class='white'>#{cpuString}%</span>"

to:

getCPU: (cpu) ->
  cpuNum = parseFloat(cpu)
  # I have four cores, so I divide my CPU percentage by four to get the proper number
  cpuNum = cpuNum/4
  cpuNum = cpuNum.toFixed(1)
  cpuString = String(cpuNum)
  if cpuNum < 10
    cpuString = '0' + cpuString
  return "<span class='ricon'>&nbsp</span>" +
         "<span class='white'>#{cpuString}%</span>"

Since KWM isn't really developed anymore I don't much work on these bars. Chunkbar still gets updated from time to time and is designed to work with ChunkWM and the latest Font Awesome so you can also use that as a reference if you need more help to update Nerdbar.

apierz avatar Oct 11 '18 14:10 apierz