chaged structure and added intsal script

This commit is contained in:
Jürg Hallenbarter
2026-01-26 08:35:13 +00:00
parent 0279dceb7f
commit d15ca29883
10 changed files with 182 additions and 108 deletions

113
README.md
View File

@@ -4,86 +4,117 @@ This repository contains a very minimal and practical **i3 window manager** conf
It is designed to stay close to upstream i3 behavior while adding a few convenience features It is designed to stay close to upstream i3 behavior while adding a few convenience features
for daily use. for daily use.
The configuration focuses on: The goal is:
- Predictable tiling behavior - Predictable tiling behavior
- Keyboard-driven workflow - Keyboard-driven workflow
- Minimal visual noise - Minimal visual noise
- Easy extensibility - Easy extensibility via simple shell scripts
No external theming frameworks or heavy abstractions are used. No external theming frameworks or heavy abstractions are used.
--- ---
## Concept: Application Settings
All user-configurable applications are defined inside the `settings/` directory.
Each file contains **only the binary name**, for example:
```sh
firefox
```
The i3 config itself handles the `exec` logic and simply reads these files.
This keeps configuration clean and avoids hardcoding application names.
If an application does not exist on the system, the installer will warn the user.
---
## Features ## Features
- i3 (X11) based setup - i3 (X11) based setup
- Mouse-follow focus (focus follows mouse hover) - Focus follows mouse
- Simple, readable keybindings - Simple, readable keybindings
- Keyboard layout switching (e.g. `ch_de``us_workman`) - Keyboard layout switching (e.g. `ch_de``us_workman`)
- Window moving and resizing via keyboard - Keyboard-driven window movement and resizing
- Minimal logout / power menu overlay - Minimal logout / power overlay
- Multi-monitor friendly (using `xrandr`) - Multi-monitor friendly (`xrandr`)
- Compatible with standard i3 tools - No hidden logic or frameworks
--- ---
## Required Packages ## Required Packages (Arch Linux)
Install the following packages on Arch Linux:
### Core ### Core
- `i3-wm` - `i3-wm`
- `i3status` or `i3status-rust` (optional, if you use a status bar)
- `dmenu` or `rofi` (used for menus / overlays)
- `xorg-server` - `xorg-server`
- `xorg-xinit` - `xorg-xinit`
- `dmenu` or `rofi`
### Utilities ### Utilities
- `xrandr` (monitor configuration) - `xrandr`
- `setxkbmap` (keyboard layout switching) - `setxkbmap`
- `picom` (optional compositor) - `picom` (optional)
- `alacritty` or `kitty` (terminal emulator) - `feh` (optional)
- `feh` (optional, wallpaper) - `playerctl` (optional)
- `playerctl` (optional, media keys) - `brightnessctl` (optional)
- `brightnessctl` (optional, brightness keys)
### Lock / Power (optional)
- `i3lock` or `i3lock-color`
- `systemd` (already present on most systems)
Example install command:
```bash
sudo pacman -S i3-wm dmenu xrandr setxkbmap xorg-xinit
```
--- ---
## Installation ## Installation
1. Clone the repository: ### 1. Clone the repository
```bash ```bash
git clone https://github.com/<your-username>/MyI3Repo.git git clone https://github.com/<your-username>/MyI3Repo.git
cd MyI3Repo
``` ```
2. Create the i3 config directory: ---
### 2. Run the installer
```bash ```bash
mkdir -p ~/.config/i3 ./install.sh
``` ```
3. Copy the config: The installer will:
- Ask if you want to install the i3 configuration
- Copy the config to `~/.config/i3`
- Ask which terminal, browser, file manager, and calculator you want to use
- Validate that the chosen applications exist
- Write the selected application names into `settings/*.sh`
If an application is not found, you will be asked again.
---
### 3. Log into i3
When starting i3 for the first time:
- **Do NOT generate a new config**
- Use the installed configuration
---
## packages.txt
The `packages.txt` file contains a suggested list of packages you may want to install.
It is intentionally not installed automatically to keep full user control.
Example:
```bash ```bash
cp MyI3Repo/config ~/.config/i3/config sudo pacman -S --needed - < packages.txt
``` ```
4. Log into an i3 session.
If asked to generate a config, **choose NO**.
--- ---
## Notes ## Notes
- This config is intentionally minimal. - This configuration is intentionally minimal
- You are expected to adjust keybindings, monitors, and applications to your system. - Everything is plain text and easy to understand
- All logic is kept inside the i3 config file for transparency. - No magic, no hidden behavior
- No scripts are required unless you explicitly add them. - You are encouraged to fork and modify this setup to your needs

View File

@@ -2,69 +2,50 @@
# Minimal i3 config (no fluff, no bar) # Minimal i3 config (no fluff, no bar)
# ---------------------------------------- # ----------------------------------------
# Mod key (SUPER)
set $mod Mod4 set $mod Mod4
# Font (needed even without bar)
font pango:monospace 10 font pango:monospace 10
# ---------------------------------------- # ----------------------------------------
# Applications # Applications (from settings/)
# ---------------------------------------- # ----------------------------------------
bindsym $mod+Return exec kitty # terminal bindsym $mod+Return exec ~/.config/MyI3Config/settings/terminal.sh
bindsym $mod+b exec firefox # browser bindsym $mod+b exec ~/.config/MyI3Config/settings/browser.sh
bindsym $mod+e exec nautilus # filemanager bindsym $mod+e exec ~/.config/MyI3Config/settings/filemanager.sh
bindsym $mod+Ctrl+c exec gnome-calculator # calculator bindsym $mod+Ctrl+c exec ~/.config/MyI3Config/settings/calculator.sh
# App launcher
bindsym $mod+Ctrl+Return exec rofi -show drun -i bindsym $mod+Ctrl+Return exec rofi -show drun -i
# ---------------------------------------- # ----------------------------------------
# Window management # Window management
# ---------------------------------------- # ----------------------------------------
bindsym $mod+q kill bindsym $mod+q kill
bindsym $mod+Shift+q exec xkill
# Kill all windows of same class
bindsym $mod+Shift+q exec --no-startup-id ~/.config/MyI3Config/i3/kill-same-class.sh
bindsym $mod+f fullscreen toggle bindsym $mod+f fullscreen toggle
bindsym $mod+t floating toggle bindsym $mod+t floating toggle
bindsym $mod+j split toggle bindsym $mod+j split toggle
bindsym $mod+m fullscreen toggle # max is fullscreen in i3 bindsym $mod+m fullscreen toggle
# ---------------------------------------- # ----------------------------------------
# Super+Ctrl+Q menu # Overlay power menu
# ---------------------------------------- # ----------------------------------------
bindsym $mod+Control+q exec --no-startup-id ~/.config/i3/overlay-menu.sh bindsym $mod+Control+q exec --no-startup-id ~/.config/MyI3Config/i3/overlay-menu.sh
# ---------------------------------------- # ----------------------------------------
# Super+Shift+Q: kill all windows of same class # Focus / move / resize
# ----------------------------------------
bindsym $mod+Shift+q exec --no-startup-id sh -c "CLASS=\$(xprop -id \$(xdotool getactivewindow) WM_CLASS | awk -F '\"' '{print \$4}'); for W in \$(wmctrl -lx | awk -v class=\"\$CLASS\" '\$3 ~ class {print \$1}'); do wmctrl -ic \$W; done"
# ----------------------------------------
# Focus movement
# ---------------------------------------- # ----------------------------------------
bindsym $mod+Left focus left bindsym $mod+Left focus left
bindsym $mod+Down focus down bindsym $mod+Down focus down
bindsym $mod+Up focus up bindsym $mod+Up focus up
bindsym $mod+Right focus right bindsym $mod+Right focus right
# ----------------------------------------
# Move windows (Super+Ctrl+Arrow) + warp cursor
# ----------------------------------------
bindsym $mod+Control+Left move left; move cursor to window bindsym $mod+Control+Left move left; move cursor to window
bindsym $mod+Control+Down move down; move cursor to window bindsym $mod+Control+Down move down; move cursor to window
bindsym $mod+Control+Up move up; move cursor to window bindsym $mod+Control+Up move up; move cursor to window
bindsym $mod+Control+Right move right; move cursor to window bindsym $mod+Control+Right move right; move cursor to window
# Fallback for older i3 (<4.21) using xdotool:
# bindsym $mod+Control+Left move left; exec xdotool mousemove --window $(xdotool getactivewindow) 50 50
# bindsym $mod+Control+Down move down; exec xdotool mousemove --window $(xdotool getactivewindow) 50 50
# bindsym $mod+Control+Up move up; exec xdotool mousemove --window $(xdotool getactivewindow) 50 50
# bindsym $mod+Control+Right move right; exec xdotool mousemove --window $(xdotool getactivewindow) 50 50
# ----------------------------------------
# Resize windows (Super+Shift+Arrow)
# ----------------------------------------
bindsym $mod+Shift+Left resize shrink width 10 px or 10 ppt bindsym $mod+Shift+Left resize shrink width 10 px or 10 ppt
bindsym $mod+Shift+Down resize grow height 10 px or 10 ppt bindsym $mod+Shift+Down resize grow height 10 px or 10 ppt
bindsym $mod+Shift+Up resize shrink height 10 px or 10 ppt bindsym $mod+Shift+Up resize shrink height 10 px or 10 ppt
@@ -95,9 +76,6 @@ bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9 bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10 bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
# ---------------------------------------- # ----------------------------------------
# Reload / Restart # Reload / Restart
# ---------------------------------------- # ----------------------------------------
@@ -105,46 +83,30 @@ bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart bindsym $mod+Shift+r restart
# ---------------------------------------- # ----------------------------------------
# Screenshot (X11) # Screenshot
# ---------------------------------------- # ----------------------------------------
bindsym $mod+Shift+s exec maim -s | xclip -selection clipboard -t image/png bindsym $mod+Shift+s exec maim -s | xclip -selection clipboard -t image/png
# ---------------------------------------- # ----------------------------------------
# Keyboard layout toggle (Super+Space) # Keyboard layout
# ---------------------------------------- # ----------------------------------------
# Set once on startup
exec --no-startup-id setxkbmap -layout ch -variant de exec --no-startup-id setxkbmap -layout ch -variant de
# Toggle with keybind bindsym $mod+space exec --no-startup-id ~/.config/MyI3Config/i3/layout-toggle.sh
bindsym $mod+space exec --no-startup-id ~/.config/i3/layout-toggle.sh
# ---------------------------------------- # ----------------------------------------
# Media / special keys # Lock
# ---------------------------------------- # ----------------------------------------
bindsym XF86MonBrightnessUp exec brightnessctl -q s +10%
bindsym XF86MonBrightnessDown exec brightnessctl -q s 10%-
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86Calculator exec gnome-calculator # calculator
bindsym $mod+l exec i3lock bindsym $mod+l exec i3lock
# ---------------------------------------- # ----------------------------------------
# Visuals (absolute minimum) # Visuals
# ---------------------------------------- # ----------------------------------------
default_border pixel 1 default_border pixel 1
floating_modifier $mod floating_modifier $mod
focus_follows_mouse yes focus_follows_mouse yes
# ---------------------------------------- # ----------------------------------------
# Startup / monitor layout # Startup
# ---------------------------------------- # ----------------------------------------
exec --no-startup-id xsetroot -cursor_name left_ptr exec --no-startup-id xsetroot -cursor_name left_ptr
exec --no-startup-id xrandr --output HDMI-1 --auto --left-of DP-2 --output DP-2 --auto exec --no-startup-id xrandr --output HDMI-1 --auto --left-of DP-2 --output DP-2 --auto

76
install.sh Normal file
View File

@@ -0,0 +1,76 @@
#!/usr/bin/env bash
set -e
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
CFG_ROOT="$HOME/.config/MyI3Config"
I3_DIR="$HOME/.config/i3"
ask() {
printf "%s [y/N]: " "$1"
read -r ans
[ "$ans" = "y" ] || [ "$ans" = "Y" ]
}
ask_app() {
local label="$1"
local default="$2"
local app
while true; do
printf "%s (default: %s): " "$label" "$default"
read -r app
app="${app:-$default}"
if command -v "$app" >/dev/null 2>&1; then
echo "$app"
return
else
echo "✗ '$app' not found in PATH"
echo " install it first or choose another"
fi
done
}
echo "=== MyI3Config installer ==="
echo
if ! ask "Install this i3 configuration?"; then
echo "Aborted."
exit 0
fi
echo
echo "[1/4] Installing packages"
sudo pacman -S --needed $(grep -v '^#' "$REPO_DIR/packages.txt")
echo
echo "[2/4] Choose applications"
TERMINAL=$(ask_app "Terminal" "kitty")
BROWSER=$(ask_app "Browser" "firefox")
FILEMANAGER=$(ask_app "File manager" "nautilus")
CALCULATOR=$(ask_app "Calculator" "gnome-calculator")
echo
echo "[3/4] Installing MyI3Config"
rm -rf "$CFG_ROOT"
mkdir -p "$CFG_ROOT"
cp -r "$REPO_DIR/"* "$CFG_ROOT"
echo
echo "[4/4] Writing settings"
echo "$TERMINAL" > "$CFG_ROOT/settings/terminal.sh"
echo "$BROWSER" > "$CFG_ROOT/settings/browser.sh"
echo "$FILEMANAGER" > "$CFG_ROOT/settings/filemanager.sh"
echo "$CALCULATOR" > "$CFG_ROOT/settings/calculator.sh"
chmod +x "$CFG_ROOT/i3/"*.sh
echo
echo "Installing i3 config → ~/.config/i3/config"
mkdir -p "$I3_DIR"
cp "$CFG_ROOT/i3/config" "$I3_DIR/config"
echo
echo "✓ Done"
echo
echo "Reload i3 with: Super + Shift + C"

View File

@@ -7,40 +7,41 @@ xorg-xinit
xorg-xrandr xorg-xrandr
xorg-xsetroot xorg-xsetroot
# Application launcher # Application launcher (used for menus / overlays)
rofi rofi
# Terminal (used by ml4w scripts, adjust if needed) # Terminal emulator (default, can be changed via settings/)
kitty kitty
# Clipboard + screenshots # Clipboard & screenshots
maim maim
xclip xclip
# Audio # Audio (PipeWire stack)
pipewire pipewire
pipewire-alsa pipewire-alsa
pipewire-pulse pipewire-pulse
wireplumber wireplumber
pactl pactl
# Media keys # Media control keys
playerctl playerctl
# Brightness # Brightness control
brightnessctl brightnessctl
# Lock screen (recommended) # Lock screen (optional but recommended)
betterlockscreen i3lock
xss-lock
# Fonts (avoid missing glyphs) # Fonts (to avoid missing glyphs)
ttf-dejavu ttf-dejavu
noto-fonts noto-fonts
# Keyboard tools # Keyboard tools
setxkbmap setxkbmap
# Utils # Common applications (examples, configurable via settings/)
firefox firefox
gnome-calculator gnome-calculator
nautilus nautilus

1
settings/browser.sh Normal file
View File

@@ -0,0 +1 @@
firefox

1
settings/calculator.sh Normal file
View File

@@ -0,0 +1 @@
gnome-calculator

1
settings/filemanager.sh Normal file
View File

@@ -0,0 +1 @@
nautilus

1
settings/terminal.sh Normal file
View File

@@ -0,0 +1 @@
kitty