Comments (12)
Commit 3c1944e introduced read-blocking blocks. You can create a block that reads your FIFO line by line using a simple shell read
loop.
[readfifo]
command=while :; do read line </tmp/myfifo ; echo "read: $line"; done
interval=persist
from i3blocks.
okay, thanks.. I wasn't in the git version.. that addition only calls for a new tagged release in my opinion.
great work btw, this solves all my i3bar problems
from i3blocks.
Great to read this! @8carlosf indeed I'll make a release soon. Thanks @zopieux for the snippet. I'm closing this issue ;-)
from i3blocks.
So now you know this persist feature is useful to people, if not myself, @vivien ;-)
from i3blocks.
just for reference..
[title]
color=#0088CC
command=xtitle -s
min_width=300
align=center
interval=persist
this is the final version of the title bar..
it uses https://github.com/baskerville/xtitle
from i3blocks.
That's great thanks! Feel free to add it as another example, if you want to: https://github.com/vivien/i3blocks/wiki/Blocklets#focused-window
from i3blocks.
done, also added an i3lock shortcut using the mouse click, I think it is a great example of mouse click usage... please check it out and see if it is all okay..
from i3blocks.
Great!
Note, since you added a full_text
, no need for an interval. Also, the bash line can be simplified:
[i3lock]
full_text=i3lock
color=#ffd700
command=test $BLOCK_BUTTON -eq 1 && i3lock -du -c 222222
from i3blocks.
of course, test :) it's prettier for sure.
how can I set a command and a click action without doing that mess? that would be great..
for example, I tried to open htop when I click on the CPU usage stat, but until I close the htop window, i3bar doesn't refresh :/
it would be great if we had something like
onclick_1=command
and onclick=command (if the button number isn't important)
from i3blocks.
The button number is in fact important (right, left, middle clicks and wheel up, down). The actual way is simpler. Either we deal with it in bash, e.g.:
#!/bin/bash
case $BLOCK_BUTTON in
1) left_click ;;
2) middle_click ;;
3) right_click ;;
4) wheel_up ;;
5) wheel_down ;;
esac
do_this_anyway
exit
or if you want to wrap an existing block, i.e. the default CPU usage to trigger htop:
[cpu_usage]
command=test BLOCK_BUTTON -eq 1 && i3-sensible-terminal -e htop || $SCRIPT_DIR/$BLOCK_NAME
label=CPU
interval=10
min_width=CPU: 100.00%
(See #82 for a similar question)
from i3blocks.
I tried that (the secound option).. the problem is, if I click the block button the terminal comes up, but the block stays on hold, this meaning that the block will refresh until you close the terminal.
I would like to open a htop and 'free' the block. I tried using nohup and & in the end, but it also didn't work.
from i3blocks.
This depends on your terminal. For instance, gnome-terminal
doesn't block and returns right away. This means that test BLOCK_BUTTON -eq 1 && gnome-terminal -e htop || $SCRIPT_DIR/$BLOCK_NAME
shouldn't freeze the bar.
from i3blocks.
Related Issues (20)
- Persistent command does not actually persist HOT 3
- How do I tell i3blocks to refresh all blocks? HOT 2
- block freezing my status bar HOT 2
- battery regexp breaks with two batteries HOT 1
- `autogen.sh` Generates a `configure` File that Tries to Call Autoconf macro `PKG_CHECK_MODULES` HOT 1
- [Feature Request] Add ticker support
- I'm having trouble getting fixed-width strings to work on i3blocks. HOT 1
- Block's character will turn into "[" character after clicked and turn normal after sway is reloaded. HOT 1
- Can't use the config variable when running the script using i3-msg -q exec myscript HOT 4
- Simple way to display title of focused window in i3blocks HOT 2
- i3blocks does not show anything except datetime HOT 3
- dmenu hang when called from i3blocks with -fn option
- Battery regex in example doesn't handle 100% HOT 2
- Trouble with setting a label with emoji via the json format HOT 1
- Any script with a 'for' loop doesn't produce any output
- How to get back monochrome icons / emojis? Weird font issue!
- Question: is running a secondary command when clicking a button with an interval possible? HOT 1
- Change the color of borders from within a script
- If I launch a graphical program from a block and restart i3, the program dies even if disowned. HOT 2
- malformated line again HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3blocks.