meine i3-Konfiguration

i3 ist ein sogenannter "Window Manager"; also eine Möglichkeit mit einem grafischen Desktop zu arbeiten. Die Konfiguration wird über eine Datei vorgenommen, die ich im Folgenden zeigen werden.

Warum man sich im Einzelnen für i3 entscheidet, vermag jeder für sich selbst ausmachen. Fest steht, dass die Möglichkeiten, seinen digitalen Arbeitsplatz so enorm zu individualisieren, ist ein starke Argument. ...zumal das Arbeiten dann nicht nur mehr Spaß macht; es wird - optimiert man richtig - deutlich effizienter.

Die Konfigurationsdatei findet sich unter ~/.config/i3/config.

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!

# Modifier Keys
# Mod1 Alt/Meta
# Mod2 Num Lock?
# Mod3
# Mod4 Hyper/Super (windoze key)
# Mod5 Mode Switch?
set $mod Mod4
set $alt Mod1
 
# Mouse Keys
set $mouseLeft button1
set $mouseMiddle button2
set $mouseRight button3
set $mouseScrollUp button4
set $mouseScrollDown button5

# Application
set $terminal gnome-terminal
set $www_min i3-input -F 'exec epiphany https://duckduckgo.com/?q="%s"' -P 'Search:'set $www_big firefox https://www.google.de
set $www_cli w3m https://www.duckduckgo.com

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec $terminal

# kill focused window
bindsym $mod+Shift+q kill

# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
bindsym $mod+Shift+d exec --no-startup-id i3-dmenu-desktop
bindsym $mod+p exec --no-startup-id i3-input -F 'exec %s' -P 'Run: '

# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+odiaeresis focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+odiaeresis move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# workspace
set $ws0 "0 Dashboard"
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"

# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10

# switch between workspaces  
bindsym $mod+Tab workspace next  
bindsym $mod+Shift+Tab workspace prev

# move to other workspaces
workspace_auto_back_and_forth yes  
bindsym $mod+z workspace back_and_forth  
bindsym $mod+Shift+z move container to workspace back_and_forth; workspace back_and_forth

# resize window (you can also use the mouse for that)
mode "$mode_resize" {
    bindsym Left resize shrink width 10 px or 10 ppt
    bindsym j resize shrink width 10 px or 10 ppt

    bindsym Down resize grow height 10 px or 10 ppt
    bindsym k resize grow height 10 px or 10 ppt

    bindsym Up resize shrink height 10 px or 10 ppt
    bindsym l resize shrink height 10 px or 10 ppt

    bindsym Right resize grow width 10 px or 10 ppt
    bindsym odiaeresis resize grow width 10 px or 10 ppt

    # back to normal: Enter or Escape
    bindsym $mod+r mode "default"
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+r mode "$mode_resize"

mode "$mode_move" {
    bindsym Up move up 20px
    bindsym Left move left 20px
    bindsym Down move down 20px
    bindsym Right move right 20px

    # back to normal: Enter or Escape
    bindsym $mod+m mode "default"
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+m focus floating; mode "$mode_move"

# system
mode "$mode_system" {
    bindsym l exec --no-startup-id i3lock-fancy, mode "default"
    bindsym e exec "i3-nagbar -t warning -m 'Do you really want to exit i3?' -b 'Yes, exit i3' 'i3-msg exit'", mode "default"
    bindsym s exec systemctl suspend, mode "default"
    bindsym h exec "i3-nagbar -t warning -m 'Do you really want to halt the system i3?' -b 'Yes, halt system' 'halt -p'", mode "default"
    bindsym c reload, mode "default"
    bindsym r restart, mode "default"

    # exit system mode: "Enter" or "Escape" 
    bindsym $mod+Escape mode "default"
    bindsym Return mode "default"  
    bindsym Escape mode "default"  
}

bindsym $mod+Escape mode "$mode_system"  
set $mode_system (l)ock, (e)xit, (s)uspend, (h)alt, (c)onfig, (r)estart

# command
mode "$mode_command" {
    bindsym e exec --no-startup-id $www_min, mode "default"
    bindsym f exec --no-startup-id $www_big, mode "default"
    bindsym g exec --no-startup-id gimp, mode "default"
    bindsym h exec --no-startup-id $terminal -e htop, mode "default"
    bindsym m exec --no-startup-id $terminal -e mc, mode "default"
    bindsym n exec --no-startup-id $terminal -e newsbeuter, mode "default"
    bindsym p exec --no-startup-id pcmanfm, mode "default"
    bindsym r exec --no-startup-id $terminal -e ranger, mode "default"
    bindsym t exec --no-startup-id $terminal, mode "default"
    bindsym w exec --no-startup-id $terminal -e "$www_cli", mode "default"

    # exit command mode: "Enter" or "Escape" 
    bindsym $mod+x mode "default"
    bindsym Return mode "default"  
    bindsym Escape mode "default"  
}

bindsym $mod+c mode "$mode_command"  
set $mode_command (e)piphany, (f)irefox, (g)imp, (m)idnightcommander, (n)ewsbeuter, (t)erminal


# volume control
# https://unix.stackexchange.com/questions/21697/amixer-how-to-change-recording-channel#21740
# https://skaletz.me/posts/2017/Apr/08/i3wm-config/
bindsym XF86AudioRaiseVolume exec amixer -q -c1 sset Master 10%+
bindsym XF86AudioLowerVolume exec amixer -q -c1 sset Master 10%-
bindsym XF86AudioMute exec amixer -q -c1 sset Master toggle
bindsym XF86AudioPlay exec amixer -q -c1 sset Master toggle

# screen brightness controls  
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness  
bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness

# dashboard
bindsym $mod+Shift+Delete workspace $ws0; layout splitv; exec $terminal -e ttyload; exec $terminal -e htop; layout splith; exec $terminal -e tty-clock; exec $terminal -e vim
bindsym $mod+Delete workspace $ws0

# autostart
#exec nitrogen --restore
exec --no-startup-id feh --bg-scale ~/Bilder
exec volumeicon


# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
    status_command i3status
    position bottom
    mode dock
    modifier None
    workspace_buttons yes
    separator_symbol "|"
}

#Fenster zu einem Scratchpad  
bindsym $mod+Shift+minus move scratchpad  
#Zeige das scratcpad window  
bindsym $mod+minus scratchpad show

# move to other screen
bindsym $mod+Ctrl+Right move workspace to output right
bindsym $mod+Ctrl+Left move workspace to output left