Cinnamon

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page Cinnamon and the translation is 67% complete.

Other languages:
English • ‎español • ‎français • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어

Cinnamon é um ambiente de trabalho contemporâneo com uma interface tradicional que usuários do Gnome 2, LXDE ou Xfce acharão de fácil uso. Ele possui ótimas características gráficas e funcionais. Fork do Gnome Shell e desenvolvido por Linux Mint, está disponível para as arquiteturas amd64 e x86.

Instalação

Pré-requisitos

Cinnamon funciona perfeitamente com e sem systemd. Para instalar sem as dependências do systemd, use eselect para trocar para um perfil sem Gnome, como default/linux/amd64/13.0/desktop. Para instalar com systemd, use um perfil com Gnome ativado, como default/linux/amd64/13.0/desktop/gnome/systemd. A arquitetura e versão podem ser diferentes em ambos os casos.

Para ver a lista dos perfis do sistema disponíveis:

root #eselect profile list
[1] default/linux/amd64/13.0
[2] default/linux/amd64/13.0/selinux
[3] default/linux/amd64/13.0/desktop
[4] default/linux/amd64/13.0/desktop/gnome
[5] default/linux/amd64/13.0/desktop/gnome/systemd
etc.

OpenRC

Ao usar OpenRC, escolha o perfil do sistema correto:

root #eselect profile set default/linux/amd64/13.0/desktop

Também é possível usar o número associado ao perfil de acordo com a lista acima:

root #eselect profile set 3

Leia as instruções disponíveis no artigo Gentoo Sem Systemd

Systemd

Para o Cinnamon com suporte ao systemd, selecione o perfil GNOME desktop que termina com systemd:

root #eselect profile set default/linux/amd64/13.0/desktop/gnome/systemd
Note
A arquitetura do sistema (amd64) e a versão (13) podem ser diferentes contanto que o trecho final seja /gnome/systemd.

Xorg

É claro que para o Cinnamon funcionar, Xorg precisa estar instalado e configurado. Tenha certeza de ter um servidor X configurado antes de proceder com esse artigo. Caso necessário, teste o Xorg como detalhado na seção Usando startx do guia Xorg Gentoo.

Cinnamon (e outras aplicações) são internacionalizadas, suportando diversas línguas (Linguas). Caso isso não tenha sido feito durante a instalação incial do Gentoo, adicione a língua apropriada ao valor da variável LINGUAS em make.conf:

FILE /etc/portage/make.confConfigurar o make.conf para código da língua francesa
LINGUAS="fr" # ou en, de, it, es, etc.

É recomendado instalar x11-libs/gtk+extra e apenas em Xorg com versão anterior a 1.17, x11-drivers/xf86-video-modesetting pois torna a experiência do Cinnamon mais completa.

  • Com Xorg anterior a 1.17:
root #emerge --ask x11-libs/gtk+extra x11-drivers/xf86-video-modesetting
  • Xorg a partir de 1.17:
root #emerge --ask x11-libs/gtk+extra

USE flags

USE flags for gnome-extra/cinnamon A fork of GNOME Shell with layout similar to GNOME 2

gtk-doc Build and install gtk-doc based developer documentation for dev-util/devhelp, IDE and offline use
networkmanager Enable net-misc/networkmanager support
nls Add Native Language Support (using gettextGNU locale utilities)

Encontre mais informações sobre Pyhton targets no artigo do projeto Python PYTHON TARGETS.

Algumas USE flags, icu, pulseaudio e gnome-keyring, são necessárias para as dependências do Cinnamon. Caso não estejam habilitadas ainda, deixe emerge --ask gnome-extra/cinnamon criar ou atualizar package.use (ou package.use/cinnamon, ou package.use/outroNome) por si só, ou habilite as USE flags manualmente.

Emerge

Finalmente, após todos os passos acima, peça para o Portage emergir o Cinnamon:

