The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
2

Only show normal border when remote shell

asked 2012-11-21 14:21:54 +0000

dabai gravatar image

I generally use the 1pixel border to save screen space. I would like to show a normal bar only on windows containing a urxvt that shows a remote shell and on all local terminals the default 1pixel border.

While this works (1pixel border as default and normal as soon as I ssh on the precise64 host):

for_window [class="URxvt" title="^.*@precise64.*$"] border normal

Since I don't want to list all remote hosts I work on, I would just want to exclude my localhost (hparch) from the matcher, instead of including all others. Unfortunately this wont work:

for_window [class="URxvt" title="^(?!.*@hparch).*$"] border normal

I checked the regex with pcregrep, so it seems to work. Might there be a problem with the way i3 parses the regex?

Problem already appeared here but also no real solution.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2012-11-21 22:46:18 +0000

Michael gravatar image

My title bars contain "hostname: directory", e.g. "x200: ~", so here is what works for me:

for_window [class="URxvt" title="^[^:]+:(?<!x200:)"] border normal

You might just have to modify your regexp a bit. Have a look at http://i3wm.org/docs/debugging.html to enable the logfile. It will tell you whether a regexp matches or not. pcregrep (which you mentioned) is a faster alternative, though. By the way, I couldn’t get your regexp to work in pcregrep.

Also, why not use a shell alias like this one in the first place instead of doing hackish unreliable title matching? :-)

alias ssh='i3-msg border normal && ssh'
edit flag offensive delete link more

Comments

OMG, guess I lost sight of the obvious over tweaking the regex :) Thanks a lot!

dabai gravatar imagedabai ( 2012-11-22 08:10:12 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2012-11-21 14:21:54 +0000

Seen: 236 times

Last updated: Nov 21 '12