Ability to set a per-machine background or taskbar color

Bug #817686 reported by Jorge Castro on 2011-07-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Wishlist
Unassigned

Bug Description

Inspired by some people discussing this at work (crazy idea ahead!):

When running lots of terminals it can get hairy determining which is which at a glance. Apparently konsole (the KDE terminal) has an option to set the background for each terminal you open. Other tips:

"It can also set the background to random pastel colors, and the seed seems to be the same on each login, so by running the terminals in the same order I get the same colors each time, but different among them."

"http://pastebin.ubuntu.com/640127/ - That snippet of .bashrc does some horrible manipulation to an environment variable set by sshd. It strips the last octet off of the IP that I ssh'd into, and uses that as the background color for the prompt."

So what I was thinking would be that byobu would set a background color based on something unique on the host (time installed, a hash of the hostname, or whatever) and then in the config for background color you would have "autogenerated" or something. Then each time I log into a host I get the unique color for that host without having to try another terminal.

Some things that might complicate this:
- different terminals/systems support different kinds of colors
- You'd want to ensure you never do stupid color combinations like white/white, maybe have all the random colors be very dark or very white depending on which background scheme the user chooses.
- So maybe you'd only need like a few different dark shades of aubergine, enough to make them unique to the eye.
- If setting the background ends up being too problematic, perhaps setting the color on the status bar?

Jorge Castro (jorge) on 2011-07-28
Changed in byobu:
importance: Undecided → Wishlist
Dustin Kirkland  (kirkland) wrote :

Great idea, Jorge!

I'll play with this a bit and log my results here. Stay tuned!

Changed in byobu:
status: New → Triaged
Dustin Kirkland  (kirkland) wrote :

Okay, I'm hacking on this now. I think this might end up being a tmux-only feature...

Changed in byobu:
status: Triaged → In Progress
Dustin Kirkland  (kirkland) wrote :

I'm using the following for now:

hostname | md5sum | head -c 4 | awk --non-decimal-data '{print ("0x"$1)%255}'

So operate on the system's hostname, md5sum it, take the first 4 characters, and mod it by 255. This should give a per-hostname color between 0 and 255 for the background color.

Note that screen only supports 16 colors here, while tmux supports a full 255.

Dustin Kirkland  (kirkland) wrote :

Better yet, tmux actually supports #xxxxxx!

So:
  hostname | md5sum | head -c 6
should work just fine!

Changed in byobu:
status: In Progress → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers