DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

i3 Window Manager on ArchLinux


i3 is a good wm(window manager), it's powerful and easy to install. It supports system tray, app like golden-dict will have a icon in system tray after it's closed.

Install

# pacman -S xorg-server xorg-server-utils
# pacman -S xorg-xinit
# pacman -S dmenu
# pacman -Syu gnome    // use `pacman -Rsc gnome` to remove package and its dependencies
# pacman -S i3
$ echo "exec i3" >  ~/.xinitrc
$ startx

Configuration

Config file: ~/.i3/config.

Define Alt key:

set $mod Mod4

Define Win key:

set $sup Mod1

Adjust the font of titlebar:

font pango:Dejavu Sans Mono 11

Add custom keybindings:

bindsym $mod+Control+l exec i3lock -c 000000

Reload configurations (run in shell):

i3-msg reload

Application Autostart

Add start command before "exec i3" in ~/.xinitrc. For example, the following lines in ~/.xinitrc start USB stisk, clipboard and Chinese input method manager when i3wm startup:

fcitx &
parcellite &
udiskie &
xbindkeys
exec i3

Search Application

You can use dmenu as xfce4-appfinder on Xfce. For example, after install R-Studio-Desktop with yaourt -S rstudio-desktop-bin, input 'studio' in dmenu (press Alt-D to invoke it), you can find the full name of RStudio Desktop is "rstudio-bin".

Applications

Terminal and File Manager

Xfce family is small and powerful. Install them with pacman -S xfce4-terminal and pacman -S thunar. xfce4-terminal is much better for eyes than Terminator.

Web Browser

Install Chromium with sudo pacman -S chromium. Install flash plugin for Chromium with yaourt -S chromium-pepper-flash. Now you can use website which need flash support, such as Baidu Netdisk.

Text Editor

Clipboard-support enabled vim: gvim;

PDF Viewer

Evince is small and poweroff. Install it with sudo pacman -S evince.

Office Suite

WPS is OK, but the fcitx doesn't work in it.

Installed FreeOffice, it need providing Email to activate, give up.

fcitx can be used in Abiword. But Abiword is only a word processor, no spred sheets support.

Wireless Card

  1. Install wifi utilities: pacman -S iw wpa_supplicant dialog wpa_actiond;

  2. List wireless card status: iwconfig;

  3. Scan and Connect to hot point: sudo wifi-menu

  4. Remember this hot point for auto-connection later (modify the wireless name based on your machine): systemctl enable netctl-auto@wlp5s0.service;

Ref:

Wireless network configuration

netctl

Status Bar Customization

For i3status, use man i3status to determine the configuration file position, here it's ~/.config/i3status/config. Then cp /etc/i3status.conf ~/.i3status.conf as template. Modify the ethernet and wireless card name in both "order += ..." and function definition line.

Frequently used keybindings

"M" means $mod key, "S" means Shift key.

  • M-d: application launcher;

  • M-: start a termianl;

  • M-f: full screen current app;

  • M-S-q: quit

  • M-S-c: reload config without restart;

  • M-2: jump to workspace 2;

  • M-S-2: move application to workspace 2;

USB Automount & Unmount

See note "Automount USB Disk on Linux".

Power Management

First install polkit with sudo pacman -S polkit, which enable normal users run power management command without root privilege (sudo). Then add a executable script into /usr/local/bin:

cat /usr/local/bin/pm
#!/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
$ sudo chmod 755 /usr/local/bin/pm

Now using pm suspend to suspend, pm reboot to reboot, and pm shutdown to shutdown computer.

Ref: i3 on Arch Wiki.



Published

May 1, 2014

Last Updated

Jun 24, 2019

Category

Tech

Tags

  • archlinux 20
  • i3wm 6

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor