From d15ca298836cecd8844a581ccd9829d25fb2bd9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Hallenbarter?= Date: Mon, 26 Jan 2026 08:35:13 +0000 Subject: [PATCH] chaged structure and added intsal script --- README.md | 113 +++++++++++++++--------- config => i3/config | 76 ++++------------ layout-toggle.sh => i3/layout-toggle.sh | 0 overlay-menu.sh => i3/overlay-menu.sh | 0 install.sh | 76 ++++++++++++++++ packages.txt | 21 ++--- settings/browser.sh | 1 + settings/calculator.sh | 1 + settings/filemanager.sh | 1 + settings/terminal.sh | 1 + 10 files changed, 182 insertions(+), 108 deletions(-) rename config => i3/config (54%) rename layout-toggle.sh => i3/layout-toggle.sh (100%) rename overlay-menu.sh => i3/overlay-menu.sh (100%) create mode 100644 install.sh create mode 100644 settings/browser.sh create mode 100644 settings/calculator.sh create mode 100644 settings/filemanager.sh create mode 100644 settings/terminal.sh diff --git a/README.md b/README.md index 09b5ba6..1071083 100644 --- a/README.md +++ b/README.md @@ -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 for daily use. -The configuration focuses on: +The goal is: - Predictable tiling behavior - Keyboard-driven workflow - Minimal visual noise -- Easy extensibility +- Easy extensibility via simple shell scripts 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 - i3 (X11) based setup -- Mouse-follow focus (focus follows mouse hover) +- Focus follows mouse - Simple, readable keybindings - Keyboard layout switching (e.g. `ch_de` ↔ `us_workman`) -- Window moving and resizing via keyboard -- Minimal logout / power menu overlay -- Multi-monitor friendly (using `xrandr`) -- Compatible with standard i3 tools +- Keyboard-driven window movement and resizing +- Minimal logout / power overlay +- Multi-monitor friendly (`xrandr`) +- No hidden logic or frameworks --- -## Required Packages - -Install the following packages on Arch Linux: +## Required Packages (Arch Linux) ### Core - `i3-wm` -- `i3status` or `i3status-rust` (optional, if you use a status bar) -- `dmenu` or `rofi` (used for menus / overlays) - `xorg-server` - `xorg-xinit` +- `dmenu` or `rofi` ### Utilities -- `xrandr` (monitor configuration) -- `setxkbmap` (keyboard layout switching) -- `picom` (optional compositor) -- `alacritty` or `kitty` (terminal emulator) -- `feh` (optional, wallpaper) -- `playerctl` (optional, media keys) -- `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 -``` +- `xrandr` +- `setxkbmap` +- `picom` (optional) +- `feh` (optional) +- `playerctl` (optional) +- `brightnessctl` (optional) --- ## Installation -1. Clone the repository: +### 1. Clone the repository + ```bash git clone https://github.com//MyI3Repo.git +cd MyI3Repo ``` -2. Create the i3 config directory: +--- + +### 2. Run the installer + ```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 -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 -- This config is intentionally minimal. -- You are expected to adjust keybindings, monitors, and applications to your system. -- All logic is kept inside the i3 config file for transparency. -- No scripts are required unless you explicitly add them. +- This configuration is intentionally minimal +- Everything is plain text and easy to understand +- No magic, no hidden behavior +- You are encouraged to fork and modify this setup to your needs \ No newline at end of file diff --git a/config b/i3/config similarity index 54% rename from config rename to i3/config index c5f233e..21fbede 100644 --- a/config +++ b/i3/config @@ -2,69 +2,50 @@ # Minimal i3 config (no fluff, no bar) # ---------------------------------------- -# Mod key (SUPER) set $mod Mod4 - -# Font (needed even without bar) font pango:monospace 10 # ---------------------------------------- -# Applications +# Applications (from settings/) # ---------------------------------------- -bindsym $mod+Return exec kitty # terminal -bindsym $mod+b exec firefox # browser -bindsym $mod+e exec nautilus # filemanager -bindsym $mod+Ctrl+c exec gnome-calculator # calculator +bindsym $mod+Return exec ~/.config/MyI3Config/settings/terminal.sh +bindsym $mod+b exec ~/.config/MyI3Config/settings/browser.sh +bindsym $mod+e exec ~/.config/MyI3Config/settings/filemanager.sh +bindsym $mod+Ctrl+c exec ~/.config/MyI3Config/settings/calculator.sh -# App launcher bindsym $mod+Ctrl+Return exec rofi -show drun -i # ---------------------------------------- # Window management # ---------------------------------------- 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+t floating 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 -# ---------------------------------------- -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 +# Focus / move / resize # ---------------------------------------- bindsym $mod+Left focus left bindsym $mod+Down focus down bindsym $mod+Up focus up 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+Down move down; move cursor to window bindsym $mod+Control+Up move up; 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+Down resize grow 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+0 move container to workspace 10 -bindsym $mod+Tab workspace next -bindsym $mod+Shift+Tab workspace prev - # ---------------------------------------- # Reload / Restart # ---------------------------------------- @@ -105,46 +83,30 @@ bindsym $mod+Shift+c reload bindsym $mod+Shift+r restart # ---------------------------------------- -# Screenshot (X11) +# Screenshot # ---------------------------------------- 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 -# Toggle with keybind -bindsym $mod+space exec --no-startup-id ~/.config/i3/layout-toggle.sh +bindsym $mod+space exec --no-startup-id ~/.config/MyI3Config/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 # ---------------------------------------- -# Visuals (absolute minimum) +# Visuals # ---------------------------------------- default_border pixel 1 floating_modifier $mod focus_follows_mouse yes # ---------------------------------------- -# Startup / monitor layout +# Startup # ---------------------------------------- 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 \ No newline at end of file diff --git a/layout-toggle.sh b/i3/layout-toggle.sh similarity index 100% rename from layout-toggle.sh rename to i3/layout-toggle.sh diff --git a/overlay-menu.sh b/i3/overlay-menu.sh similarity index 100% rename from overlay-menu.sh rename to i3/overlay-menu.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..51a2c56 --- /dev/null +++ b/install.sh @@ -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" \ No newline at end of file diff --git a/packages.txt b/packages.txt index 889892c..22c2a80 100644 --- a/packages.txt +++ b/packages.txt @@ -7,40 +7,41 @@ xorg-xinit xorg-xrandr xorg-xsetroot -# Application launcher +# Application launcher (used for menus / overlays) rofi -# Terminal (used by ml4w scripts, adjust if needed) +# Terminal emulator (default, can be changed via settings/) kitty -# Clipboard + screenshots +# Clipboard & screenshots maim xclip -# Audio +# Audio (PipeWire stack) pipewire pipewire-alsa pipewire-pulse wireplumber pactl -# Media keys +# Media control keys playerctl -# Brightness +# Brightness control brightnessctl -# Lock screen (recommended) -betterlockscreen +# Lock screen (optional but recommended) +i3lock +xss-lock -# Fonts (avoid missing glyphs) +# Fonts (to avoid missing glyphs) ttf-dejavu noto-fonts # Keyboard tools setxkbmap -# Utils +# Common applications (examples, configurable via settings/) firefox gnome-calculator nautilus \ No newline at end of file diff --git a/settings/browser.sh b/settings/browser.sh new file mode 100644 index 0000000..7c92c5e --- /dev/null +++ b/settings/browser.sh @@ -0,0 +1 @@ +firefox \ No newline at end of file diff --git a/settings/calculator.sh b/settings/calculator.sh new file mode 100644 index 0000000..7321b2e --- /dev/null +++ b/settings/calculator.sh @@ -0,0 +1 @@ +gnome-calculator \ No newline at end of file diff --git a/settings/filemanager.sh b/settings/filemanager.sh new file mode 100644 index 0000000..9f0175d --- /dev/null +++ b/settings/filemanager.sh @@ -0,0 +1 @@ +nautilus \ No newline at end of file diff --git a/settings/terminal.sh b/settings/terminal.sh new file mode 100644 index 0000000..659fb6b --- /dev/null +++ b/settings/terminal.sh @@ -0,0 +1 @@ +kitty \ No newline at end of file