root #emerge --ask gnome-extra/cinnamon
Note
A duração da compilação do net-libs/webkit-gtk pode ser muito longa, especialmente em hardwares mais antigos. Seja paciente, o Cinnamon vale a pena!

Configuração do Sistema

Antes de olhar as customizações de temas do Cinnamon, configure o sistema para iniciar o Cinnamon corretamente em tempo de boot ou a pedido do usuário, e habilite as configurações corretas de delegação de privilégios para que os usuários finais possam interagir com o sistema de forma intuitiva.

Serviços

As instruções seguintes mostram como lidar com o OpenRC. Com systemd, use systemctl como detalhado na página do systemd.

dbus e consolekit

O servidor Xorg e o Cinnamon precisam dos serviços dbus e consolekit, garanta que eles serão iniciados durante o boot:

root #rc-update add dbus default
root #rc-update add consolekit default

Em seguida, inicie os serviços (não é necessário reiniciar o sistema):

root #rc-service dbus start
root #rc-service consolekit start

NetworkManager

NetworkManager is a Cinnamon dependency and is not needed if the network was configured during the initial Gentoo installation. It should not run concurrently with another network service. If NetworkManager is desired be sure to disable other network management programs or services before starting it. For example, if the system was originally configured to use Gentoo's netifrc scripts to manage the network connections, disable these network services:

root #rc-service net.eth0 stop
root #rc-update del net.eth0 default
Note
When using sys-fs/udev network interfaces will be using Predictable Network Interface Names to name the active interfaces. This will produce names like enp12s0, eno1, enp2s0, etc. When using sys-fs/eudev, the Gentoo udev fork avoiding systemd dependencies, the first network interface name is often still called eth0.

Após remover outros serviços de rede, adicione o NetworkManager:

root #rc-service NetworkManager start
root #rc-update add NetworkManager default

Desabilitando o applet do NetworkManager

If NetworkManager is not used, it's applet can be disabled in Cinnamon panel as explained in Arch Linux Wiki Cinnamon page. Copy /etc/xdg/autostart/nm-applet.desktop to ~/.config/autostart/nm-applet.desktop, then add the disabling command and finally change file ownership:

root #cp /etc/xdg/autostart/nm-applet.desktop /home/userName/.config/autostart/nm-applet.desktop
root #echo 'X-GNOME-Autostart-enabled=false' >> /home/userName/.config/autostart/nm-applet.desktop
root #chown userName:userName /home/userName/.config/autostart/nm-applet.desktop

Sudo

Para um usuário comum reiniciar ou desligar o sistema pelo Cinnamon, sudo é necessário com algumas configurações.

Primeiro, instale app-admin/sudo:

root #emerge --ask app-admin/sudo

Em seguida, modifique a configuração do sudo com o commando visudo:

root #visudo

Visudo usa o editor de texto padrão para atualizar o arquivo sudoers. Troque username no texto abaixo com o nome de usuário de cada um que usará o Cinnamon:

FILE /etc/sudoers
username  ALL=(root) NOPASSWD: /sbin/reboot
username  ALL=(root) NOPASSWD: /sbin/halt
username  ALL=(root) NOPASSWD: /sbin/poweroff
username  ALL=(root) NOPASSWD: /sbin/shutdown

Ou para o grupo wheel:

FILE /etc/sudoers
%wheel  ALL=(root) NOPASSWD: /sbin/reboot
%wheel  ALL=(root) NOPASSWD: /sbin/halt
%wheel  ALL=(root) NOPASSWD: /sbin/poweroff
%wheel  ALL=(root) NOPASSWD: /sbin/shutdown

Regras e ações de Polkit

Para um usuário comum executar ações que requerem privilégios elevados no Cinnamon, policy kit deve estar configurado. Use pkaction para ver a lista de ações; elas devem ser autoexplicativas:

