Difference between revisions of "I3/Beginners Customization Guide"

From ArchWiki
< I3
Jump to: navigation, search
(added new content)
m (redirect to I3#Configuration)
 
(23 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:i3 Beginners Customization Guide}}
+
#REDIRECT [[I3#Configuration]]
[[Category:Tiling WMs]]
+
[[Category:Dynamic WMs]]
+
 
+
[http://i3wm.org/ i3] is a dynamic [[Wikipedia:Tiling window manager|tiling window manager]].  i3 is very fast and powerful. To be most productive you will want to configure it to your liking.  This guide will assist you in your i3 desktop customization.  If you are accustomed to using a full Desktop Environment like Gnome, KDE, or Xfce this will greatly help to ease the transition to i3.
+
 
+
== Prerequisits ==
+
You should have already installed the {{Pkg|i3}} window manager from the [[official repositories]].  If not, Please see [[I3]] for installation instructions.
+
 
+
It is also strongly recommended to read the official i3 [http://i3wm.org/docs/userguide.html User Guide]
+
 
+
== Configuration ==
+
 
+
=== i3statusbar ===
+
 
+
First we need to copy over the default configuration files that we will be working with to our home directory.
+
 
+
cp /etc/i3/config ~/.i3/config
+
cp /etc/i3status.conf ~/.i3status.conf
+
 
+
==== Network Interface Status ====
+
 
+
Now we can fix the status bar (i3status) at the bottom of the screen.  If you recently installed Arch Linux then you will be using the new systemd/udev [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ Predictable Network Interface Naming scheme]. As a result we need to change the references for eth0 (ethernet) and wlan0 (wireless) to match your system. To view your available network interfaces use the command {{ic|ip link}}
+
 
+
Here is an example output of what you will see:
+
 
+
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
+
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
+
2: enp6s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
+
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
+
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000
+
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
+
 
+
From the example we can see that ethernet interface is labelled enp6s0 and the wireless interface is wilp3s0.  Your interface names may vary. Edit the file {{ic|~/.i3status.conf}}
+
 
+
Replace the lines:
+
 
+
order += "wireless wlan0"
+
order += "ethernet eth0"
+
wireless wlan0 {
+
wireless eth0 {
+
 
+
To match your corresponding network interface names:
+
 
+
order += "wireless wlp3s0"
+
order += "ethernet enp6s0"
+
wireless wlp3s0 {
+
ethernet enp6s0 {
+
 
+
{{Note|wlp3s0 and enp6s0 are only used as examples. Enter your own network interface names here.  If you are using eth0 and wlan0 then you do not need to change them.}}
+
 
+
==== Temperature Status ====
+
 
+
If you would like to add your CPU temperature to the i3status bar simply add these lines to {{ic|~/.i3status.conf}}
+
 
+
order += "cpu_temperature 0"
+
cpu_temperature 0 {
+
        format = "T: %degrees °C"
+
    max_threshold = 65
+
        path = "/sys/devices/platform/coretemp.0/temp1_input"
+
}
+
 
+
If the temperature column complains that it cannot get the temperature value then change the path line to:
+
 
+
path = "/sys/class/thermal/thermal_zone0/temp"
+
 
+
=== Volume Manager ===
+
 
+
To enable easy management of your system volume, you can install a volume manager applet such as [https://aur.archlinux.org/packages/pa-applet-git/ pa-applet] from the [https://aur.archlinux.org/ AUR].  This should also allow you to use your keyboards volume up, volume down, and mute keys as well as using the applet directly to manage your volume.  Once it is installed add the following line to your {{ic|~/.i3/config}} to auto start the applet:
+
 
+
exec /usr/bin/pa-applet
+
 
+
=== Network Manager ===
+
 
+
If you would like to use the Network Manager applet to manage your network connections you can install it with the command:
+
 
+
# pacman -S networkmanager network-manager-applet
+
 
+
To have the Network Manager daemon auto start at bootup use the command:
+
 
+
# systemctl enable NetworkManager
+
 
+
{{Note|If there are any other services managing your network interfaces (ie netctl) then you must disable them before starting Network Manager.}}
+
 
+
Finally add the the following line to your {{ic|~/.i3/config}} to automatically start the Network Manager applet in your system tray
+
 
+
exec /usr/bin/nm-applet
+
 
+
=== Workspace Names ===
+
 
+
Although it is not required, many people prefer naming frequently used workspaces. First you need to determine which monitor you want the workspace to open to. Simply type {{ic|xrander}} into a terminal and it will show you the available display ports. Some common ones are LVDS1 for laptops or VGA1, HDMI1, HDMI2, etc for external monitors. If you are using [[Multihead#Xinerama|Xinerama]] instead use the outputs xinerama-0, xinerama-1, etc.  Add your workspace names to {{ic|~/.i3/config}} You also need to modify the corresponding lines to switch to your workspaces as well as moving focused containers to those workspaces.
+
 
+
# Workspace names
+
workspace "1:Web" output LVDS1
+
workspace "2:Mail" output LVDS1
+
workspace "3:Irc" output LVDS1
+
workspace "4:Shell" output LVDS1
+
 
+
# switch to workspace
+
bindsym $mod+1 workspace 1:Web
+
bindsym $mod+2 workspace 2:Mail
+
bindsym $mod+3 workspace 3:Irc
+
bindsym $mod+4 workspace 4:Shell
+
 
+
# move focused container to workspace
+
bindsym $mod+Shift+1 move container to workspace 1:Web
+
bindsym $mod+Shift+2 move container to workspace 2:Mail
+
bindsym $mod+Shift+3 move container to workspace 3:Irc
+
bindsym $mod+Shift+4 move container to workspace 4:Shell
+
 
+
=== Launching programs on specific workspaces ===
+
 
+
=== Desktop Wallpaper ===
+
 
+
To be able to manage the desktop wallpaper, you need a lightweight image viewer like [[Feh]] or [[Nitrogen]].  Install feh with the command {{ic|# pacman -S feh}}. Then you can set your wallpaper with the following command:
+
 
+
$ feh --bg-scale /path/to/image.file
+
 
+
To have feh set your image to the Desktop Wallpaper add the following line to your {{ic|~/.i3/config}}
+
 
+
exec --no-startup-id sh ~/.fehbg
+
 
+
=== Terminal Emulator ===
+
 
+
=== Scratchpad ===
+
 
+
=== Shutdown, Reboot, Lock Screen ===
+
As there are no Shutdown, Reboot, or Lock Screen buttons, we can add some hotkey combinations to help us out.  First we need to create this script and save it as {{ic|i3exit}}.  Remember to to make it executable with {{ic|chmod +x}} and to place it somewhere in your $PATH.
+
 
+
#!/bin/sh
+
lock() {
+
    i3lock
+
}
+
+
case "$1" in
+
    lock)
+
        lock
+
        ;;
+
    logout)
+
        i3-msg exit
+
        ;;
+
    suspend)
+
        lock && systemctl suspend
+
        ;;
+
    hibernate)
+
        lock && systemctl hibernate
+
        ;;
+
    reboot)
+
        systemctl reboot
+
        ;;
+
    shutdown)
+
        systemctl poweroff
+
        ;;
+
    *)
+
        echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
+
        exit 2
+
esac
+
+
exit 0
+
 
+
 
+
Now add the following lines to your {{ic|~/.i3/config}} Once completed you will be presented with a prompt whenever you press $mod+pause.
+
 
+
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
+
mode "$mode_system" {
+
    bindsym l exec --no-startup-id i3exit lock, mode "default"
+
    bindsym e exec --no-startup-id i3exit logout, mode "default"
+
    bindsym s exec --no-startup-id i3exit suspend, mode "default"
+
    bindsym h exec --no-startup-id i3exit hibernate, mode "default"
+
    bindsym r exec --no-startup-id i3exit reboot, mode "default"
+
    bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" 
+
 
+
    # back to normal: Enter or Escape
+
    bindsym Return mode "default"
+
    bindsym Escape mode "default"
+
}
+
bindsym $mod+Pause mode "$mode_system"
+
 
+
== See also ==
+
* [[Comparison of Tiling Window Managers]]
+
* [http://i3wm.org Official website]
+
* [http://code.stapelberg.de/git/i3 Source code]
+
* [https://wiki.archlinux.org/index.php/Systemd#Suspend.2Fresume_service_files Suspend/resume service files]
+
* [https://github.com/ashinkarov/i3-extras Collection of scripts and patches]
+
'''Arch Linux Forums'''
+
* [https://bbs.archlinux.org/viewtopic.php?id=99064 ''The i3 thread''] - A general discussion about i3
+
* [https://bbs.archlinux.org/viewtopic.php?pid=1229978 ''i3 desktop screenshots and config sharing'']
+

Latest revision as of 05:52, 29 August 2013

Redirect to: