Comments (9)
@vivien, I can't seem to work xtitle -s
on my i3blocks. When my focused window is st
is works ok. But otherwise, it doesn't output anything, not even the label.
from i3blocks.
This might be related but the following blocklet does not work.
[focused window]
command=xtitle -s
interval=persist
from i3blocks.
[Title]
command=xdotool getactivewindow getwindowname 2> /dev/null || echo "None"
interval=1
I tried this and it worked just fine, way better than xtitle
, I use interval=1
'cause persist
does not work and repeat
is killing the processor.
from i3blocks.
I updated the wiki with your suggestion. Feel free to do so ;-)
For this, it'd be great to have a Perl script to connect on the IPC socket and wait indefinitely for focus updates, in a blocklet with interval=persist
. That way you can have instant update. The doc includes all needed Perl snippets: http://i3wm.org/docs/ipc.html#_subscribing_to_events
I'll try to find time for this, unless somebody is willing to write it.
from i3blocks.
I wrote the following. I'm really sick today, though, so I'll stop right now and lay back down. It works if I execute it from the console, but somehow not via command
and interval=persist
. Not sure why. It's also missing handling for when the last container of a workspace was closed.
#!/usr/bin/env perl
use Data::Dumper;
use List::Util qw(first);
use AnyEvent;
use AnyEvent::I3;
use strict;
use warnings qw(FATAL utf8);
use v5.10;
my $i3 = i3();
$i3->connect->recv or die "failed to connect to i3";
$i3->subscribe({
window => sub {
my ($msg) = @_;
return unless $msg->{change} eq "focus" or $msg->{change} eq "title";
say $msg->{container}->{name};
}
})->recv->{success} or die "failed to subscribe to i3 events";
AE::cv->recv;
from i3blocks.
please check if you have the latest git version of i3blocks, it will not work with the last tagged version.
also check the command "xtitle -s" in your terminal, and see if it works okay (if not, install https://github.com/baskerville/xtitle or from the AUR if you are a archlinux user).
then it should all work.
from i3blocks.
The xtitle solution is actually a whole lot better. And it works fine with persist mode for me.
from i3blocks.
I close this issue since the wiki is updated. The xtitle
example is nice btw!
from i3blocks.
That was AWESOME. the very last thing that bothered me with i3 is now gone!
from i3blocks.
Related Issues (20)
- Enable utf-8 string in i3blocks
- 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
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.