On Sunday, January 3, 2021 at 11:01:17 AM UTC+8, Bit Twister wrote:
> On Sat, 2 Jan 2021 18:22:57 -0800 (PST),
hongy...@gmail.com wrote:
> > I want to set the following font and specific font size, say, 14 for my GNOME Terminal in script:
> >
> > $ fc-list | grep -i 'dejavusansmono nerd font mono.*book'
> > /home/werner/.local/share/fonts/NerdFonts/DejaVu Sans Mono Nerd Font Complete Mono.ttf: DejaVuSansMono Nerd Font Mono:style=Book
> >
> > Any hints for doing this programmatically within script?
> Use a "case" statement or if, then, else statements to set a variable
> name, then tell gnome-terminal to use $variable_name.
>
> putting
> gnome-terminal font command line
> in the first box at
>
https://www.google.com/advanced_search
> gets me
> About 2,610,000 results (0.85 seconds)
Thanks for your valuable notes. I figured out the following solution based on the searching result from <
https://ncona.com/2019/11/configuring-gnome-terminal-programmatically/>:
$ GNOME_TERMINAL_PROFILE=`gsettings get org.gnome.Terminal.ProfilesList default | awk -F \' '{print $2}'`
$ gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$GNOME_TERMINAL_PROFILE/ font 'DejaVuSansMono Nerd Font Mono book 14'
> xlsfonts is easy way to list font names.
I tried this command but it can't list the above font installed on my box:
werner@X10DAi:~$ xlsfonts | grep -i dejavu
werner@X10DAi:~$
> xfontsel to look at fonts.
This tool seems so ugly and still can't list the font mentioned above for my case.
> Personally I find xterm much more command line friendly for customization.
I've learned that tmux is powerful and high customizable, but I haven't tried it till now.