change default font size in the command line

The standard theme switcher of LXDE - http://wiki.lxde.org/en/LXAppearance
mullenkamp
Posts: 4
Joined: Sun Nov 18, 2012 9:23 pm

change default font size in the command line

Postby mullenkamp » Wed Jul 08, 2015 4:53 pm

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.

drooly
Posts: 591
Joined: Mon Apr 08, 2013 6:45 am

Re: change default font size in the command line

Postby drooly » Wed Jul 08, 2015 9:08 pm

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?

mullenkamp
Posts: 4
Joined: Sun Nov 18, 2012 9:23 pm

Re: change default font size in the command line

Postby mullenkamp » Thu Jul 09, 2015 5:01 pm

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.

drooly
Posts: 591
Joined: Mon Apr 08, 2013 6:45 am

Re: change default font size in the command line

Postby drooly » Sun Jul 12, 2015 11:30 am

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.

Rex Bouwense
Posts: 1030
Joined: Sat Aug 27, 2011 5:44 pm
Location: Sierra Vista, Arizona USA
Contact:

Re: change default font size in the command line

Postby Rex Bouwense » Sun Jul 12, 2015 3:45 pm

Agreed drooly. Thread moved to LXAppearance under LXDE Components.
Rex
Lubuntu 18.04


Return to “LXAppearance”

Who is online

Users browsing this forum: No registered users and 2 guests