Para configurar um ambiente gráfico otimizado para hardware Intel em sisetmas Gentoo, é necessário realizar uma série de ajustes no sistema.
Comece criando o arquivo de inicialização X11:
# Configuração do ambiente X11
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
# Inicialização do D-Bus antes do input method
eval `dbus-launch --sh-syntax --exit-with-session`
# Configuração do método de entrada
export GTK_IM_MODULE=xim
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
exec i3
Identifique sua placa gráfica Intel. Para processadores como o i5 480m (geração 5), configure o arquivo /etc/portage/make.conf:
VIDEO_CARDS="intel i965"
USE="glamor"
Configure o driver de vídeo em /etc/X11/xorg.conf.d/20-intel.conf:
Section "Device"
Identifier "Intel Graphics"
Driver "modesetting"
Option "AccelMethod" "glamor"
Option "DRI" "3"
EndSection
Adicione seu usuário ao grupo de vídeo:
gpasswd -a seu_usuario video
Resolução de Problemas de Hardware
Para evitar travamentos relacionados a VAAPI/H.264 em hardware Intel, habilite no kernel:
Device Drivers --->
[*] IOMMU Hardware Support --->
[*] Support for Intel IOMMU using DMA Remapping Devices
[*] Enable Intel DMA Remapping Devices by default
Instalação de Pacotes Essenciais
Instale os compoenntes básicos do ambiente gráfico:
emerge --ask x11-wm/i3 x11-misc/dmenu x11-misc/i3status
emerge --ask x11-terms/rxvt-unicode[256-color,perl,wcwidth,xft,-vanilla]
emerge --ask www-client/google-chrome
Configuração do Terminal
Personalize o terminal em ~/.Xresources:
URxvt*font: xft:Inconsolata:size=12:antialias=true, xft:wqy-bitmapsong:size=10
URxvt*boldfont: xft:Inconsolata:size=12:weight=bold, xft:wqy-bitmapsong:size=10:weight=bold
Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
URxvt.scrollBar: true
URxvt.scrollBar_right: true
URxvt.inputMethod: fcitx
# Extensões Perl
URxvt.perl-ext-common: default,selection-to-clipboard,pasta,matcher,keyboard-select
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.url-launcher: /usr/bin/google-chrome-stable
URxvt.keysym.Control-Shift-V: perl:pasta:paste
URxvt.clipboard.autocopy: true
# Paleta de cores personalizada
URxvt*background: #000000
URxvt*foreground: #B2B2B2
URxvt*color0: #000000
URxvt*color1: #B21818
URxvt*color2: #18B218
URxvt*color3: #B26818
URxvt*color4: #1818B2
URxvt*color5: #B218B2
URxvt*color6: #18B2B2
URxvt*color7: #B2B2B2
URxvt*color8: #686868
URxvt*color9: #FF5454
URxvt*color10: #54FF54
URxvt*color11: #FFFF54
URxvt*color12: #5454FF
URxvt*color13: #FF54FF
URxvt*color14: #54FFFF
URxvt*color15: #FFFFFF
Configuração do Gerenciador de Janelas
Configure o i3 em ~/.config/i3/config:
# Configuração de fontes
font pango:wqy-microhei 10
font pango:fontawesome 10
set $Mod Mod4
# Modos de lançamento
bindsym $Mod+o mode "$mode_launcher"
mode "$mode_launcher" {
bindsym b mode "$browser_mode"
bindsym e mode "$editor_mode"
bindsym i mode "$ide_mode"
bindsym r mode "$reader_mode"
bindsym Escape mode "default"
bindsym Return mode "default"
}
mode "$browser_mode" {
bindsym c exec google-chrome-stable
bindsym Escape mode "default"
}
# Aplicativos de sistema
exec_always --no-startup-id compton -b
exec_always --no-startup-id urxvtd --quiet --opendisplay --fork
exec_always --no-startup-id fcitx -r
# Atalhos principais
bindsym $Mod+Return exec urxvtc -sh 50
bindsym $Mod+d exec dmenu_run
bindsym $Mod+Shift+q kill
# Navegação
bindsym $Mod+j focus left
bindsym $Mod+k focus down
bindsym $Mod+l focus up
bindsym $Mod+semicolon focus right
# Movimentação de janelas
bindsym $Mod+Shift+j move left
bindsym $Mod+Shift+k move down
bindsym $Mod+Shift+l move up
bindsym $Mod+Shift+semicolon move right
# Comandos de workspace
bindsym $Mod+1 workspace 1
bindsym $Mod+2 workspace 2
bindsym $Mod+Shift+1 move container to workspace 1
bindsym $Mod+Shift+2 move container to workspace 2
# Barra de status
bar {
status_command i3status
}
Monitoramento do Sistema
Configure o monitoramento em ~/.config/i3status/config:
order += "cpu_temperature 0"
cpu_temperature 0 {
format = "Temp: %degrees °C"
max_threshold = 65
path = "/sys/devices/platform/coretemp.0/temp1_input"
}
Configuração do Shell
Personalize o bash em ~/.bashrc:
if [[ $- != *i* ]] ; then
return
fi
export PATH="/home/seu_usuario/bin:${PATH}"
export LANG="en_US.UTF-8"
export LC_CTYPE="zh_CN.UTF-8"
alias rm='rm -i'
alias cp='cp -i'
HISTFILESIZE=2000
HISTSIZE=2000
HISTTIMEFORMAT='%F %T '
complete -cf sudo
Configure o zsh em ~/.zshrc:
autoload -U compinit promptinit colors
compinit
promptinit
colors
prompt gentoo
export HISTSIZE=2000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE
setopt correctall hist_ignore_all_dups hist_ignore_space autocd extendedglob
alias rm='rm -i'
alias cp='cp -i'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
Suporte a Idiomas
Habilite os locales necessários em /etc/locale.gen:
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
Gere os arquivos de localização:
locale-gen
Configuração de Rede e Compartilhamento
Para suporte a Samba e NFS, habilite no kernel:
File Systems --->
[*] Network File Systems --->
[*] CIFS support
[*] SMB2 and SMB3 network file system support
File systems --->
[*] Dnotify support
[*] Network File Systems --->
<*> NFS client support
<*> NFS server support
Instale os utilitários:
emerge --ask net-fs/nfs-utils net-fs/samba net-ftp/vsftpd
Configuração de Áudio
Habilite os módulos de áudio no kernel e instale:
emerge --ask media-sound/alsa-utils
gpasswd -a seu_usuario audio
rc-update add alsasound boot
Configure o dispositivo padrão em ~/.asoundrc:
defaults.pcm.!card Generic
defaults.pcm.!device 0
defaults.pcm.!ctl Generic
Integração Multi-Sistema
Para dual-boot com Windows:
emerge --ask sys-boot/os-prober
grub-mkconfig -o /boot/grub/grub.cfg
Virtualização
Instale o VirtualBox:
emerge --ask app-emulation/virtualbox-bin
emerge --ask usermode-utilities net-misc/bridge-utils
Crie script de carregamento de módulos:
#!/bin/bash
modprobe vboxdrv
modprobe vboxnetadp
modprobe vboxnetflt
modprobe vboxpci
Aplicações Adicionais
Instale softwares produtivos:
emerge --ask app-office/wps-office
emerge --ask media-gfx/feh[imagemagick,jpeg,png]
emerge --ask app-editors/emacs
emerge --ask media-video/mplayer
emerge --ask app-admin/sudo
Para desanvolvimento embarcado:
emerge --ask dev-embedded/jlink-software