Mousepad Colour Schemes
Reuben James (ruenoak)
v1.0, 16 April 2024
---
This document describes applying colour themes to the Mousepad text editor. This tutorial is based on Xfce-4.18 on Debian 12 (Bookworm)
---
Prerequisite
You will need to install git for this tutorial
On Debian and Deb based distributions open a terminal and type
sudo apt install git
and follow the prompts.
1. Introduction
Mousepad is a simple low footprint text editor for Linux and part of the Xfce collective of tools applications and utilities. Mousepad can be run on Linux and Unix systems and does not rely on Xfce to be installed. Mousepad makes use of the Gnome GtkSourceView style schemes to apply themes to the editor.
This tutorial won't go into creating a style scheme from scratch, but will show you how to apply a style scheme to the Mousepad text editor. I you are interested in knowing more about GtkSourceView style schemes, you can find links in the references at the end of this tutorial.
2. Setup
In Mousepad you you may have a set of themes preinstalled depending on your distribution/OS. You can find these themes in the Mousepad preferences. Open Mousepad and select Edit - Preferences and at the bottom of the View tab look for Color Scheme. In the dropdown list you should see a list of themes to choose from.
3. Installation
GtkSourceView style schemes are XML files that are stored in /home/USER/.local/share/GtkSourceView-3.0/styles and GtkSourceView-4/styles it is best practice to place the style scheme in both GtkSourceView-3.0/ and GtkSourceView-4 directories. depending on the application it can link to either one.
Navigate to /home/USER/.local/share and create these folders
- GtkSourceView-3.0/styles
- GtkSourceView-4/styles
Now that we have our folder structure created we need a style scheme to use. For this tutorial we will download the Dracula style scheme from the Dracula theme site.
Copy the git address below and paste it into a terminal to download the style scheme for Mousepad.
git clone https://github.com/dracula/mousepad.git
Open your home folder, you should now see a new folder called mousepad. In the mousepad folder there will be a few files, the file we are concerned with is called 'dracula.xml' this is the scheme file.
Right click and copy the 'dracula.xml' file, then navigate to the 'GtkSourceView' folders we made earlier and paste the 'dracula.xml' into both these folders.
- /home/USER/.local/share/GtkSourceView-3.0/styles/dracula.xml
- /home/USER/.local/share/GtkSourceView-4/styles/dracula.xml
Now open Mousepad and select Edit - Preference and in the View tab select 'Color Scheme' and select the Dracula color scheme.
The Dracula color scheme should now be enabled in Mousepad.
References
---