ZNHOO Whatever you are, be a good one!

Theme

  1. Scheme
  2. Xfce
  3. Guake
  4. Emacs

Scheme

  1. x11-themes/zuki-themes-3.20 is compatible with both GTK2 and GTK3.
    1. Make sure xfce USE is enabled to include relevant Xfwm4 part.
    2. (opt) Get a copy of chrome/userChrome.css into Firefox's profile like ~/.mozilla/firefox/53rwll2m.default/chrome/userChrome.css.
  2. papirus-icon-theme for Icons. The advantage of papirus-icon-theme is supporting hardcode-tray support, especially for Thunar icons.

    Just copy Papirus and Papirus-Dark to ~/.local/share/icons/. Remember to gtk-update-icon-cache ~/.loca/share/icons/{Papirus,Papirus-Dark}.

  3. Solarized is a palette theme mainly for editor (Emacs/Vim) and terminal emulator (Guake).

Xfce

Theme are divided into 5 different themes:

  1. GTK2/3 theme: Applications/Settings/Apperance/Style. Rendering GTK toolkit like buttons, textboxes, drawing canvas, etc - everything within the border and title bar of a window.
  2. Window Manager theme (Xfwm4): Applications/Settings/Window Manager/Style. The borders, title bar, maximize/minimize buttons, etc.
  3. Icon theme (Adwaita): Applications/Settings/Apperance/Icons.
  4. Notification theme: Applications/Settings/Notifications. Notification popup.
  5. Cursor theme: Applications/Settings/Mouse and Touchpad/Theme.

    All of these components play a part in determining the look of Xfce Desktop as you see it on the screen.

    Check /usr/share/themes and /usr/share/icons for theme files.

  6. Themes can be configured by command gconftool-2 either.
  7. (deprecated) Consistent look for GTK2 and GTK3.

    By default, x11-themes/gtk-engines-xfce:0 (slot 0 for GTK2 themes) is installed. We emerge it explicitly to pull in GTK3 themes (slot 3).

    # emerge -avt x11-themes/gtk-engines-xfce
    

    Term theme engine refers to preliminary themes that mainly serve as dependencies of other themes. For example, many excel themes (i.e. Arc-theme and Greybird) depend on gtk-engines-murrine.

    The xfce devs dropped support for gtk3-themes in the default theme (gtk-engines-xfce), because the theming api broke so much in the releases that they couldn't keep the pace. now it's the job of the distributor to provide a common theme

  8. Rude GTK3

    GTK3 updates always break existing themes. The developers just ignore themes compatibility!

    >=x11-libs/gtk+-3.20 breaks existing Xfce GTK3 themes (i.e. Firefox mouseover fails to display, scroolbar disappers, Ctrl-o no borders etc.).

    Since many packages depend on 3.20, we have to either choose a compatible GTK3 theme (i.e. Greybird require many dependencies) or remove GTK3 theme from system (only slot 0). What's worse, Xfce's default GTK2 Raleigh theme is incompatible with some GTK3 applications.

    Themes should be updated regularly to remain compatible with the GTK3 library installed on system.

  9. Zuki - a GTK3-compatible theme

    To manually configure consistent desktop look, choose a theme that covers as many aspects of those five categories as possible, cares about GTK version 2 and 3, and updates frequently to follow GTK3 library.

  10. (deprecated) Missing icons

    xfce-base/xfce4-meta depends on virtual/freedesktop-icon-theme. The lastest virtual/freedesktop-icon-theme ebuild has been changed to prefer x11-themes/adwaita-icon-theme (by default) over x11-themes/gnome-icon-theme. But the former does not contain icons for Xfce4 Desktop.

    # emerge -avtn x11-themes/gnome-icon-theme
    

    Since papirus-icon-theme is used, we leave Xfce's default icon themes alone.

Guake

