SOLVED: Customize Nemo preview windows background

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
leminhman0312

SOLVED: Customize Nemo preview windows background

Post by leminhman0312 »

Hello Folks,

In Nemo, you can hover over any files and press "Space Bar". If you work with source codes, then this doesnt turn out well. I.e Nemo has a default white background, which makes syntax highlights to show up pretty bad. How do I modify this?

Please let me know and thank you.
nemo.png
edit1: This feature is actually called "nemo-preview" in case anyone wants to help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
kyphi
Level 9
Level 9
Posts: 2735
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: Customize Nemo preview windows background

Post by kyphi »

Would this tutorial by administrollaattori help?

viewtopic.php?t=258354
Linux Mint 21.3 Cinnamon
leminhman0312

Re: Customize Nemo preview windows background

Post by leminhman0312 »

The tutorial's commands change the color of the Nemo file browser as you are using it normally. This I can do. However, the nemo-preview's background is still white. It must be something to do with the .css file, but I do not know what function to put. Follow this github's page which I think its the developer of nemo-preview, I think the command is something like this:

https://github.com/linuxmint/nemo-exten ... -style.css

NemoPreviewFontWidget{ //put the color you want here//} in the .css file. However, that didnt work, so it must be something else... But I think this is the right track because it causes changes to Nemo.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Customize Nemo preview windows background

Post by smurphos »

Change the theme in Xed / text editor - the preview of text file is using the the xed theme in the background.

Open xed > preferences > theme > pick a preferred theme.

The change should feed through to Nemo previewing text files.

Edit to add - if you want to create a bespoke color scheme for xed / nemo text preview the defaults are in /usr/share/gtksourceview-3.0/styles. You can use one of these as a starting point. The xed theme gui has an option to add a colour scheme from any location or you could drop a modified version in this folder with root privileges.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
leminhman0312

Re: Customize Nemo preview windows background

Post by leminhman0312 »

Thank you for all of your replies. However, change the Theme via Xed only changes the syntax highlight. The preview background is still white, only syntax is a little bit better to read. I would like to change the background of the preview windows. I did navigate to /usr/share/gtksourceview-3.0/styles. That is how I customize my Xed's theme, which is easy to do. Or we have to add a line of code to one of the sections? As default, opening up any style sheet will have the colors defined, then you have Global Settings/Comments/Constants.... I'm pretty sure we have to add an option in Global Settings, I just do not know what to add, i.e what name to add and then specify color such that it changes color of nemo-preview windows. Please see attached.
Selection_002.png
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Customize Nemo preview windows background

Post by smurphos »

I'm a bit confused.... this is Nemo on Cinnamon Mint 19 - I've set the Mint-Y theme temporarily and set Xed's theme to Cobalt. The background of nemo-preview for text is dark blue - is that not the background you are looking to change?

Image

If I use open as root and preview from the root instance of nemo it is still white. So I just open a text file in xed from the root instance of nemo, which opens a root instance of xed and change the root instance of xed's theme settings there. Root nemo preview is now displayed in Cobalt.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
leminhman0312

Re: Customize Nemo preview windows background

Post by leminhman0312 »

First of all, thank you for all the help. @smurphos: yes, your method works. The problem here is, partly my fault, I did not specify the version of Mint I am using. I was on Mint 18.3. Now for 18.3, the default text editor, Xed, is at version 1.6.5 (i think, cant remember). Anyway, for the preview background to work, you would need Mint 19 or Xed 1.8.3. Mint 19 is shipped with Xed 1.8.3. On the other hand, you can just remove the default Xed and then download the latest version, not recommend. Anyway, with Mint 19 and Xed 1.8.3 on board, everything works just like smurphos suggested: Change theme in editor => The preview background will change accordingly.
Selection_001.png
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Customize Nemo preview windows background

Post by smurphos »

leminhman0312 wrote: Tue Oct 16, 2018 12:07 am The problem here is, partly my fault, I did not specify the version of Mint I am using.
LOL, and I didn't ask, not did I check that the solution worked in 18.3 and 19. We will share the blame. All is well that ends well. :)
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Locked

Return to “Beginner Questions”