Vincec's Dimension

我的 i3 桌面配置笔记

Word count: 598 / Reading time: 4 min
2018/04/15 Share

i3-wm

install

1
2
sudo pacman -S i3-wm
sudo pacman -S i3lock i3status

Basic Operation

  • mod + d: dmenu_run
  • mod + enter: Terminal
  • mod + shift + q: Quit or kill windows
  • mod + s: Stacked layout
  • mod + w: Tabbed layout
  • mod + f: Fullscreen mode
  • mod + V/H: vert. or horiz.
  • mod + arrow keys (or j , k, l, ;): Change active windows (can replace by mouse)
  • mod + shirt + arrow keys (or j , k, l, ;): Change position
  • mod + r / arrow keys (or j , k, l, ;): Reize
  • mod + shift + r: Reload i3-wm
  • mod + shift + e: Exit i3-wm / logout
  • mod + shift + num: Assgin to workspace
  • mod + num: Change workspace

Keys to use with $mod (Alt)

Keys to use with Shift+$mod

Config

  • File path

~/.config/i3/config in Arch or Manjaro

  • Media and volume keys snippet (might need to install pactl and playerctl)
    Enabling multimedia keys

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    bar {
    status_command i3status
    }

    bindsym $mod+shift+x exec i3lock

    # Pulse Audio controls
    bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
    bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
    bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound

    # Sreen brightness controls
    bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
    bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness

    # Touchpad controls
    bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad

    # Media player controls
    bindsym XF86AudioPlay exec playerctl play
    bindsym XF86AudioPause exec playerctl pause
    bindsym XF86AudioNext exec playerctl next
    bindsym XF86AudioPrev exec playerctl previous

    toggletouchpad.sh for toggling your touchpad

    1
    2
    3
    4
    5
    6
    #!/bin/bash
    if synclient -l | grep "TouchpadOff .*=.*0" ; then
    synclient TouchpadOff=1 ;
    else
    synclient TouchpadOff=0 ;
    fi
  • Make applications load on i3 startup
    exec or exec_always

  • Custom wallpaper

    1
    2
    3
    4
    #install feh
    feh --bg-scale ~/xxxxx/wallpaper.jpg
    #Add autostart
    exec_always feh --bg-scale /home/XXXX/Pictures/xxxx.jpg
  • Monitor layout

    • use xrander too complex, use arander.
    • Save in local file as /.screenlayout script file
    • Append into i3/config by exec_always
  • Rename workspace(s)

  • Change fonts and theme
    change system font

    1
    2
    3
    4
    5
    6
    7
    8
    unzip xxxxxxfont.zip
    mv *.ttf ~/.fonts/
    cd ./fonts/
    ls -al
    #change default font
    #cd to i3/config
    #font pango:monospace 8
    font pango:xxxxxxx 13

    intall lxappearance and change font and theme

    1
    2
    3
    4
    sudo pacman -S lxappearance
    #change both gtk2.0 and 3.0
    vim .gtkrc-2.0
    vim .config/gtk-3.0/settings.ini

    Emulating OS X font rendering on Linux with Infinality

    install fontconfig-infinality

  • dmenu replacement with rofi

    1
    2
    3
    4
    5
    6
    sudo pacman -S rofi
    #run rofi
    rofi -show run
    #bing into i3/config as exec_always
    bindsym $mod+d exec rofi -show run -lines 3 -eh 2 -width 100 -padding 800 -opacity "85" -bw 0 -bc "$bg-color" -bg "$bg-color" -fg "$text-color" -hlfg "#8575cd" -font "System San Francisco Display 18"
    man rofi #to see the details
  • Configuare i3lock

Reddit page: unixporn

CATALOG
  1. 1. i3-wm
    1. 1.1. install
    2. 1.2. Basic Operation
      1. 1.2.1. Keys to use with $mod (Alt)
      2. 1.2.2. Keys to use with Shift+$mod
  2. 2. Config
    1. 2.1. Related links:\