Skip to content

My windows manager configuration (including I3, Sway) and some useful software configuration

Notifications You must be signed in to change notification settings

JordanWu1997/I3_Sway_Config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I3_Sway_Config

Backup for my configuration of i3WM (X11) and SwayWM (Wayland), and configurations of applications for the working environment in X11/Wayland. For now, some functions do not work in Wayland, still searching for solutions or alternatives in Wayland. For more SwayWM details and i3WM migration progress, please check ./config/sway/README.md

Table of Contents

Click to expand/shrink

Created by gh-md-toc

Context

Click to expand/shrink

Section 1 - Demo Current Customization

Click to expand/shrink

alt text alt text

Features in My Configuration

Note: the term "window" used in this configuration actually refers to "container" in the i3 window manager

  • Dynamic Dwindling Layout: auto-split window in long-side. (Check Section 2)
  • Dynamic Master-Stack Layout: auto-split window in master-stack layout. (Check Section 2)
  • Window Auto-mark: auto-mark window for moving/swapping. (Check Section 2)
  • Pywal Integration: change color theme based on wallpaper. (Check Section 2)
  • Keyboard-driven Working Environment: (Check Section 2)
  • Customized Rofi: easy-to-use selector/launcher. (Check Section 2)
  • Customized Conky: system monitor and keybinding hinter. (Check Section 2)
  • Configuration Installer Script: script to apply this configuration. (Check Section 3)
  • Various Mode Usage: organize related functions into modes to keep keybindings simple. (Check Section 4)
  • Mouse/Trackpad Usage: empower mouse/trackpad to do more things. (Check Section 5)
  • Fully Documented Keybinding and i3-userguide-like Cheat sheet: (Check Section 6)
  • Configuration Documentation: Document my configuration setup details in ./config directory
  • Workflow Demo: theme changing, mode usage, keyboard-driven workflow (Check My Workflow Demo)

My Workflow Demo

My workflow note

Section 2 - Details of i3 Environment

Click to expand/shrink

1. My i3 Environment

Click to expand/shrink

2. Startup Programs

Click to expand/shrink

3. Wallpapers

Click to expand/shrink

4. Theme and Fonts

Click to expand/shrink

Section 3 - First Time Usage for i3

Click to expand/shrink

1. Configuration/Environment Installer

