GNOME

From StrelaWiki
Jump to navigation Jump to search

GNOME 3.22 (Fedora 25)

Intro

  • GNOME 3 pre svoje fungovanie potrebuje v podstate iba DBus service (sucast freedesktop.org projektu)
  • Bola vykonana (zatial este nie uplna) migracia z GConf (GNOME 2) na GSettings (GNOME 3)
    • dconf (low-level configuration system) is only the GSettings backend. Most applications will not want to interface directly with dconf, but rather with GSettings
  • Commandline konfiguracny nastroj gsettings v GNOME 3 zamiena predosly gconftool-2 z GNOME 2
  • Analogicky GUI aplikacia dconf-editor v GNOME 3 zamiena predosly gconf-editor z GNOME 2
  • gsettings nemoze zmenit hodnotu kluca pokial nebezi DBus service (napr. problemy s X-serverom), mozno vsak pouzit dbus-launch utilitu
$ dbus-launch gsettings get org.gnome.desktop.session session-name
'gnome'                                                                               # default GNOME 3
$ dbus-launch gsettings set org.gnome.desktop.session session-name 'gnome-fallback'   # rezim spatnej kompatibility (hardware cannot handle graphics acceleration)
  • Kedze este nebola zavrsena plna migracia z Gconf na GSettings, pre plnu konfigurovatelnost GNOME 3 sa moze okrem predurceneho gsettings (resp. GUI ekvivalent dconf-editor) pouzivat aj gconftool-2 (resp. GUI gconf-editor). Pre realny zivot je vsak uz takmer (GNOME > 3.14) plna migracia na GSettings.

Configuration

GUI tools

gnome-control-center (basic)

configuration utilities for the GNOME desktop

gnome-tweak-tool (advanced)

application for changing the advanced settings

dconf-editor (expert)

allows you to browse and modify dconf databases

Commandline interface

gsettings list-recursively > gsettings.all
gsettings list-recursively org.gnome.desktop.background

gsettings reset org.gnome.desktop.interface gtk-enable-primary-paste          # Middle Click Paste (true)
gsettings reset org.gnome.desktop.peripherals.touchpad disable-while-typing   # (true)

GSettings schemas

  • At runtime, GSettings looks for schemas in the glib-2.0/schemas/ subdirectories of all directories specified in the XDG_DATA_DIRS environment variable. The usual location to install schema files is /usr/share/glib-2.0/schemas/
  • Uzivatel moze pridat svoju directory (napr. ~/.local/share/glib-2.0/schemas/) nastavenim premennej export XDG_DATA_DIRS=~/.local/share:/usr/share
  • Ina moznost je specifikovat directory, kde sa ma hladat schema, napr.
gsettings --schemadir ~/.local/share/gnome-shell/extensions/system-monitor@paradoxxx.zero.gmail.com/schemas/ get org.gnome.shell.extensions.system-monitor move-clock
  • glib-compile-schemas kompiluje vsetky GSettings XML schemas files v jeden binarny file gschemas.compiled, ktory potom cita GSettings
$ ln -s ~/.local/share/gnome-shell/extensions/system-monitor@paradoxxx.zero.gmail.com/schemas/org.gnome.shell.extensions.system-monitor.gschema.xml \
  /usr/share/glib-2.0/schemas/
$ glib-compile-schemas /usr/share/glib-2.0/schemas/
gsettings get org.gnome.shell.extensions.system-monitor move-clock

Windows Management

Clutter
Library for creating fast, hardware-accelerated (OpenGL), visually rich graphical user interfaces
Mutter & Muffin
Window and compositing managers. Mutter & Muffin combines the Clutter toolkit with solid window-management inherited from the Metacity window manager
Mutter used as the display core of a larger system such as GNOME Shell or Moblin (default manager for GNOME 3 in Fedora)
Muffin used as the display core of a larger system such as Cinnamon (non-default in Fedora)

Metacity
Window manager that was used by default in the GNOME 2 desktop. Since Gnome 3.16 metacity themes are no more supported. Mutter no longer uses Metacity themes.

Themes

  • Vsetky themes subory sa nachadzaju v /usr/share/themes/<themeName>/, resp. ~/.themes/<themeName>/ directory
  • Zmena celej theme, resp. desktop-u (odhliadnuc od icons a cursors), zahrna zmenu dvoch sub-theme:
    • Shell theme - themes/<themeName>/gnome-shell/
    uzivatel moze vyberat, menit GNOME Shell theme az po nainstalovani extensions dnf install gnome-shell-extension-user-theme
    • GTK+ Theme - themes/<themeName>/{gtk-2.0,gtk-3.0}/
    • Current (Window) theme - themes/<themeName>/metacity-1/
  • Themes je mozne velmi jedoducho vyberat, menit pomocou gnome-tweak-tool v menu Appearance
  • Default theme pre GNOME 3 (a zaroven aj pre Fedora) je Adwaita, rozne ine themes:

Customizing

  • Najoptimalnejsi sposob ako menit niektore nastavenia v Shell alebo GTK+ themes je vytvorit kvazi novu theme, ktora je odvodena od povodnej theme. Window theme, resp. Metacity nie je mozne derivovat
  • Customizing default Shell theme derived from default gnome-shell.css
