Changing the look of new Gnome 3 title bars in with a GTK3 theme - gtk

I have a GTK3/Metacity theme which uses dark title bars.
Recent versions of Gnome 3 combine title- and toolbars, e.g. in Nautilus. I want to change their color to be consistent with all other GTK windows.
What is the attribute I need to look for?

The source code for the GTK+ themes is located in the https://git.gnome.org/browse/gnome-themes-standard/ git repository. The styling for the different widgets for Adwaita is located in the themes/Adwaita/gtk-3.0/gtk-widgets.css file -- see the section starting:
/***************
* Header bars *
***************/
Specifically:
.header-bar { ... }
.header-bar:backdrop { ... }
.header-bar .button.text-button { ... }
.header-bar .button.image-button { ... }

Although not 100% sure, I thought Nautilus is a GTK2 application.
If that is the case, you need to create a GTK2 theme next to your GTK3 theme.
You can put these folders next to each other.
Take a look in your /usr/share/themes folder for examples.
Does this help you?

You could install gtk-tweak-tool and configure your system to global-dark-theme.

Related

How to change the color of a specified syntax in VSCode, without affecting the rest of the syntax that is colored by the theme?

I really like the V.S. Code theme, Abyss. On occasion I find that the theme makes my code difficult to read, the text rendered in the editor will look like it is blending into the background, therefore; I thought changing individual syntax color would be a good solution.
I want to be able to adjust a couple of color-tokens, while leaving the rest of the syntax unchanged. How can I select, and change the properties of color tokens, without impacting any other parts of the theme that's currently set in the editor?
I want to use the code syntax color of the GitHub dark default theme with the Abyss theme on the rest of UI.
I found a site (click to see) that suggests changing the syntax colors with the editor.tokenColorCustomizations property.
I am not able to understand that how can I copy the color configuration from GiHub dark default to the Abyss theme.
V.S. Code users have the ability to style the syntax that is displayed in the editor, as well as the ability to style the editor its self — this includes the workbench, and all off the items in the workbench. To start styling the workbench, or syntax in the editor, you must first add the following JSON properties to either your user-scoped settings.json file, or by adding it to a workspace-scoped settings.json.
"workbench.colorCustomizations":{ /* properties here */ }
"editor.tokenColorCustomizations":[ /* properties here */ ]
Example of a properly configured settings.json file:
// "./.vscode/settings.json"
{
"workbench.colorCustomizations": {
"editor.background": "#08182F",
"sideBar.background": "#00132D",
"panel.background": "#00132D",
"activityBar.background": "#002040",
"editorGroupHeader.tabsBackground": "#00132D",
"tab.inactiveBackground": "#00132D",
"tab.activeBackground": "#003054",
"tab.activeBorder": "#003054",
"breadcrumb.background": "#003054",
"statusBar.background": "#005280",
"sideBar.border": "#103050",
"titleBar.border": "#103050",
"statusBar.border": "#103050",
"menu.border": "#103050",
"contrastBorder": "#103050",
"panel.border": "#103050",
"editorRuler.foreground": "#103050",
"tab.border": "#103050",
"tab.lastPinnedBorder": "#103050",
"activityBar.border": "#103050",
},
"editor.tokenColorCustomizations": [
{
"scope": "punctuation",
"settings": {
"foreground": "#C4C4C4",
"fontStyle": ""
}
},
{
"scope": "comment",
"settings": {
"foreground": "#246488",
"fontStyle": ""
}
},
{
"scope": "string",
"settings": {
"foreground": "#98DAF4",
"fontStyle": ""
}
},
]
}
There are many more properties that can be used to style your editor and syntax. A good resource to refer to is this template, its from the YO CODE generator, and it is what several theme designers use as a starting point when creating a new theme.
Theme Template (e.g. you don't have to make a theme to use the properties).
The most useful tool at your disposal is when writing theme properties — just like in the example above — is VSCodes suggestion widget. The suggestion widget is most often used to auto complete code, however, its usefulness extends much further than finishing a line of text for you. If you type, "background", while you are focused inside of one of the colors, or tokenColors, properties a whole list of available background properties will be available to choose from, and you are not limited to just background properties, the suggestion widget will work for finding borders, foregrounds, icons, buttons, inputs, bars, highlights and a whole lot more
Perhaps the best resource to read would be the VSCode Contributed Page on Color-Themes
EDIT: If you download the GitHub theme, you can find the theme's JSON file, which is the source code for the "Dark GitHub Theme" in the following location:
$HOME/.vscode/extensions/github.github-vscode-theme-4.1.1/themes/dark.json
When ever you have a theme's source JSON Document, you can copy and paste individual properties from the theme you located, into your ./.vscode/settings.json file using the properties:
"workbench.colorCustomizations":{ /* properties here */ }
"editor.tokenColorCustomizations":[ /* properties here */ ]
NOTE: It takes some practice, and some reading to get good at creating themes, or even just configuring your current theme to customize it a bit like your doing now.
ADDITIONAL HELP
I think it might help if I explain what it is your doing.
The workspace settings.json file, located in the root of each project...
"./.vscode/settings.json"
...takes precedence over all other configuration files, therefore, when a setting, or property is being configured in two files, and one of the files is "./.vscode/settings.json" then the configuration set inside "./.vscode/settings.json" will win-out the configuration in the other file, because "./.vscode/settings.json" overrides any configurations it holds, that are also held somewhere else. (I Hope that makes sense)...
Next to the workspace "settings.json" file, is the users settings.json file, which is located at:
"$HOME/.config/Code/User/settings.json"
So basically all you need to know at this point is your settings.json files are the word of the land, everything else is overridden. This is very important, because when you use the settings.json files to set color-token properties to highlight some syntax that is being colored by a theme, and your recoloring it because you don't like it, what you are doing, is overriding the theme's JSON file located in the themes extension directory # $HOME/.vscode/extensions. If you don't set a property in a valid settings.json file, then the property will remain unchanged. This lets you select and choose which properties to change, by overriding the properties you don't like. And as I have stated in the comments and above, these are the properties you will use to preform the overrides.
"colors":{ /* properties here */ }
"tokenColors":[ /* properties here */ ]
Rather than trying to copy and paste entire themes, just try to change a single element. Once you succeed at changing one element, then you can try changing several in unison.
ctrl+shift+p =>preferences:color theme==> select Dark+(default dark)

How can you change the colour of the R background for `exams2moodle` questions?

I'm writing some quizzes for Moodle using R/exams' exams2moodle. The XML file is created fine and I can import the quiz to Moodle ok, however, any question that has R code as part of either the question or the solution has the R code on a dark background making it almost impossible to read. Is there an option somewhere that controls this?
I am using this code to create the XML:
exams2moodle(c("q1.Rmd", "q2b.Rmd", "q3.Rmd", "q4.Rmd", "q5.Rmd", "q6.Rmd"),
name = "GLM_prac1",
iname = FALSE,
converter = "pandoc-mathjax",
cloze = list(cloze_schoice_display = "MULTICHOICE_V"))
And this is an example of the issue:
The color of the R code displayed is not controlled through exams2moodle(), at least not explicitly. What exams2moodle() does, is to put verbatim code input and output into standard HTML tags for this <pre><code> ... </code></pre>. This stands for pre-formatted text with markup for typewriter code. (Actually, this is not even produced by exams2moodle() directly but by pandoc.)
The rendering of these standard HTML tags is then controlled through the CSS styles employed in your Moodle installation. In a vanilla Moodle installation you currently simply get a black font on the same light blueish background as for regular text. In previous versions the background was light gray. Given that you have light orange background for text and dark background for code, I guess that this is a setting in your Moodle installation. Hence I would recommend to reach out to the Moodle team at your university and ask them about this. This seems to be a poor setting that would likely affect others as well.
If you cannot get in touch with the Moodle team or they are unwilling to change their CSS, you can insert your own custom CSS code into your exercises. The advantage is that you have full control over the color then. The disadvantage is that you yourself have to include that style code into every exercise where it is needed. It is not hard but tedious. For example, you can include the following R code chunk in the exercise directly at the beginning of the question section:
Question
========
```{r, echo = FALSE, results = "asis"}
writeLines("<style>
pre {
background: #FFFFFF00
}
</style>")
```
This simply inserts a short HTML snippet with CSS into your Rmd exercise:
<style>
pre {
background: #FFFFFF00
}
</style>
This will instruct the browser to use the background color #FFFFFF00 (fully transparent white) for all <pre>-formatted chunks. Of course, you can also play around with this and use a different color, say #EEEEEE (light gray) or similar.

How can I add a ruler (vertical line) to CodeMirror editors in JupyterLab?

I would like to add a ruler at 80 characters. I know that you can add rulers to CodeMirror, but I don't know if I'm supposed to place the corresponding javascript in a file somewhere, or in JupyterLab's Advanced Settings Editor > CodeMirror > User Overides section, or if I should do something else all together to get it working.
I'm using JupyterLab 0.31.8
The feature is available in the recently shipped JupyterLab 1.0.
The feature now is implemented in the current JupyterLab 1.0 alpha (see this PR).
Note: in addition to adding
{
"codeCellConfig": {
"rulers": [80]
}
}
to the Notebook settings as shown above, you can also add
{
"editorConfig": {
"rulers": [80]
}
}
to the Text Editor settings.

Eclipse formatting cause CSS to stop working

I have following CSS in my style.css:
.btfl-alert-warning:not(.selectize-control):not(.selectize-dropdown-content):not(.selectize-dropdown)
{
//some properties
}
Now, when I use Eclipse formatting, eclipse make space between 'not' and parenthesis and I get something like this:
.btfl-alert-warning:not (.selectize-control ):not (.selectize-dropdown-content
):not (.selectize-dropdown ) {
}
After using formatter second time it looks much worse, but the point is after adding this 'space' this selector just stop work. I checked all CSS formatter options in Eclipse but nothing helped me.
Do you have any idea how to prevent ruining this CSS?
You could go to Preferences -> CSS -> Code Style:
Then modify it as you want it to show.
In the case you can't make it in the CSS(Code Style), you might don't apply the format in eclipse, it is fine to do all the work in Eclipse, once you finish when you have a production ready CSS/HTML/JS/.... you can use atom from GitHub to apply format to your CSS/HTML/JS/.... use the plugins from AtomLinter
I hope this helps you.
I ended up using additional css file called style_do_not_format.css which contains only that css and comment about not formatting this file because it cause css to stop work. In my style.css file i use
#IMPORT url("style_do_not_format.css");

Highlighting Flex 3.5 CDATA component in Eclipse

Is there any way to highlight the CDATA component in a .mxml file?
I have Eclipse and Flash Builder 3.5 and the flex components are highlighted, but the CDATA isn't. It contains action script.
Sorry, I meant syntax highlighting. For example:
<mx:Canvas ... >
<mx:Script>
<![CDATA[
private function foo():void {}
]]>
</mx:Script>
I don't think so, but your Outline View should allow you to click on any script tags to highlight them. Unfortunately you can't give them different ID's, so splitting your code among different blocks doesn't help much.