Page 1 of 1

change default font size in the command line

Posted: Wed Jul 08, 2015 4:53 pm
by mullenkamp
Hi all,

I would like to know how to change and immediately update the "default font" size in LXDE via the command line.
I know this can be performed manually with the lxappearance gui, but I would prefer a command line option. I have two monitors of two vary different sizes that I switch to periodically. xrandr can obviously switch between the two, but I also want to change the font with the switch.

I'm currently using Debian testing, but in the past I was using Ubuntu 12.04. I had a solution for my old Ubuntu OS, but it doesn't work for the new Debian.

Code: Select all

xrandr --output DFP5 --auto --output DFP6 --off &&
sed -i 's/FontName=Ubuntu 11/FontName=Ubuntu 17/g'  ~/.config/lxsession/Lubuntu/desktop.conf &&
lxsession -r
It's a bit crude, but it worked before. Unfortunately now, running lxsession with any options causes it to crash back to the login screen. So I suspect it's a problem with an updated lxsession (or it was never meant to do this in the first place).

Thanks.

Re: change default font size in the command line

Posted: Wed Jul 08, 2015 9:08 pm
by drooly
crude indeed.
you should take a look at lxsession's and other lx* executables' documentation - maybe they offer some command-line interface. i think this is possible with gnome or xfce via gconf/xconf, but maybe not with lxde...
or maybe you can set it via dpi through Xorg's configuration at login...

...how exactly is the old solution not working?
do you need font size to change immediately for all apps?

Re: change default font size in the command line

Posted: Thu Jul 09, 2015 5:01 pm
by mullenkamp
The part that currently does not work is the 3rd and final line to reload lxsession. When lxsession is run (with any option other than --help) it crashes and sends me to the login screen.
I've looked at a lot of the other lx* programs, but they either don't handle fonts or (in the case of lxappearance) have no useful command-line options.
It's obviously possible since lxappearance does it somehow, but I can't figure out how it does it. There's very little documentation about how it works (and I'm not a programmer to be able to read through the many lines of code and know what I'm looking at).
Seems odd that they wouldn't add in command-line options for the kind of simple, light, and modular DE they advertise it as...

Oh, and I have modified the 1st and 2nd lines of the code to fit my current Debian LXDE flavor (no Ubuntu on the Debian system ;). That's not the problem.

Re: change default font size in the command line

Posted: Sun Jul 12, 2015 11:30 am
by drooly
if lxappearance is doing what you want, then you should indeed try to find out how it does it.

give us a larger picture of what you're trying to achieve... switch off one display, switch on another and increase font size?
how about assigning font sizes to particular displays, before you even switch?
not sure how this could be done, either via openbox configuration, X server configuration, or maybe even lxappearance:

Code: Select all

$ lxappearance -h
(...)
Application Options:
  --display=DISPLAY        X display to use
btw, i think this is a genuine LXDE question - maybe you should move/repost it in the LXDE Components section.

Re: change default font size in the command line

Posted: Sun Jul 12, 2015 3:45 pm
by Rex Bouwense
Agreed drooly. Thread moved to LXAppearance under LXDE Components.