DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Build Working Environment with i3 and Mint


Base System and i3wm Installation

Install Linux Mint 19.3 Cinnamon with Live DVD (USB key created by YUMI 2.0.5) on Dell E7450 laptop.

No need to install any hardware drivers. It simply works!

Install i3wm with sudo apt install i3 i3lock suckless-tools i3status dunst libanyevent-i3-perl.

Basic Configuration

cp /etc/i3status.conf ~/.config/i3status/config and modify the ethernet and wireless NIC name from _first_ to the actual name, for example the default ethernet name of Linux Mint 18.3 is eno1, and the default wireless card name is wlp2s0. Both the order line and the command line need to be modified.

Frequently Used Commands

Reload i3 configuration: i3-msg reload;

Restart i3 environment (preserves current layout/session, opened apps): i3-msg restart;

Startup Configurations

MDM

Mint's default graphical login manager is MDM, see New features in Linux Mint 17 Xfce. Logout of Xfce desktop. In login manager, you can find "i3", choose it, and login i3 environment. Its user level auto startup script is ~/.xsessionrc. It should be the same with .xinitrc. So make a link from it with ln -s ~/.xinitrc ~/.xsessionrc. See /etc/mdm/Xsession for variable definitions, such as USERXSESSION, USERXSESSIONRC, etc. See CustomXSession for more.

The example ~/.xsessionrc:

export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export LC_CTYPE=en_US.UTF-8
export EDITOR=nvim
setxkbmap -option caps:swapescape -option ctrl:swap_lwin_lctl -option ctrl:swap_rwin_rctl

fcitx &
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=copyq com.github.hluk.copyq &
goldendict &
/home/leo/warez/Shadowsocks-Qt5-3.0.0-x86_64.AppImage &
devmon &
xmodmap -e "poiniter =  3 2 1"
xbindkeys
xrandr --output HDMI-1 --auto --right-of eDP-1

Here the copyq line is start the CopyQ installed by flatpak, which has newer version than installed by apt.

xbindkeys is used for keyboard shortcuts for hardware. For example, volume up/down, screen brightness up/down, etc. See dsnote Define Key Binding with xbindkeys on Linux for details.

devmon for USB key management, see dsnote Automount USB Disk on Linux for details.

xrandr for dual-monitors setup.

No need to add exec i3 (like in .xinitrc) at the end of this file.

xinit

Modify the system runlevel to 3 (see note "Run Linux Without Desktop Environment") and make a copy named .xinitrc from .xsessionrc. Add exec i3 at the end of the file.

Now you can start i3wm with startx (or startx /home/leo/.xinitrc.i3) in text mode.

Input Method

Add the following lines into .xsessionrc or .xinitrc before "exec i3":

export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
fcitx &

If the IM does not work properly in terminal emulator or browser, search fcitx in dsnote "" for suggestions.

Power Management

To bind Alt-Ctrl-L to lock, and Alt-Insert to suspend, add the following lines into ~/.i3/config:

bindsym $mod+Control+l exec i3lock -c 000000
bindsym $mod+Insert exec systemctl suspend

For system reboot and shutdown, run command sudo reboot and sudo shutdown now in a console.

Config System Font

  1. List all available fonts installed: fc-list. For example, when run fc-list|grep wqy, we got the name of this pre-installed Chinese font: "WenQuanYi Micro Hei".

  2. Edit config file ~/.i3/config: replace "font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1" with "font pango:WenQuanYi Micro Hei 11".



Published

Aug 24, 2014

Last Updated

Jun 14, 2020

Category

Tech

Tags

  • i3 5
  • linux 158
  • mint 24

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor