PeterB Posted December 5, 2014 Share Posted December 5, 2014 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'. Quote Link to comment
butlerpeter Posted December 5, 2014 Share Posted December 5, 2014 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 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 Quote Link to comment
PeterB Posted December 6, 2014 Author Share Posted December 6, 2014 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 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. Quote Link to comment
butlerpeter Posted December 8, 2014 Share Posted December 8, 2014 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. Quote Link to comment
PeterB Posted December 8, 2014 Author Share Posted December 8, 2014 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. Quote Link to comment
butlerpeter Posted December 8, 2014 Share Posted December 8, 2014 Just tried and all seems to be fine. Thanks for those changes Quote Link to comment
trurl Posted September 1, 2015 Share Posted September 1, 2015 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. Quote Link to comment
Bob1215 Posted July 8, 2019 Share Posted July 8, 2019 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? Quote Link to comment
Xaero Posted July 8, 2019 Share Posted July 8, 2019 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. Quote Link to comment
JonathanM Posted July 8, 2019 Share Posted July 8, 2019 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. Quote Link to comment
Xaero Posted July 8, 2019 Share Posted July 8, 2019 (edited) 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 July 11, 2019 by Xaero Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.