Click to expand/shrink
  • Run the installer in this git repository ./install.sh
  • Includes
    • 1. Add Environment Variables
      • Add I3_SCRIPT to $PATH to dotfile
      • Add I3_SCRIPT to dotfile
      • Add WALLPAPERI3 to dotfile
      • Note: dotfile here corresponds to $SHELL, (e.g. bash/zsh -> .bashrc/.zshrc, others -> .profile)
    • 2. Backup Old Configuration and Link/Copy New Configuration
      • Backup old configuration file $HOME/.config/* to $HOME/.config_backup directory
      • Link/Copy configuration in git repository ./config/* to $HOME/.config directory
    • 3. Install Programs for Work Environment
      • You can install them all or go through every packed installation one by one

2. Optional Configuration

Click to expand/shrink
  • Optional configuration that you can try
  • Includes
    • 1. Terminal Emulator Pywal Color Support
      • NO NEED for kitty terminal emulator if using my configuration ./config/kitty/kitty.conf
      • Add the following lines to shell (e.g. bash/zsh/fish) dotfile (e.g. ~/.bashrc/~/.zshrc/~/.config/fish/config) for pywal color support
        [ -f {$HOME}/.cache/wal/sequences ] && /usr/bin/cat {$HOME}/.cache/wal/sequences
        
    • 2. Preset Workspace Name Renaming
      • My preset workspace naming style is a combination of a capital letter (A~D) and a one-digit number (1~9+0), which has 40 workspaces in total
      • Workspace name is preset in my configuration ./config/i3/config.d/i3_workspace_name.config, you can modify it using the following syntax (the prefix number will be stripped in i3bar workspace)
        • From
          set $ws1 "1:A1" # Change 1:A1 to 1:NEW_NAME_1
          set $ws2 "2:A2" # Change 2:A2 to 2:NEW_NAME_2
          ...
          
        • To
          set $ws1 "1:NEW_NAME_1" # Now workspace 1 is renamed to 1:NEW_NAME_1
          set $ws2 "2:NEW_NAME_2" # Now workspace 2 is renamed to 2:NEW_NAME_2
          ...
          
      • After finishing renaming process, run ./config/i3/script/i3_genereate_workspace_name_list.sh
        • This is to generate a workspace name list for rofi selector for further workspace manipulation

Section 4 - Mode Usage for i3

Click to expand/shrink
  • i3 has a built-in mode function that overwrites current keybinding with preset mode keybinding
    • Like different key mappings in vim insert/normal/visual mode
  • When i3 mode is on, mode keybinding instruction shows on the i3 status bar
    • Here I use an additional i3 bar to provide more space for text
  • Shared keybindings of mode in my configuration
    • Press [Esc] or [Ctrl] + [[] (vim-style escape) to exit mode
    • Press [Enter] to go to the last level of mode and exit mode if it is already the last one
  • This part configuration can be found in
    • ./config/i3/config.d/i3_mode.config
    • ./config/i3/config.d/i3_custom.config
    • ./config/i3/config.d/i3_bar.config
    • ./config/i3/config.d/i3_gap.config

1. Keybinding-related Mode

Click to expand/shrink
  • Insert Mode ([Ctrl] + [Alt] + [i] or [Winkey] + [Ctrl] + [i])
    • Disable i3 keybindings. Press [Ctrl]+[[] to get i3 keybindings back
  • Vim Keybinding Mode ([Winkey] + [Ctrl] + [[])
    • Enable Vim keybindings for navigation, e.g. h/j/k/l. Press [Ctrl] + [[] to exit mode
  • Mouse Mode ([Ctrl] + [Alt] + [m])
    • Mouse emulator using the keyboard, e.g. move, left/right click, cursor auto-hide
      • Cursor Mode ([c])
        • Cursor auto-hiding (unclutter)

2. System-related Mode

Click to expand/shrink
  • System Mode ([Winkey] + [Shift] + [Esc])
    • System command, e.g. exit, power off, reboot, lock, hibernate
      • Device Mode ([d])
        • Turn on/off RF device, connect/disconnect Bluetooth device
  • Toolkit Mode ([Ctrl] + [Alt] + [t])
    • Tool script, e.g. pick up color, take screenshot and do OCR
      • Caffeine Mode ([c])
        • Enable/Disable caffeine (disable/enable X screen saver)
      • Keyboard Mode ([k])
        • Map keys, tune repeat key speed
      • KDE Connect Mode ([Shift] + [k])
        • KDE Connect pointer daemon
  • Display Mode ([Winkey] + [Shift] + [x])
    • Deal with multiple monitor configurations, e.g. joint monitor, mirror monitor
  • Backlight Mode ([Ctrl] + [Alt] + [x])
    • Modify monitor backlight level, blue light filter
      • Redshift Mode ([z])
        • Screen color temperature tuner, blue light filter
  • Dunst Mode ([Ctrl] + [Alt] + [n])
    • Dunst actions, including pausing or resuming Dunst
  • Open URL Mode ([Ctrl] + [Alt] + [o])
    • Open URL in web browser

3. Multimedia-related Mode

Click to expand/shrink
  • Player Mode ([Ctrl] + [Alt] + [p])
    • Player control (e.g. previous, pause-play, next, fast-forward, rewind, stop) for spt (spotify TUI front-end), player, mpv and vlc
      • Spotifyd Mode ([s])
        • Spotifyd control (e.g. enable, disable, reload) for spotifyd
      • Mpv Mode ([s])
        • Mpv control
  • Volume Mode ([Ctrl] + [Alt] + [v])
    • Volume control with pulsemixer (e.g. volume up/down, mute)

4. Window/Workspace-related Mode

Click to expand/shrink
  • Resize Mode ([Ctrl] + [Alt] + [r])
    • Resize focused window
  • Title Bar Mode ([Winkey] + [Shift] + [t])
    • Modify i3 title bar, e.g. hide/show title bar, font size
  • Mark Mode ([Winkey] + [Shift] + [m])
    • Mark/Unmark window, go/swap to/with marked window
      • Automark Mode ([a])
        • Enable/Disable automark daemon
  • Window Layout Mode ([Winkey] + [Shift] + [w])
    • Change i3 window layout, e.g. tiling, tabbed, stacking mode, auto-tiling function
      • Auto-tiling Mode ([a])
        • Set dynamic layout in i3, e.g. dwindling layout, master-stack layout
  • Workspace Mode ([Winkey] + [Shift] + [p])
    • Manipulate i3 workspace, e.g. kill, goto, moveto, swap, save, restore
      • Save Workspace Mode ([s])
        • Save workspace layout
      • Restore Workspace Mode ([r])
        • Restore workspace layout

5. Customization-related Mode

Click to expand/shrink
  • Gap Mode ([Ctrl] + [Alt] + [g])
    • Modify i3 gaps, e.g. inner gaps, outer gaps
  • Bar Mode ([Winkey] + [Shift] + [b])
    • Show/hide i3bar, reload i3bar, set default bar options (e.g. mode, position, font size)
  • Customization Mode ([Winkey] + [Shift] + [c])
    • Customize i3wm, e.g. wallpaper, theme, X compositor
      • Border Mode ([b])
        • Window border width, color scheme, and edge border option
      • Conky Mode ([c])
        • System monitor, i3 keybinding sheet, color palette, position
      • Dunst Mode ([d])
        • Dunst position, offset, alignment, font size, icon position
      • Picom Mode ([p])
        • Blur, transparency support
      • Flashfocus Mode ([f])
        • Flash window with additional filter provided by picom (overlay picom settings)
      • Theme Mode ([t])
        • Auto-theme with pywal or theme template
      • Wallpaper Mode ([w])
        • Select wallpaper, set default wallpaper
      • Variety Mode ([v])
        • Variety wallpaper selector, set default wallpaper
      • Reload Mode ([r])
        • Reload configuration (e.g. conky) after auto-theming

Section 5 - Mouse Usage for i3

Click to expand/shrink
  • Although the keyboard-driven workflow is favored in i3, there is no harm in keeping mouse function
  • This part of the configuration can be found in
    • ./config/i3/config.d/i3_bindkey.config
    • ./config/i3/config.d/i3_mode.config

1. Touchpad Usage

Click to expand/shrink
  • 2-finger Gesture
Gesture Action Note
Tap Right key click
Swipe Up Scroll down Natural scrolling is enabled
Swipe Down Scroll up Natural scrolling is enabled
Swipe Up On Border Hide title bar Natural scrolling is enabled
Swipe Down On Title Bar Show title bar Natural scrolling is enabled
Pinch In Zoom in [Ctrl] + [=]
Pinch Out Zoom out [Ctrl] + [-]
  • 3-finger Gesture
Gesture Action Note
Tap Middle key click
Hold On Toggle sticky window (floating window stays on screen) [Winkey] + [Shift] + [s]
Swipe Up Toggle window full-screen mode [Winkey] + [f]
Swipe Down Toggle floating mode [Winkey] + [Shift] + [Space]
Swipe Left Focus and cursor go to previous marked window [Winkey] + [i], requires i3-automark with my modification
Swipe Right Focus and cursor go to next marked window [Winkey] + [n], requires i3-automark with my modification
Swipe Left-Up/Down Switch to previous tab [Ctrl] + [Shift] + [Tab]
Swipe Right-Up/Down Switch to next tab [Ctrl] + [Tab]
  • 4-finger Gesture
Gesture Action Note
Hold On Toggle i3bar visibility Requires libinput >= 1.19
Swipe Up Bring scratchpad (background workspace) window to foreground [Winkey] + [=]
Swipe Down Send window to scratchpad (background workspace) [Winkey] + [-]
Swipe Left Go to previous workspace (create one if it is not existing) [Winkey] + [Shift] + [Grave]
Swipe Right Go to next workspace (create one if it is not existing) [Winkey] + [Grave]
Swipe Left-Up/Down Go to previous workspace (existing ones only) [Winkey] + [Shift] + [Tab]
Swipe Right-Up/Down Go to next workspace (existing ones only) [Winkey] + [Tab]

2. Mouse Usage

Click to expand/shrink
  • Left Button (Button1)
Left Button (Button1) + Action Note
Drag Title Bar Move window
  • Middle Button (Button2)
Middle Button (Button2) + Action Note
Click Title Bar Kill current window
[Winkey] + Click Window Kill current window
  • Right Button ([Button3])
Right Button (Button3) + Action Note
Drag Window Border Resize window
Click Title Bar Toggle floating mode this overwrites i3 default button3 keybinding
[Winkey] + Click Window Toggle floating mode
  • Scroll Wheel Up/Down ([Button4]/[Button5])
Mouse Wheel Action Note
Scroll Up On Border Show title bar
Scroll Down On Title Bar Hide title bar
  • Thumb Button Up/Down ([Button8]/[Button9])
Thumb Button Action Note
[Ctrl]+ Thumb Button Up Enable cursor auto-hiding unclutter
[Ctrl]+ Thumb Button Down Disable cursor auto-hiding unclutter

Section 6 - Keybinding Usage for i3

Click to expand/shrink
  • Cheat sheet format, and color theme here are the same as the i3 user guide
  • It is HIGHLY RECOMMENDED to map caplocks to ctrl for your little finger (default in this configuration)
    • caplocks can be mapped to ctrl with the following command in the shell
      setxkbmap -option "ctrl:nocaps"
    • The remapping command will be automatically activated as you enter i3
      • Check ./config/i3/config.d/i3_startup.config
  • All following keybindings can be configured in
    • ./config/i3/config.d/i3_bindkey.config
    • ./config/i3/config.d/i3_workspace.config
    • ./config/i3/config.d/i3_custom.config
    • ./config/i3/config.d/i3_gap.config
    • ./config/i3/config.d/i3_mode.config
    • ./config/i3/config.d/i3_bar.config

1. Prefix: Winkey

Click to expand/shrink

alt text

  • Go to workspace ([Winkey]+[1~9, 0])

2. Prefix: Winkey + Shift

Click to expand/shrink

alt text

  • Send window to workspace ([Winkey]+[Shift]+[1~9, 0])

3. Prefix: Ctrl + Alt

Click to expand/shrink

alt text

4. Miscellaneous

Keybindings that are not list in Prefix: Winkey, Prefix: Winkey + Shift, or Prefix: Ctrl + Alt

Click to expand/shrink

Workspace

  • Go to Workspace (Absolutely)
    • [Winkey] + [Number(#)]: Go to workspace number # (A#) in monitor 1 (eDP1)
    • [Winkey] + [Function(F#)]: Go to workspace number 10+# (B#) in monitor 2 (HDMI1)
    • [Ctrl] + [Function(F#)]: Go to workspace number 20+# (C#) in monitor 3 (VIRTUAL1)
    • [Alt] + [Function(F#)]: Go to workspace number 30+# (D#) in monitor 4 (VIRTUAL2)
    • [Winkey] + [Esc]: Go to selected workspace (interactively)
  • Go to Workspace (Relatively)
    • [Winkey] + ([Shift]) + [Tab]: Go to (prev)/next existing workspace
    • [Winkey] + ([Shift]) + [Grave]: Go to (prev)/next workspace (create one if it does not exist)
    • [Winkey] + [Alt] + ([Shift]) + [Tab]: Go to (prev)/next free workspace (create one if it does not exist)
    • [Winkey] + [Ctrl] + [Tab]: Go to the last visited workspace back and forth
    • [Ctrl] + [Alt] + [Left/Right]: Gnome-like workspace operation. Move to (prev)/next existing workspace (create one if it does not exist)
  • Swap Workspace (Relatively)
    • [Winkey] + ([Shift]) + [Ctrl] + [Grave]: Swap current workspace with (prev)/next workspace (create one if it does not exist)
    • [Winkey] + [Ctrl] + [Esc]: Swap workspace with selected workspace (interactively)

Window

  • List Windows
    • [Alt] + ([Shift]) + [Tab]: List all windows on all workspaces i.e. windows-like keybinding
    • [Alt] + ([Shift]) + [q]: List all windows on all workspaces with thumbnails i.e. my customized GNOME-like keybinding
  • Send Window to Workspace (Absolutely)
    • [Winkey] + [Shift] + [Number(#)]: Send window to workspace number # (A#) in monitor 1 (eDP1), Note: max # is 10
    • [Winkey] + [Shift] + [Function(F#)]: Send window to workspace number 10+# (B#) in monitor 2 (HDMI1), Note: max # is 10
    • [Ctrl] + [Shift] + [Function(F#)]: Send window to workspace number 20+# (C#) in monitor 3 (VIRTUAL1), Note: max # is 10
    • [Alt] + [Shift] + [Function(F#)]: Send window to workspace number 30+# (D#) in monitor 4 (VIRTUAL2), Note: max # is 10
    • [Alt] + ([Shift]) + [Esc]: Send window (but not focus) to the selected workspace (interactively)
  • Send Window to Workspace (Relatively)
    • [Alt] + ([Shift]) + [Grave]: Send window to (prev)/next existing workspace
    • [Winkey] + [Alt] + ([Shift]) + [Grave]: Send window to (prev)/next free workspace
    • [Ctrl] + [Alt] + [Shift] + [Left/Right]: Gnome-like workspace operation. Send window to prev/next workspace (create one if it does not exist)
  • Manipulate Scratchpad
    • [Ctrl] + [Alt] + [z]: List all windows in scratchpad or send current focused window to scratchpad if there are no windows in scratchpad
    • [Winkey] + [-/z]: Send focused window to scratchpad (background workspace)
    • [Winkey] + [Shift] + [-/z]: Send all floating windows to scratchpad (background workspace)
    • [Winkey] + [=/g]: Bring the window in scratchpad to the foreground one by one
    • [Winkey] + [Shift] + [=/g]: Bring all windows in scratchpad to foreground

Gap

  • Change Gap Size
    • [Ctrl] + [Alt] + [Shift] + [h/l]: Decrease/Increase horizontal outer gap size
    • [Ctrl] + [Alt] + [Shift] + [j/k]: Decrease/Increase vertical outer gap size
    • [Ctrl] + [Alt] + [Shift] + [-/=]: Decrease/Increase inner gap size
    • [Ctrl] + [Alt] + [Shift] + [u]: Disable all inner and outer gaps
    • [Ctrl] + [Alt] + [Shift] + [i]: Restore to default inner gap size
    • [Ctrl] + [Alt] + [Shift] + [o]: Restore to default outer gap size

Screenshot

  • Screenshot
    • [PrtSc]: Flameshot (screenshot tool)
    • [Winkey] + [PrtSc]: Gnome-screenshot for the current window
    • [Winkey] + [Shift] + [PrtSc]: Gnome-screenshot interactive mode

Reference for i3 Setup

Click to expand/shrink

About

My windows manager configuration (including I3, Sway) and some useful software configuration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published