-
Notifications
You must be signed in to change notification settings - Fork 171
Home
Having a good default monospace is important for a good UX in some Qt apps, especially terminal emulators and code editors. With LXQt ≥ 2.4, it can be set in LXQt Appearance Configuration → Font → Monospace. But the following method can be used everywhere. It overrides LXQt settings too.
Supposing that you prefer DejaVu for monospace (replace it with another font otherwise), create ~/.config/fontconfig/conf.d/0-mono.conf as:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- To fix monospace: -->
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
</fontconfig>
Note that it may not be a good idea to do this inside a global place (e.g., /usr/share/fontconfig), as different users may have different preferences.
Some fontconfig tricks might be needed to get colored emojis (→ https://github.com/lxqt/qterminal/issues/627).
Supposing that you have installed a font like noto-fonts-emoji, create ~/.config/fontconfig/conf.d/0-emoji.conf as:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- For colored emojis: -->
<match target="pattern">
<test name="family">
<string>monospace</string>
</test>
<edit mode="append" name="family">
<string>Noto Color Emoji</string>
</edit>
</match>
<match target="pattern">
<test name="family">
<string>serif</string>
</test>
<edit mode="append" name="family">
<string>Noto Color Emoji</string>
</edit>
</match>
<match target="pattern">
<test name="family">
<string>sans-serif</string>
</test>
<edit mode="append" name="family">
<string>Noto Color Emoji</string>
</edit>
</match>
</fontconfig>
Then, colored emojis will be shown by Qt apps, QTerminal included.
Press any modifier key in the shortcut field.
Create a script.sh like this:
#!/bin/bash
# Do your work here!
readmake it executable, and run it with qterminal -e script.sh.
To close the window after the execution is finished, press Enter in it.
Create the directory ~/.local/share/qterminal/color-schemes/ and put your custom color scheme inside it. See https://github.com/lxqt/qtermwidget/tree/master/lib/color-schemes for examples of existing color schemes.
Once you have defined your color scheme, you can select it in QTerminal under File → Preferences → Appearance → Color scheme.
Also, make sure that the name of your color scheme is different from those of QTerminal's schemes, because the latter will take priority.
NOTE: The directory ~/.config/qterminal.org/color-schemes/ is deprecated and should not be used.