lip:i3_workshop
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
lip:i3_workshop [2013/10/21 18:56] – /* Skripte unter .i3/actions/ */ 137_226_231.247 | lip:i3_workshop [2013/10/25 11:39] (aktuell) – 134_61_142.107 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | Den letzten (2013) Workshop zu i3 habe [[mailto: | ||
+ | Hier habe ich meine Konfiguration von i3 verewigt, zum einen um eine Idee zu geben was man da alles machen kann, zum anderen um ein paar Ideen für Erweiterungen zu zeigen. | ||
+ | |||
+ | |||
+ | ======= Config ======= | ||
+ | |||
+ | Diese config unter **~/ | ||
+ | Besonderheiten gegenüber der Standard-Config: | ||
+ | * Win+a öffnet ein " | ||
+ | * Key bindings für Multimedia-Keys von Thinkpads (funktionieren auf meinem X220i) | ||
+ | * Standard-Desktops für Mail, IM und Browser | ||
+ | * Autostart | ||
+ | |||
+ | Eine Warnung vorweg: Ein paar Sachen funktionieren vielleicht nicht sofort mit den Standard-Paketen, | ||
+ | |||
+ | < | ||
+ | |||
+ | # default modifier | ||
+ | set $mod Mod4 | ||
+ | # second modifier | ||
+ | set $mod2 Mod1 | ||
+ | |||
+ | # font for window titles. ISO 10646 = Unicode | ||
+ | font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 | ||
+ | |||
+ | # Use Mouse+$mod to drag floating windows to their wanted position | ||
+ | floating_modifier $mod | ||
+ | |||
+ | ########## | ||
+ | # coloring border backgr text indicator | ||
+ | client.focused # | ||
+ | client.focused_inactive # | ||
+ | client.unfocused # | ||
+ | client.urgent # | ||
+ | |||
+ | # background | ||
+ | exec xsetroot -solid "# | ||
+ | |||
+ | # start a terminal | ||
+ | bindsym $mod+Return exec uxterm | ||
+ | |||
+ | # kill focused window | ||
+ | bindsym $mod+Shift+Q kill | ||
+ | |||
+ | ########## | ||
+ | # program & action menu | ||
+ | |||
+ | set $dmenuopts -i -nb "# | ||
+ | #bindsym $mod+d exec dmenu_run $dmenuopts | ||
+ | bindsym $mod+d exec i3-dmenu-desktop --dmenu=" | ||
+ | bindsym $mod+a exec ~/ | ||
+ | |||
+ | ########## | ||
+ | # some custom key bindings | ||
+ | bindsym Print exec ~/ | ||
+ | bindsym XF86ScreenSaver exec ~/ | ||
+ | #bindsym XF86WakeUp+XF86Switch_VT_12 exec ~/ | ||
+ | bindsym XF86Launch1 exec todo | ||
+ | |||
+ | bindsym XF86AudioMute exec amixer sset Master toggle | ||
+ | bindsym XF86AudioLowerVolume exec amixer sset Master " | ||
+ | bindsym XF86AudioRaiseVolume exec amixer sset Master " | ||
+ | |||
+ | ########## | ||
+ | # change focus | ||
+ | bindsym $mod+j focus left | ||
+ | bindsym $mod+k focus down | ||
+ | bindsym $mod+l focus up | ||
+ | bindsym $mod+odiaeresis focus right | ||
+ | |||
+ | # alternatively, | ||
+ | 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, | ||
+ | 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 | ||
+ | |||
+ | # change container layout (stacked, tabbed, default) | ||
+ | bindsym $mod+s layout stacking | ||
+ | bindsym $mod+w layout tabbed | ||
+ | bindsym $mod+e layout default | ||
+ | |||
+ | # 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 | ||
+ | #bindcode $mod+d focus child | ||
+ | |||
+ | ########## | ||
+ | # workspaces | ||
+ | |||
+ | # switch to last used workspace | ||
+ | workspace_auto_back_and_forth yes | ||
+ | |||
+ | bindsym $mod+Tab workspace back_and_forth | ||
+ | bindsym $mod2+Tab workspace next | ||
+ | |||
+ | 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 | ||
+ | |||
+ | # move focused container to workspace | ||
+ | bindsym $mod+Shift+1 move workspace 1 | ||
+ | bindsym $mod+Shift+2 move workspace 2 | ||
+ | bindsym $mod+Shift+3 move workspace 3 | ||
+ | bindsym $mod+Shift+4 move workspace 4 | ||
+ | bindsym $mod+Shift+5 move workspace 5 | ||
+ | bindsym $mod+Shift+6 move workspace 6 | ||
+ | bindsym $mod+Shift+7 move workspace 7 | ||
+ | bindsym $mod+Shift+8 move workspace 8 | ||
+ | bindsym $mod+Shift+9 move workspace 9 | ||
+ | bindsym $mod+Shift+0 move workspace 10 | ||
+ | |||
+ | # resize window (you can also use the mouse for that) | ||
+ | mode " | ||
+ | { | ||
+ | |||
+ | bindsym j resize shrink left 10 px or 10 ppt | ||
+ | bindsym Shift+J resize grow left 10 px or 10 ppt | ||
+ | |||
+ | bindsym k resize shrink down 10 px or 10 ppt | ||
+ | bindsym Shift+K resize grow down 10 px or 10 ppt | ||
+ | |||
+ | bindsym l resize shrink up 10 px or 10 ppt | ||
+ | bindsym Shift+L resize grow up 10 px or 10 ppt | ||
+ | |||
+ | bindsym odiaeresis resize shrink right 10 px or 10 ppt | ||
+ | bindsym Shift+Odiaeresis resize grow right 10 px or 10 ppt | ||
+ | |||
+ | # same bindings, but for the arrow keys | ||
+ | bindsym Left resize shrink left 10 px or 10 ppt | ||
+ | bindsym Shift+Left resize grow left 10 px or 10 ppt | ||
+ | |||
+ | bindsym Down resize shrink down 10 px or 10 ppt | ||
+ | bindsym Shift+Down resize grow down 10 px or 10 ppt | ||
+ | |||
+ | bindsym Up resize shrink up 10 px or 10 ppt | ||
+ | bindsym Shift+Up resize grow up 10 px or 10 ppt | ||
+ | |||
+ | bindsym Right resize shrink right 10 px or 10 ppt | ||
+ | bindsym Shift+Right resize grow right 10 px or 10 ppt | ||
+ | |||
+ | # back to normal: Enter or Escape | ||
+ | bindsym Return mode " | ||
+ | bindsym Escape mode " | ||
+ | } | ||
+ | |||
+ | bindsym $mod+r mode " | ||
+ | |||
+ | ########## | ||
+ | # status bar | ||
+ | bar | ||
+ | { | ||
+ | # show tray on laptop | ||
+ | tray_output primary | ||
+ | |||
+ | # customized i3status | ||
+ | # | ||
+ | |||
+ | # official i3status | ||
+ | status_command i3status -c ~/ | ||
+ | |||
+ | font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 | ||
+ | |||
+ | colors | ||
+ | { | ||
+ | background #000000 | ||
+ | statusline #aaaaaa | ||
+ | |||
+ | # class border backgr text | ||
+ | focused_workspace # | ||
+ | active_workspace # | ||
+ | inactive_workspace # | ||
+ | urgent_workspace # | ||
+ | } | ||
+ | } | ||
+ | |||
+ | ########## | ||
+ | # organize... | ||
+ | |||
+ | # Pidgin & Thunderbird -> Workspace 1 | ||
+ | assign [class=" | ||
+ | assign [class=" | ||
+ | assign [class=" | ||
+ | |||
+ | # Pidgin Conversations -> Workspace 2 | ||
+ | assign [class=" | ||
+ | |||
+ | # Browser -> Workspace 3 | ||
+ | assign [class=" | ||
+ | assign [class=" | ||
+ | assign [class=" | ||
+ | |||
+ | # RSS Reader -> Workspace 9 | ||
+ | assign [class=" | ||
+ | |||
+ | for_window [class=" | ||
+ | |||
+ | ########## | ||
+ | # autostart | ||
+ | #exec nm-applet | ||
+ | #exec liferea | ||
+ | </ | ||
+ | |||
+ | ======= Config für Status bar ======= | ||
+ | |||
+ | |||
+ | Die Statusbar wird in **~/ | ||
+ | Hier meine Config: | ||
+ | |||
+ | < | ||
+ | colors = true | ||
+ | color_good = "# | ||
+ | color_degraded = "# | ||
+ | color_bad = "# | ||
+ | |||
+ | interval = 5 | ||
+ | output_format = i3bar | ||
+ | } | ||
+ | |||
+ | order += "disk /" | ||
+ | order += " | ||
+ | order += " | ||
+ | order += " | ||
+ | order += " | ||
+ | order += " | ||
+ | order += " | ||
+ | order += " | ||
+ | |||
+ | wireless wlan0 { | ||
+ | format_up = " %essid (%ip, %quality) " | ||
+ | format_down = " wlan0 " | ||
+ | } | ||
+ | |||
+ | ethernet eth0 { | ||
+ | # if you use %speed, i3status requires root privileges | ||
+ | format_up = " %ip (%speed) " | ||
+ | format_down = " eth0 " | ||
+ | } | ||
+ | |||
+ | ethernet usb0 { | ||
+ | # if you use %speed, i3status requires root privileges | ||
+ | format_up = " usb0 up " | ||
+ | format_down = " usb0 " | ||
+ | } | ||
+ | |||
+ | battery 0 { | ||
+ | last_full_capacity = true | ||
+ | format = " %status %percentage %remaining " | ||
+ | low_threshold = 15 | ||
+ | threshold_type = " | ||
+ | } | ||
+ | |||
+ | run_watch DHCP { | ||
+ | pidfile = "/ | ||
+ | } | ||
+ | |||
+ | run_watch VPN { | ||
+ | pidfile = "/ | ||
+ | } | ||
+ | |||
+ | time { | ||
+ | format = " %a %d.%m.%Y %T" | ||
+ | } | ||
+ | |||
+ | load { | ||
+ | format = " | ||
+ | } | ||
+ | |||
+ | # processor temperature | ||
+ | cpu_temperature 0 { | ||
+ | format = " %degrees °C " | ||
+ | path = "/ | ||
+ | } | ||
+ | # system temperature | ||
+ | cpu_temperature 1 { | ||
+ | format = " %degrees °C " | ||
+ | path = "/ | ||
+ | } | ||
+ | |||
+ | disk "/" | ||
+ | format = "/ %percentage_used " | ||
+ | } | ||
+ | |||
+ | volume master { | ||
+ | format = " vol %volume " | ||
+ | device = " | ||
+ | mixer = " | ||
+ | mixer_idx = 0 | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ======= Skripte unter .i3/ | ||
+ | |||
+ | |||
+ | Die Skripte enthalten Befehle, die ich oft benutze. Einige davon benötigen root-Rechte. | ||
+ | Meine Lösung für den Fall ist, dass ich meinem Account erlaube diese Befehle mit sudo ausführen darf ohne ein Passwort einzugeben. | ||
+ | Das sieht für user **user** und den Befehl **command** dann in der **/ | ||
+ | user ALL = NOPASSWD: | ||
+ | |||
+ | Wichtig: der **command** muss mit vollständigen Pfad angegeben werden, also beispielsweise **/ | ||
+ | Diesen Pfad findet man im Zweifel mit **whereis** (oder **which**). | ||
+ | |||
+ | Ein paar Beispiele, was ich alles als actions habe: | ||
+ | |||
+ | Suspend-to-disk: | ||
+ | #!/bin/sh | ||
+ | i3lock -c "# | ||
+ | |||
+ | Bildschirm sperren: **lock** | ||
+ | #!/bin/sh | ||
+ | i3lock -c "# | ||
+ | |||
+ | Ausloggen: **quit** | ||
+ | #!/bin/sh | ||
+ | i3-msg " | ||
+ | |||
+ | Neustarten: **reboot** | ||
+ | #!/bin/sh | ||
+ | sudo shutdown -r now | ||
+ | |||
+ | i3 Config neu laden (Session inklusive aller Fenster bleibt erhalten, Statusbar bleibt wie sie ist): **reload** | ||
+ | #!/bin/sh | ||
+ | i3-msg " | ||
+ | |||
+ | i3 neu starten (Session inklusive aller Fenster bleibt erhalten, Statusbar wird neugestartet): | ||
+ | #!/bin/sh | ||
+ | i3-msg " | ||
+ | |||
+ | Bildschirm auf VGA spiegeln: **vgamirror** | ||
+ | #!/bin/sh | ||
+ | | ||