I have my favourite Terminal color scheme, but I wanted to be able to select a different one on a once-off basis. Not make every subsequent Terminal in the new colour, just this one. As if terminal had a --colour=XXXX parameter.
So I scripted it. Requires hdialog
#!/bin/sh
if [ -e /boot/home/config/settings/Terminal/Default ]; then
cp -f /boot/home/config/settings/Terminal/Default /boot/home/config/settings/Terminal/oldDefault
fi
theme=$(echo -n $(hdialog --radio " Pick a colour scheme" Blue Default Midnight Professional Relaxed Retro Slate "Solarized Dark" "Solarized Light"))
cd /boot/system/data/Terminal/Themes/
cp -f "$theme" /boot/home/config/settings/Terminal/Default
cd /boot/home
Terminal &
sleep 1
if [ -e /boot/home/config/settings/Terminal/oldDefault ]; then
mv -f /boot/home/config/settings/Terminal/oldDefault /boot/home/config/settings/Terminal/Default
else
rm -f /boot/home/config/settings/Terminal/Default
fi
This is actually a bug in the Haiku installation data. The Terminal themes don’t have the mimetype set properly, otherwise you could launch them directly with something like open /boot/system/data/Terminal/Themes/Blue, for example.
If you copy the theme files elsewhere and fix the mimetype & preferred app, then they can be used with the open command.
Yeah, I remember doing that, long ago. It looks like this doesn’t even work with newly created color schemes now, so that MIMEtype has been long forgotten.
The application creating this file is responsible for setting mimetypes, so if Terminal would like a config to be openable it would have to set this when saving the theme.
Though personally I fail to see why one would want to do that :g
These files are part of the haiku install, in this specific case they are not created directly by terminal. So this is just an oversight in haiku buildsystem.