From fbc0371b64842b78a265414d630436347e822338 Mon Sep 17 00:00:00 2001 From: JGH0 Date: Mon, 26 Jan 2026 08:32:46 +0100 Subject: [PATCH] init --- config | 151 +++++++++++++++++++++++++++++++++++++++++++++++ layout-toggle.sh | 9 +++ overlay-menu.sh | 12 ++++ 3 files changed, 172 insertions(+) create mode 100644 config create mode 100755 layout-toggle.sh create mode 100755 overlay-menu.sh diff --git a/config b/config new file mode 100644 index 0000000..ae177da --- /dev/null +++ b/config @@ -0,0 +1,151 @@ +# ---------------------------------------- +# Minimal i3 config (no fluff, no bar) +# ---------------------------------------- + +# Mod key (SUPER) +set $mod Mod4 + +# Font (needed even without bar) +font pango:monospace 10 + +# ---------------------------------------- +# Applications +# ---------------------------------------- +bindsym $mod+Return exec ~/.config/ml4w/settings/terminal.sh +bindsym $mod+b exec ~/.config/ml4w/settings/browser.sh +bindsym $mod+e exec ~/.config/ml4w/settings/filemanager.sh +bindsym $mod+Ctrl+c exec ~/.config/ml4w/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 + +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 + +# ---------------------------------------- +# Super+Ctrl+Q menu +# ---------------------------------------- +bindsym $mod+Control+q exec --no-startup-id ~/.config/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 +# ---------------------------------------- +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 +bindsym $mod+Shift+Right resize grow width 10 px or 10 ppt + +# ---------------------------------------- +# Workspaces +# ---------------------------------------- +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +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 +# ---------------------------------------- +bindsym $mod+Shift+c reload +bindsym $mod+Shift+r restart + +# ---------------------------------------- +# Screenshot (X11) +# ---------------------------------------- +bindsym $mod+Shift+s exec maim -s | xclip -selection clipboard -t image/png + +# ---------------------------------------- +# Keyboard layout toggle (Super+Space) +# ---------------------------------------- +# 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 + +# ---------------------------------------- +# Media / special keys +# ---------------------------------------- +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 ~/.config/ml4w/settings/calculator.sh +bindsym $mod+l exec i3lock +bindsym XF86Tools exec flatpak run com.ml4w.settings + +# ---------------------------------------- +# Visuals (absolute minimum) +# ---------------------------------------- +default_border pixel 1 +floating_modifier $mod +focus_follows_mouse yes + +# ---------------------------------------- +# Startup / monitor layout +# ---------------------------------------- +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 diff --git a/layout-toggle.sh b/layout-toggle.sh new file mode 100755 index 0000000..7a32589 --- /dev/null +++ b/layout-toggle.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Toggle between Swiss German (CH_DE) and US Workman layouts +CURRENT=$(setxkbmap -query | grep layout | awk '{print $2}') +if [ "$CURRENT" = "ch" ]; then + setxkbmap -layout us -variant workman +else + setxkbmap -layout ch -variant de +fi + diff --git a/overlay-menu.sh b/overlay-menu.sh new file mode 100755 index 0000000..69127e0 --- /dev/null +++ b/overlay-menu.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Fullscreen overlay menu +OPTIONS="Reboot\nShutdown\nLock Screen\nCancel" +CHOICE=$(echo -e $OPTIONS | rofi -dmenu -fullscreen -p "Action" -lines 4 -bw 2 -kb-accept-entry 'Return' -kb-cancel 'Escape') + +case "$CHOICE" in + "Reboot") systemctl reboot ;; + "Shutdown") systemctl poweroff ;; + "Lock Screen") i3lock ;; + "Cancel"|"") exit 0 ;; +esac +