$ wget https://raw.githubusercontent.com/musinsky/config/master/GNOME/gnome-shell.css -P /usr/share/themes/Mucha/gnome-shell/
  • Customizing default GTK+ theme (Adwaita) derived from default gtk.css
$ wget https://raw.githubusercontent.com/musinsky/config/master/GNOME/gtk.css -P /usr/share/themes/Mucha/gtk-3.0/
$ ln -s /usr/share/themes/Adwaita/gtk-2.0/ /usr/share/themes/Mucha/
  • Applying changes
gsettings set org.gnome.shell.extensions.user-theme name 'Mucha'
gsettings set org.gnome.desktop.interface gtk-theme 'Mucha'


$ mkdir -p /usr/share/themes/Mucha/metacity-1/
$ cp /usr/share/themes/Adwaita/metacity-1/metacity-theme-3.xml /usr/share/themes/Mucha/metacity-1/
  • reduce titlebar height
$ sed -i '/title_vertical_pad/s|value="[0-9]\{1,2\}"|value="2"|g' /usr/share/themes/Mucha/metacity-1/metacity-theme-3.xml
  • change titlebar color (in titlebar_fill_focused section)
$ sed -i 's/gtk:custom(wm_bg_b,gtk:bg\[NORMAL\])/blend\/#000000\/gtk:bg\[NORMAL\]\/0.8/' /usr/share/themes/Mucha/metacity-1/metacity-theme-3.xml


gsettings set org.gnome.desktop.wm.preferences theme 'Mucha'  # GNOME 3.16 is DEPRECATED

GNOME Shell

  • GNOME Shell je zakladna cast user interface v GNOME 3 (spusta aplikacie, prepina okna, ....), pouziva Mutter (compositing window manager) a je stale aktivne vyvijane
  • Prostredie GNOME Shell sa moze flexibilne upravovat pomocou roznych extensions, ktore jednoducho nacitavaju JavaScript a CSS. Je to nahrada za applets a widgets
  • Subory s GNOME Shell extensions sa nachadzaju v /usr/share/gnome-shell/extensions/<extName>/, resp. ~/.local/share/gnome‑shell/extensions/<extName>/
  • Pomocou gnome-tweak-tool aplikacie v menu Extensions je mozne (analogicky ako Themes) instalovat, zapinat/vypinat rozne extensions
  • Od verzie GNOME 3.2 je takisto mozne instalovat, zapinat/vypinat rozne extensions priamo vo web browser prostrednictvom GNOME Shell Integration plugin
  • Novy nastroj gnome-shell-extension-prefs umoznuje konfigurovat jednotlive extensions (gnome‑shell/extensions/<extName>/prefs.js subor)
gsettings get org.gnome.shell enabled-extensions     # Installed Extensions
keyboard command (Alt+F2)
'r' or 'restart' restart GNOME Shell
'rt' reload GNOME Shell theme
'lg' Looking Glass (GNOME Shell debuuger)
'debugexit' quit GNOME Shell
  • Pocnuc Fedora 24 je potrtebne instalovat browser extension (chrome-gnome-shell) pre moznu integraciu extensions pomocou browsera
$ dnf copr enable region51/chrome-gnome-shell
$ dnf install chrome-gnome-shell


Extensions

User Themes

$ dnf install gnome-shell-extension-user-theme   # is already installed with gnome-tweak-tool
AlternateTab

Applications Menu

Window List

wget -O - https://raw.githubusercontent.com/musinsky/config/master/GNOME/extension-window-list.css >> ~/.local/share/gnome-shell/extensions/window-list@gnome-shell-extensions.gcampax.github.com/stylesheet.css
system-monitor

SDIR=~/.local/share/gnome-shell/extensions/system-monitor@paradoxxx.zero.gmail.com/schemas/

gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor background '#00000000'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor move-clock false
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor icon-display false
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor cpu-show-text false
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor cpu-style 'both'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor cpu-graph-width 80
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor memory-display false
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor net-show-text false
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor net-style 'digit'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor disk-usage-style 'bar'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor thermal-display true
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor thermal-show-text false
gsettings --schemadir $SDIR set org.gnome.shell.extensions.system-monitor thermal-style 'digit'
OpenWeather

SDIR=~/.local/share/gnome-shell/extensions/openweather-extension@jenslody.de/schemas/

gsettings --schemadir $SDIR set org.gnome.shell.extensions.openweather city '48.7172,21.2497>Košice, Slovensko >-1 && 46.2601,6.0577>CERN, Switzerland >-1 && 56.7574,37.1376>Дубна, Россия >-1'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.openweather unit 'celsius'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.openweather wind-speed-unit 'kph'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.openweather pressure-unit 'hPa'
gsettings --schemadir $SDIR set org.gnome.shell.extensions.openweather use-symbolic-icons false
gsettings --schemadir $SDIR set org.gnome.shell.extensions.openweather days-forecast 5
gsettings --schemadir $SDIR set org.gnome.shell.extensions.openweather decimal-places 0
TopIcons
reduce default icons size
$ sed -i 's/Panel.PANEL_ICON_SIZE/16/g' ~/.local/share/gnome-shell/extensions/topIcons@adel.gadllah@gmail.com/extension.js
others extensions