Without explicit note, I use terminal and terminal emulator interchangeably.

  1. Palette
    1. Most terminals support palette setting in Preferences/Appearance.
    2. If the built-in palette fails to meet your requirement, try separate palette manually like guake-colors-solarized.
    3. Usually, choose solarized-dark.
  2. TERM

    Applications (Emacs Vim etc.) to run in terminal may depend on variable TERM to correctly apply palette.

    Guake supports 256 colors (ancient terminals have only 16 colors). However due to this bug support true colors in terminal, Guake fails to set TERM (xterm) as xterm-256color. This can be verified by tput colors (8 foreground colors and 8 background colors) and M-x: list-colors-display in Emacs.

    It's terminal emulator's job to set TERM on startup before any shell init scripts are loaded. But before the bug is resolved, we must resort to shell.

    # ~/.bashrc
    if [[ -e /usr/share/terminfo/x/xterm-256color ]] ; then
        case $TERM in (rxvt-unicode|screen|tmux|xterm) TERM=$TERM-256color;; esac
    fi
    

    Possible TERM values can be found unser /usr/share/terminfo.

  3. dircolors-solarized

    After changing to solarized-dark palette, ls output displays ugly. To fix that, apply Solarized color setup to ls output by dircolors - solarized palette for ls command.

    ~ $ cd ~/opt
    ~ $ git clone --depth=1 https://github.com/seebi/dircolors-solarized
    ~ $ ln -sv ~/opt/dircolors-solarized/dircolors.ansi-dark ~/.dircolors
    ~ $ echo 'eval `dircolors ~/.dircolors`' >> ~/.bashrc
    # Uncheck *Allow bold font* in Preferences
    

    There are four available color theme, namely dircolors.{256dark,ansi-universal,ansi-dark,ansi-light}.

    1. If the terminal does not support Solarized palette (rarely), choose dircolors.256color which simulates Solarized by terminal's built-in 256 colors, resulting in an approximate Solarized theme. It must be a 256-color terminal and TERM is correctly set.
    2. dircolors.ansi-universal is smart enough to work both for 16 colors and 256 colors.
    3. If you are sure about the terminal colors, choose dircolors.ansi-{dark,light}. They are optimized version.
  4. Summary
    1. Guake has 256 colors;
    2. Wrong TERM value due to bug (updated in ~/.bashrc);
    3. Support Solarized palette in Preferences;
    4. Choose dircolors.ansi-{dark,light}.

Emacs

  1. emacs-color-theme-solarized

    ~ $ cd ~/.emacs.d/site-lisp
    ~ $ git clone --depth=1 https://github.com/sellout/emacs-color-theme-solarized
    
  2. Loading

    (add-to-list 'custom-theme-load-path (expand-file-name "site-lisp/emacs-color-theme-solarized" user-emacs-directory))
    ;; By default it's 16, but requires terminal emulator palette set to `solarized' and
    ;; make sure `TERM={xterm,screen,rxvt-unicode}-256color'. Otherwsie set to
    ;; 256 and got degraded but approximate `solarized' theme
    ;(setq solarized-termcolors 256)
    (load-theme 'solarized t nil)
    ;; `solarized-light' in GUI mode; `solarized-dark' in terminal
    (add-hook 'after-make-frame-functions
          (lambda (frame)
            (let ((mode (if (display-graphic-p frame) 'light 'dark)))
          (set-frame-parameter frame 'background-mode mode)
          (set-terminal-parameter frame 'background-mode mode))
            (enable-theme 'solarized)))
    
  3. Fix

    Currently, there is a 6-year bug not yet fixed, namely Emacs solarized in terminal with true 256 color is not correctly displayed.

    If you encounter such issue, either strip -256color from TERM value or set (setq solarized-termcolors 256) in init.el. We can also set individual TERM value for Emacs like this:

    TERM=${TERM%-256color} emacsclient -t -a "" "$@"
    

    No matter which method is chosen, we have to degrade to 8-bit color in terminal before the bug is fixed!