Hacker News new | ask | show | jobs
by signa11 3101 days ago
> Without a getter (which is a security issue) or introducing global state or passing the values all around you can't set a temporary value for the title. Is that clearer ?

yes, it is. thank you ! one simple solution might be to wrap this thingy within an 'xprop(1)' invokation. for example, i can do the following:

    signal11@fatcat networking % xprop -id 0x2c00022 | grep WM_NAME
    WM_NAME(STRING) = "fatcat:~/source-code/c/networking"
    signal11@fatcat networking % cd ~/source-code/c/quick-hacks 
    signal11@fatcat quick-hacks % xprop -id 0x2c00022 | grep WM_NAME
    WM_NAME(STRING) = "fatcat:~/source-code/c/quick-hacks"
    signal11@fatcat quick-hacks % 
WM_NAME(STRING) points to the current title. and when i change the directory, i can query the new name. fitting this mechanism for aforementioned usecase is left as an exercise for the reader :) fwiw, the value for '-id' argument comes from 'xwininfo(1)'
1 comments

That is a nice hack thanks! Though it is not really portable to all OS, and AFAIU not working if you ssh to a remote host ! It may give a potential way to work partially around that limitation. I feel like an actual push/pop solution would be better.
> ... and AFAIU not working if you ssh to a remote host !

X being a network protocol at heart, it positively is weird. i tried that thingy on both local machine, and ssh'ed xterm to remote-machine (with X sessions correctly forwarded locally), and it all seems to work just fine for me.

edit-001 : these are linux machines at both ends, so, i dunno...

Yes, I'm on Mac OS so that's likely it, and the server I was trying had no X anyway. Thanks for investigating.