i3blocks icon indicating copy to clipboard operation
i3blocks copied to clipboard

Indicators stopped working

Open qazip opened this issue 6 years ago • 7 comments

My volume/cpu/internet indicators dissapeared ever since I updated i3blocks. The reason for that the location of the files changed. For example, the volume one is no longer in "command=/usr/lib/i3blocks/volume". Where is it now?

qazip avatar Sep 08 '19 12:09 qazip

OS: Arch Linux i3blocks: 1.5

This is what happened to me to. I am not sure if this is i3blocks or Arch related.

I have this on top of my config: command=/usr/lib/i3blocks/$BLOCK_NAME

but this directory no longer exist. Is this a packaging issue?

ghost avatar Sep 08 '19 13:09 ghost

@qazip @geekdima as you can see on the official documentation https://vivien.github.io/i3blocks/#_getting_started

The project’s repository does not include default scripts anymore.

you can update your configuration file and use i3blocks-contribs located here https://github.com/vivien/i3blocks-contrib

putchar avatar Sep 08 '19 13:09 putchar

The project’s repository does not include default scripts anymore.

I think that's only part of the issue, because I don't even use any of the default scripts provided and still, some of my custom scripts stopped working. They work correctly when executed from the terminal, but for some reason there's no output in the statusbar.

Anybody got the same problem?

JadowityHerbatnik avatar Sep 08 '19 17:09 JadowityHerbatnik

Same issue here. It seems to be related to the Pango markup. All my custom block scripts except for one use Pango markup. Only the one not using Pango markup is working correctly now after the update. When executing i3blocks from the terminal it also shows only the one without Pango. All the scripts executed independently work fine and return the correct Pango syntax.

I'm using the Source Code Pro font with Font Awesome 5 for icons in the bar. But since it's also not working from the terminal, I guess fonts are not the issue here.

EDIT: Example of a short script that worked before the update but doesn't work now (works with Arch using the checkupdates command that pacman-contrib provides).

count=$(checkupdates | wc -l)

icon=" "
color="#81A1C1"

printf "<span color='%s'>%s%s</span>" "$color" "$icon" "$count"

EDIT2: Ok, nevermind. My issue wasn't related to Pango markup. But all the scripts where I use Pango markup also use printf and there was the problem. The issue was that there was no newline at the end of the output of the missing blocks. Before the update missing newlines caused no issues at all. But now the blocks don't show up without these newlines.

0x4c47 avatar Sep 08 '19 18:09 0x4c47

Awesome! Indeed, all of the broken scripts were missing newlines at the end of the output. One more issue I have however is that whenever a script gives an empty output, the bar still shows the icon/label (well, I guess it treats the new line character itself as a fully-fledged output).

I'm trying to think of some elegant way of fixing this other than just adding an if statement to every script to remove the new line character if the output doesn't contain anything else besides it.

JadowityHerbatnik avatar Sep 08 '19 19:09 JadowityHerbatnik

Try cloning the blocks into your homedir and updating the config:

command=/home/mynamehere/.config/i3blocks/$BLOCK_NAME/$BLOCK_NAME

sysfsss avatar Sep 10 '19 22:09 sysfsss

Is there any reason why the default scripts are not included anymore? Is there a chance that they will reappear?

vcahlik avatar Oct 15 '19 10:10 vcahlik

Indeed as of i3blocks 1.5, the default scripts were moved to i3blocks-contrib because it was hard to maintain. Sorry for the inconvenience.

Currently the commands can be relative to their config file, so you can have a folder for blocks (e.g. i3blocks-contrib) and use the -c option to point to its root config file (or you can have your blocks in ~/.config/i3blocks/ and let the program use the default ~/.i3blocks/config file).

That was just enough until one wants to use blocks from different directory trees, e.g. picking a single block from the contrib repository. For this I've implemented an include directive in the next branch, which might help to package complete status bars or even a single block and allow to specify include=/usr/lib/i3blocks/config or include=~/src/crazyblock/config from a user or system-wide configuration file. I'm not sure yet this is a must have feature so I'll keep it in next for now.

vivien avatar Dec 15 '22 17:12 vivien