root #pkaction
org.cinnamon.settings-daemon.plugins.power.backlight-helper
org.cinnamon.settings-users
org.cinnamon.settingsdaemon.datetimemechanism.configure
org.freedesktop.ModemManager1.Contacts
org.freedesktop.ModemManager1.Control
org.freedesktop.ModemManager1.Device.Control
org.freedesktop.ModemManager1.Firmware
org.freedesktop.ModemManager1.Location
org.freedesktop.ModemManager1.Messaging
org.freedesktop.ModemManager1.USSD
org.freedesktop.NetworkManager.enable-disable-network
org.freedesktop.NetworkManager.enable-disable-wifi
etc.

A forma mais simples é autorizar todas as ações testando a filiação ao grupo wheel. Coloque um arquivo JavaScript com a extensão .rules em /etc/polkit-1/rules.d, chamado por exemplo 55-allowing-all-actions.rules:

FILE /etc/polkit-1/rules.d/55-allowing-all-actions.rulesHabilitando uma regra geral do polkit
polkit.addRule (function (action, subject)
{
  if (subject.isInGroup ("wheel"))
  {
    return polkit.Result.YES;
  }
});

To only authorize some actions, the action names must be iterated. For a wheel group user to suspend, hibernate, shutdown and restart the system, make a 55-allowing-actions.rules file like so:

FILE /etc/polkit-1/rules.d/55-allowing-actions.rulesSetting polkit rules
polkit.addRule (function (action, subject)
{
  if (action.id == "org.freedesktop.upower.hibernate" ||
      action.id == "org.freedesktop.upower.suspend" ||
      action.id == "org.freedesktop.consolekit.system.stop" ||
      action.id == "org.freedesktop.consolekit.system.restart" &&
      subject.isInGroup ("wheel"))
      {
        return polkit.Result.YES;
      }
});

Various actions can be added: those to change color profiles, use Nemo (Cinnamon files manager) as root, mount and eject media, set screen backlight, use network manager, change wallpaper, etc. Several polkit.addRule (function (action, subject){ … }); blocks can be used next to each other as well, and several files can be added.

Important
/etc/polkit-1/rules.d/50-default.rules already exists. Newly created file(s) names should begin with a number bigger than 50, 55 for example, so they are processed after the 50-default.rules file. Do not make a file which would be processed before it, for instance one beginning with 45.

Iniciando o Cinnamon

When not using a login/display manager, make a .xinitrc file in the user's home directory, starting ConsoleKit, D-Bus and Cinnamon sessions:

FILE ~/.xinitrcComando de execução do Cinnamon
exec ck-launch-session dbus-launch cinnamon-session

Para iniciar Xorg e Cinnamon, execute startx após o login:

user $startx

Com um gerenciador de display, siga as instruções de display manager.

Temas

Ícones Mint-X

Por padrão, Cinnamon vem com ícones Gnome.Ícones Mint-X estão no Github. Baixe, extraia e coloque o conjunto de ícones Mint-X em /usr/share/icons:

root #mv caminhoParaArquivoExtraido/mint-x-icons-master/usr/share/icons/Mint-X /usr/share/icons/Mint-X

Em seguida, crie uma cache para os ícones:

root #gtk-update-icon-cache /usr/share/icons/Mint-X

The new icon set can be selected in Cinnamon Control Center. Mint-X icons are green, but other icon sets with different colors can be installed too, like Mint-X-Grey or Mint-X-Orange. Make sure to create a cache for these as well.

Important
Colored icons sets rely on Mint-X icon set: always install it, with or without colored icons sets.

Cor do texto dos ícones da área de trabalho

Note
Desktop icons text color is now white in Cinnamon version 2.6.13, so this chapter applies to older Cinnamon versions… and remains a good introduction to Cinnamon theming.

An icon's text color in Cinnamon desktop is black by default, which is not always readable. The instructions to change this color depends on the GTK+ 3 version that the system is using. Get the currently used version with:

