I3: Difference between revisions

From wikinotes
Line 39: Line 39:
|}
|}
</blockquote><!-- Notes -->
</blockquote><!-- Notes -->
= Install =
<blockquote>
<source lang="bash">
sudo pacman -S i3  # i3 package
packer -S i3blocks  # custom i3 status bar
sudo pacman -S \
    acpi  \ # battery
    systat  # system info
</source>
</blockquote><!-- install -->


= Usage =
= Usage =

Revision as of 21:48, 6 August 2021

i3 is a tiling window manager for xorg


Documentation

user guide https://i3wm.org/docs/userguide.html
homepage https://i3wm.org/docs/
IPC documentation https://i3wm.org/docs/ipc

Locations

Configs
~/.i3/config Main Config File
~/.i3blocks.conf i3Blocks (statusbar) config

Notes

i3 install
i3 configuration
i3 usage

Usage

Container Management

Split-Vertical ($mod-v), or Stack-Vertical($mod-a) will create a container above your window.
New windows created while this container's windows are focused will be arranged as configured.

You may also select the parent container and change how it's stack will work.


Example

1. you have 2x windows you want to stack vertically

$mod+a  # select parent container
$mod+u  # stack vertically

2. you want to create a 3rd window, outside of the stack in a vert split

$mod+a            # select parent container
$mod+v            # split horizontally
$mod+shift+enter  # create 3rd window

3. continuing to use layout

# new windows from container selections will be created inside container
# new windows created from the vert split will be stacked that way
# you can use this to have multiple independently stacked vert-splits

Startup

sudo xinit /usr/bin/i3                   # manually start i3

i3-msg 'debuglog on; shmlog on; reload'  # reload with debug enabled
DISPLAY=:0 i3-dump-log | less -Ri        # show log

i3-msg (IPC)

After choosing a location for i3's IPC socket, you can communicate with it using the commandline utility i3-msg.

See the exceptionally helpful man page for more information on commands.

i3-msg -t get_workspaces  # list workspace info, active, etc.
i3-msg -t get_outputs     # list monitors, active, etc.
ie-msg restart            # issue i3 commands over IPC

GTK/Qt Themes

See Linux Themes.

Extensions

extensions
i3blocks menubar for i3, similar to xmobar/dzen
libraries
i3ipc https://github.com/acrisci/i3ipc-python/tree/master/examples

Tips/Tricks

Hiding Mouse

Having the mouse in the middle of the screen gets annoying. Originally I solved this by using xdotool, but due to it's interference when using controllers in games, I switched to a much cleaner solution unclutter.

### xdotool method (old)
# DESC: for every window-operation, move the mouse to the bottom of the display
#
bindsym		$mod+h				focus left     ;exec "xdotool mousemove_relative --sync 0 1000"
### unclutter method (new)
#
#
unclutter -idle 5

10 workspaces per-monitor

I was able to do this by leveraging python python-xlib, parxing xrandr output, and issuing commands to i3-msg (in reality, to the i3 ipc-socket).

References
https://github.com/xevz/dotfiles/blob/master/.i3/config.base
https://www.reddit.com/r/i3wm/comments/36diri/can_i_alter_the_multimonitor_behaivour/

window border colour

#                     {bg color}
client.focused #859900 #859900 #fdf6e3 #859900