Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XTermTitle plg - Machine name/cwd display in Xterm sessions connected to unRAID

Featured Replies

If, like me, you frequently work with several terminal sessions open, you may find the following (very) simple plugin useful.

 

When I started connecting to my ArchLinux VMs, I was interested to note that the target machine/cwd was displayed in my terminal window title bar and tabs - I'd never seen this with unRAID, so I created this little utility to add the same feature to unRAID.

 

This version of the plugin will work with unRAID v6.0 beta12

 

The plugin can be found at

https://github.com/PeterAOBell/unraid/raw/master/XTermTitle.plg

Simply paste the url into the install plugin box and click 'Install'.

Nice little addition :)

 

I installed it and logged in as a non-root user via ssh, worked great. But if I ran su to do something as root it didn't updated the window title anymore.

 

So I added a ~/.bashrc file which just contains

source /etc/profile

and now it works just fine :D

 

Any possibility you could add the creation of the .bashrc file to the plugin?

 

It also doesn't update from within a screen session, not found a fix for that yet though.

 

Edit:

 

I think I found a fix for the screen issue. I changed the added code in /etc/profile to be

if [ $?TERM ]; then     #paob
  case $TERM    #paob
  in    #paob
     xterm*)    #paob
     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' #paob
     ;; #paob
     screen) #paob
     PROMPT_COMMAND='echo -ne "\033P\033]0;${USER}@${HOSTNAME}: ${PWD}\007\033\\"' #paob
     ;; #paob
     *) #paob
  esac  #paob
fi      #paob

 

and it works from within a screen session too

  • Author

Nice little addition :)

 

Thanks, I find it helps to eliminate confusion!

 

I installed it and logged in as a non-root user via ssh, worked great. But if I ran su to do something as root it didn't updated the window title anymore.

 

Ah, I always log in as root!  :-[

 

So I added a ~/.bashrc file which just contains
source /etc/profile

and now it works just fine :D

 

Any possibility you could add the creation of the .bashrc file to the plugin?

 

Done!

 

It also doesn't update from within a screen session, not found a fix for that yet though.

 

Edit:

 

I think I found a fix for the screen issue. I changed the added code in /etc/profile to be

if [ $?TERM ]; then     #paob
  case $TERM    #paob
  in    #paob
     xterm*)    #paob
     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' #paob
     ;; #paob
     screen) #paob
     PROMPT_COMMAND='echo -ne "\033P\033]0;${USER}@${HOSTNAME}: ${PWD}\007\033\\"' #paob
     ;; #paob
     *) #paob
  esac  #paob
fi      #paob

 

and it works from within a screen session too

 

Okay,so the screen session merely needs the xterm prompt wrapping in an <ESC>P....<ESC>\ pair?

 

I can add that easily enough.

Okay,so the screen session merely needs the xterm prompt wrapping in an <ESC>P....<ESC>\ pair?

 

I can add that easily enough.

Yep, if that's what those codes mean (I found it in a forum somewhere).

 

Having it added to your plugin would be great if you get a chance.

  • Author
Having it added to your plugin would be great if you get a chance.

 

Okay, done.  Give that a try and let me know if any problems.

Just tried and all seems to be fine. Thanks for those changes :)

  • 8 months later...

Bumping this to see if the author can confirm that it is compatible with 6.1.

 

I am using it under 6.1 without issues.

  • 3 years later...

I just downloaded this plugin after learning about it here:

I'd like to be able to preserve/repopulate .bashrc with some aliases I use often. I'm not really sure how to go about doing this. Any pointers?

3 hours ago, Bob1215 said:

I just downloaded this plugin after learning about it here:

I'd like to be able to preserve/repopulate .bashrc with some aliases I use often. I'm not really sure how to go about doing this. Any pointers?

A little OT,

What I do is use "heredocs" in the go file;

 

Like so:

cat << 'EOF' > ~/.bashrc

Your

Full

Bashrc

Goes

Here

EOF

 

You can do this for any files you'd like.

You can also store them in a "overlay" folder, which can be more convenient depending on circumstances (I'm going to switch to this as I have several user customized files now)

You would do this by creating an overlay folder in the same directory as the "go" script on your boot drive.

 

Put your .bashrc, .bash_profile etc into there.

 

At the end of your "go" file put:

mount -t overlay overlay -o lowerdir=~/,upperdir=./overlay ~/

 

This "should" (I have not tested it yet) make the original ~/ created by unraid read only, and mount the "overlay" directory from the flash drive as read write over the top of it. Anything written to the home directory of root ~/, /root/ will be written to the flash drive and persistent across reboots.

This makes for a good failsafe, if something breaks you can simply comment out the mount line in the go file and it will be reverted. I'm kind of surprised a persistent home directory hasn't already been added to unraidnin this manner.

7 hours ago, Xaero said:

Anything written to the home directory of root ~/, /root/ will be written to the flash drive and persistent across reboots.

How are you handling permissions? FAT32 doesn't support normal linux permissions, and causes issues if not dealt with.

On 7/8/2019 at 5:59 AM, jonathanm said:

How are you handling permissions? FAT32 doesn't support normal linux permissions, and causes issues if not dealt with.

You could use a persistence file, I forgot about this issue. We've dealt with this in USB Linux Land for a long time.

 

Basically,

dd if=/dev/zero of=/boot/config/persist.img bs=1M count=512

(For a 512mb persist file)

mkfs.ext4 /boot/config/persist.img

 

And then change the overlay mount to mount that persist image rather than a folder.

 

Max size in this case would be 4gb due to fat32 ceiling.

 

EDIT:
This was from memory - there's a few steps involved. I'll document this in a separate thread and then link that thread here, so as to not derail this OP any further. I may also make it a feature suggestion, since it wouldn't be too outlandish to offer this as an option in the WebUI by default, and have safe mode just "NOT" use the home folder overlay.

Edited by Xaero

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.