You are not logged in.
Hi,
Does someone know about a way to dynamically switch background/foreground colors and fonts in terminals? I'm running Xmonad with Xterm, and I would really like to switch all my open terminals between white-on-black and black-on-white by the press of a key. Similarly for the font size/face. I don't mind changing from Xterm to another terminal if this functionality can be found anywhere else.
I know that both Xterm and rxvt can be controlled dynamically by executing special commands inside the terminal, but I need a way to do it from the "outside", for all running terminals.
I expect some problems in programs like vim, where this color switching might mess up the current color scheme, but in the worst case I can switch color scheme in vim manually to get around that.
Regards,
Rickard
Offline
The only way I'm aware of to do what you're asking is to use gnome-terminal and control its appearance by changing the theme in gnome-settings-manager. (I think.) There's probably an equivalent arrangement that does the same thing under KDE. But I don't imagine that someone who runs Xmonad is interested in having gnome-settings-daemon running all the time and interfering with other stuff...
As far as I know, most of the more popular non-DE-specific terminals (urxvt, xterm, etc) don't support this kind of global theme-switching, which I am inclined to see as a feature; it could really mess up applications running in other terminals (as you mentioned). But you might somehow write a script to do so (I have no idea how/if this could be implemented).
Offline
Here is an example that should work for switching fonts in the rxvt-unicode terminal. Not sure about colors though sorry.
echo -e '\e]710;xft:Terminus:style=Regular\007'
vim
echo -e '\e]710;xft:lime:style=Regular\007'
Offline
Hi,
Does someone know about a way to dynamically switch background/foreground colors and fonts in terminals? I'm running Xmonad with Xterm, and I would really like to switch all my open terminals between white-on-black and black-on-white by the press of a key. Similarly for the font size/face. I don't mind changing from Xterm to another terminal if this functionality can be found anywhere else.
How about something like this (not tested properly):
pacman -S xtermcontrol
for x in `ls /dev/pts | xargs`
do
xtermcontrol --bg white > /dev/pts/$x
done
Offline
The only way I'm aware of to do what you're asking is to use gnome-terminal and control its appearance by changing the theme in gnome-settings-manager. (I think.) There's probably an equivalent arrangement that does the same thing under KDE. But I don't imagine that someone who runs Xmonad is interested in having gnome-settings-daemon running all the time and interfering with other stuff...
I tested this idea, and it actually worked out pretty good. For various reasons, I am already running gnome-settings-deamon along with Xmonad and it works fine. The only thing I had to do was to run my xmonad starter script with dbus-launch, otherwise the gconftool-2 wouldn't work correctly.
So now I can map keys to commands like:
gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/font "Terminus 12"
and then all open gnome-terminals are changed accordingly.
Thanks for the tip! I might continue looking for solutions for other terminals though.
Offline
How about something like this (not tested properly):
pacman -S xtermcontrol for x in `ls /dev/pts | xargs` do xtermcontrol --bg white > /dev/pts/$x done
I'll try that out when I get home. Thanks!
Offline