1

Sometime I want to edit RTL text with a specific font. I find it cumbersome to change font all the time. Is there a way I can tell gedit to set a certain font when launching it via cli.

The cli options don't seem to provide much

Usage:
  gedit [OPTION…] [FILE…] [+LINE[:COLUMN]]

Help Options:
  -h, --help                      Show help options
  --help-all                      Show all help options
  --help-gapplication             Show GApplication options
  --help-gtk                      Show GTK+ Options

Application Options:
  -V, --version                   Show the application’s version
  --list-encodings                Display list of possible values for the encoding option
  --encoding=ENCODING             Set the character encoding to be used to open the files listed on the command line
  --new-window                    Create a new top-level window in an existing instance of gedit
  --new-document                  Create a new document in an existing instance of gedit
  -w, --wait                      Open files and block process until files are closed
  -s, --standalone                Run gedit in standalone mode
  --display=DISPLAY               X display to use
muru
  • 197,895
  • 55
  • 485
  • 740
  • Somewhat related question: https://askubuntu.com/questions/92655/how-can-i-sync-my-root-gedit-with-my-user-gedits-preferences/1047405#1047405 – WinEunuuchs2Unix Jun 22 '18 at 10:56

1 Answers1

0

Found the answer I guess. This can be done using dconf-editor or gsettings cli utility.

Please be careful when using both the tools as they are really powerful to ruin your system.

https://howto8165.wordpress.com/2015/11/25/how-to-change-hidden-preferences-for-gedit/

This is what I did

I created two aliases/functions. One sets the default font when I type gedit the second called geditb (b for Balochi, the language I speak).

function gedit()
{

    gsettings set org.gnome.gedit.preferences.editor editor-font 'Monospace 12' 
    /usr/bin/gedit

}

function geditb()
{
    gsettings set org.gnome.gedit.preferences.editor editor-font 'Nafees 18'
    /usr/bin/gedit
}