Categories
programming

Geany dark editor in Ubuntu – configure a dark colored theme / style

Example of how the geany editor in Ubuntu gets a dark design. A GTK theme is adapted, the internal color scheme and that will be included in the start process.

Geany dark Editor – configure an alternate dark color theme

general

My applications running under Ubuntu (As of today 1/2017 Version 14.10) with the window manager Unity and the Ubuntu standard GTK + theme Ambiance.

It is possible to select different styles in Unity, but the dark themes are looking not so nice across all applications.
Especially with the Internet browsers, I think dark themes are not suitable.

However, it is possible to start applications with individual selected ‘color’ themes.
In order to let geany look as shown in the picture further below, I proceeded as follows.

step by step

  • install geany, if not already present -> sudo apt-get install geany

editor internal

  • If there should be no color themes available in geany, download them here: https://github.com/geany/geany-themes/
  • copy the folder colorschemes into ~/.config/geany/
  • now you can choose in geany from View -> Editor -> Color Themes – Color Themes your preferred Theme
    I use ‘raspberry’.geany dark - farbauswahl

Editor outside area

As described in http://www.henrykoch.de/de/eclipse-programmierumgebung-dunkel-machen, I build on an existing dark GTK+ theme and have modified this for me.
The following informations I stored as file .gtkrc_dark in ~/home/…/ (choose a convinient place for you)

gtk-color-scheme = "base_color:#252525\nfg_color:#f0f0f0\ntooltip_fg_color:#252525\nselected_bg_color:#FFD587\nselected_fg_color:#252525\ntext_color:#dadada\nbg_color:#4d4d4d\ntooltip_bg_color:#FFA500\nlink_color:#494949"
style "gtkcompact" {
	font_name="Sans 11"
	GtkButton::default_border={0,0,0,0}
	GtkButton::default_outside_border={0,0,0,0}
	GtkButtonBox::child_min_width=0
	GtkButtonBox::child_min_heigth=0
	GtkButtonBox::child_internal_pad_x=0
	GtkButtonBox::child_internal_pad_y=0
	GtkMenu::vertical-padding=1
	GtkMenuBar::internal_padding=0
	GtkMenuItem::horizontal_padding=4
	GtkToolbar::internal-padding=0
	GtkToolbar::space-size=0
	GtkOptionMenu::indicator_size=0
	GtkOptionMenu::indicator_spacing=0
	GtkPaned::handle_size=4
	GtkRange::trough_border=0
	GtkRange::stepper_spacing=0
	GtkScale::value_spacing=0
	GtkScrolledWindow::scrollbar_spacing=0
	GtkExpander::expander_size=10
	GtkExpander::expander_spacing=0
	GtkTreeView::vertical-separator=0
	GtkTreeView::horizontal-separator=0
	GtkTreeView::expander-size=8
	GtkTreeView::fixed-height-mode=TRUE
	GtkWidget::focus_padding=0
 
	####################
	# Color Definitions
	####################
 
	bg[NORMAL]= @bg_color
	bg[PRELIGHT]  = shade (1.02, @bg_color)
	bg[SELECTED]  = @selected_bg_color
	bg[INSENSITIVE]   = shade (0.95, @bg_color)
	bg[ACTIVE]= shade (0.9, @bg_color)
	fg[NORMAL]= @fg_color
	fg[PRELIGHT]  = @fg_color
	fg[SELECTED]  = @selected_fg_color
	fg[INSENSITIVE]   = darker (@bg_color)
	fg[ACTIVE]= @fg_color
	text[NORMAL]  = @text_color
	text[PRELIGHT]= @text_color
	text[SELECTED]= @selected_fg_color
	text[INSENSITIVE] = shade (0.8, @bg_color)
	text[ACTIVE]  = darker (@text_color)
	base[NORMAL]  = @base_color
	base[PRELIGHT]= shade (0.98, @bg_color)
	base[SELECTED]= @selected_bg_color
	base[INSENSITIVE] = shade (0.97, @bg_color)
	base[ACTIVE]  = shade (0.94, @bg_color)
 
}
 
class "GtkWidget" style "gtkcompact"
style "gtkcompactextra" {
	xthickness=0
	ythickness=0
}
 
class "GtkButton" style "gtkcompactextra"
class "GtkToolbar" style "gtkcompactextra"
class "GtkPaned" style "gtkcompactextra"

To start, I still need a bash script:

#!/bin/sh
export GTK2_RC_FILES="/home/.../.gtkrc_dark"
geany $1
env --unset=GTK2_RC_FILES

In addition, I have built a small dark geany logo and also stored under /home/…/ . (the 3 files as zip file geanydarkfiles.zip)

The last action must be performed with root privileges: sudo gedit /usr/share/applications/geany.desktop

Adjust the following two entries:

Exec=/home/.../geany.sh %F
Icon=/home/.../geany.xpm

Now Geany can always be called in dark, without having to start it from a console so it becomes dark. geany dark aufruf

geany dark Editor dunkel - dark

By Henry Koch

take a look at: http://www.henrykoch.de/privat.html

4 replies on “Geany dark editor in Ubuntu – configure a dark colored theme / style”

Hi Henry,

Thanks for sharing. Your theme looks great, I really want to have a dark theme as yours, but I followed all your steps, but it did not work.
1) The outside area is still white.
2) If I run the geany.sh, two error messages appear:
geany(2591): Gtk-WARNING Theme parsing error: gtk-widgets.css ‘max-width’ is not a valid property name.
and another one is ‘max-height’ is not a valid property name.

and I also downloaded your zip file (both of them), but I still cannot run it from “launch” bar….don’t know why, do you have any idea about it?
No big deal, really appreciate your sharing, very clear, even my English is not good, but I can totally understand every step, thanks.

Rex Lee

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.