user $emerge --info x11-libs/gtk+
  • In GTK+ versions less than 3.13.3, this setting can only be changed system-wide. Change the text color by adding CSS rules to the /usr/share/themes/Adwaita/gtk-3.0/gtk.css file (Adwaita is the default theme coming with GTK+), after the @import line:
FILE /usr/share/themes/Adwaita/gtk-3.0/gtk.cssCSS rules for GTK+ < 3.13.3
@import url("resource:///org/gnome/adwaita/gtk-main.css");
 
/* added css rules */
.nemo-desktop.nemo-canvas-item {
  color: #fff;  /* #fff is white web color indication, #333 should be dark grey */
}
 
.nemo-desktop.nemo-canvas-item:selected {
  background-color: alpha (#fff, 0.2);  /* 0.2 is transparency level */
}
The 2nd rule concerns the selected desktop icon and can be modified to get another background color or set the transparency.
  • In more recent GTK+ versions (3.13.3 onward), this must be tuned through a user-specific configuration file. Adwaita is now included in GTK+ as the theme replacing Raleigh, so rules must be set in the user's home directories. The file to edit is ~/.config/gtk-3.0/gtk.css (create ~/.config/gtk-3.0/ directory if needed), and the change is now without the @import line. Additionally in this example, the left Nemo side bar is gray colored:
FILE ~/.config/gtk-3.0/gtk.cssCSS rules for GTK+ ≥ 3.13.3
.nemo-desktop.nemo-canvas-item {
  color: #fff;
}
 
.nemo-desktop.nemo-canvas-item:selected {
  background-color: alpha (#fff, 0.2);
}
 
NemoWindow .sidebar, NemoWindow .sidebar .view {
  background-color: #444;
  color: #eee; /* light grey */
}

Temas Mint-X

Cinnamon comes with a default cinnamon theme, obviously... The Mint-X themes are available for download on GitHub. Download them, unzip, and copy to /usr/share/themes if needed. They can be selected in the Cinnamon Control Center.

Playing with themes

Almost all theme settings can be changed in the cinnamon.css file in the theme directory.

For example with the Cinnamon theme, which is not in /usr/share/themes but in /usr/share/cinnamon/theme, first copy the theme's directory to a user .themes sub-directory, named for example other-cinnamon, which will be the new theme name:

root #mkdir /home/userName/.themes/other-cinnamon
root #cp -R /usr/share/cinnamon/theme /home/userName/.themes/other-cinnamon/cinnamon
root #chown -R userName:userName /home/userName/.themes/other-cinnamon

Edit ~/.themes/other-cinnamon/cinnamon/cinnamon.css. The results of the changes can be viewed immediately by selecting another theme in Cinnamon Control Center, then reselecting the theme being changed.

Common applications

Terminais

Gnome popular applications

A number of popular applications are available as well, built for Gnome and working flawlessly in Cinnamon:


root #emerge --ask gnome-extra/gnome-calculator media-gfx/gnome-screenshot media-gfx/eog app-text/evince gnome-extra/gnome-system-monitor app-arch/file-roller app-cdr/brasero app-editors/gedit

Applications without Gnome

Also working flawlessly in Cinnamon:


Compile app-text/qpdfview and media-video/vlc with qt5 USE flags to get a GUI.

Solução de problemas

If problems occur, try to get access to the live error messages. These can be displayed on a separate (virtual) terminal or in a log file. If the messages cannot be found, try starting Cinnamon from the command line rather than through a display manager. Alternatively have a look at /var/log/Xorg.0.log.

When the error or warning messages are not sufficient to troubleshoot Cinnamon, start it with the --debug parameter to get more detailed Xorg messages:

FILE ~/.xinitrcCinnamon debug launch
exec cinnamon-session --debug

If Cinnamon cannot launch, deleting (or renaming) .cinnamon in the home directory is not enough: other Cinnamon or Gnome items must be deleted (or renamed) too before X restarts. These can be found in the .cache, .config and .local XDG directories. .gnome2 can be deleted (or renamed) entirely.

Veja também

Recursos externos