Quantcast
Viewing latest article 15
Browse Latest Browse All 17

i3blocks.conf create onclick event (open firefox with URL)

I have this block in /etc/i3blocks.conf

[rss]command=rsstail -n1 -1 -N -u https://news.ycombinator.com/rss | iconv -f UTF-8 -t ASCII//TRANSLIT | head -c 50color=#00FF00interval=300

I'd like to click on this block and open firefox with the correct URL.

Here is a block that opens firefox with URL.

[clickme]align=centerfull_text=Click me!command=/usr/bin/firefox --new-tab https://www.stackexchange.com/

I don't know how to combine it together. Here is a documentation.

Here is how to get a link:

rsstail -l -n1 -1 -N -u https://news.ycombinator.com/rss | sed -n 2p

I probably will need to save a link of rsstail to some "block variable" and than use it in the command.

So far, I have this solution:

[rss]command=rsstail -n1 -1 -N -u https://news.ycombinator.com/rss | iconv -f UTF-8 -t ASCII//TRANSLIT # | head -c 40color=#00FF00interval=300[clickme]align=centerfull_text=*command=firefox --new-tab `rsstail -l -n1 -1 -N -u https://news.ycombinator.com/rss | sed -n 2p`

It opens the link, when I click *. So, I'm not clicking on the title, but on the * next to the title. But the link may not be associated with the title, and this is what I don't want. I need to pass the link to some kind of variable (e.g. block variable or environment variable, whatever possible).


Viewing latest article 15
Browse Latest Browse All 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>