From: Maximilian Friedersdorff Date: Fri, 4 May 2018 15:41:55 +0000 (+0100) Subject: Setup for i3 X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=03923e54a453891bdbb85cf70c55ede682260453;p=max%2Fdotfiles.git Setup for i3 --- diff --git a/i3/.config/i3/config b/i3/.config/i3/config new file mode 100644 index 0000000..1c8f03a --- /dev/null +++ b/i3/.config/i3/config @@ -0,0 +1,218 @@ +# Colors +set_from_resource $black i3wm.color0 #000000 +set_from_resource $black_super i3wm.color8 #000000 + +set_from_resource $red i3wm.color1 #ff0000 +set_from_resource $red_super i3wm.color9 #dd0000 + +set_from_resource $green i3wm.color2 #00ff00 +set_from_resource $green_super i3wm.color10 #00dd00 + +set_from_resource $yellow i3wm.color3 #000000 +set_from_resource $yellow_super i3wm.color11 #000000 + +set_from_resource $blue i3wm.color4 #000000 +set_from_resource $blue_super i3wm.color12 #000000 + +set_from_resource $magenta i3wm.color5 #000000 +set_from_resource $magenta_super i3wm.color13 #000000 + +set_from_resource $cyan i3wm.color6 #000000 +set_from_resource $cyan_super i3wm.color14 #000000 + +set_from_resource $white i3wm.color7 #000000 +set_from_resource $white_super i3wm.color15 #000000 + +client.focused $black $yellow_super $black $black $black +client.focused_inactive $black $black_super $white $black $black + + +set $mod Mod4 + +font pango:Liberation Mono 8 + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +bindsym Control+t mode "$ratpoison" + +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" + +mode "$ratpoison" { +# All/most commands in this mode should revert to the default mode on comleption. +# We are emulating ratpoison (kinda) here + +# Moving to workspaces +# bindsym n workspace next mode "default" +# bindsym Shift+n workspace prev mode "default" + + bindsym 1 mode "default" workspace $ws1 + bindsym 2 mode "default" workspace $ws2 + bindsym 3 mode "default" workspace $ws3 + bindsym 4 mode "default" workspace $ws4 + bindsym 5 mode "default" workspace $ws5 + bindsym 6 mode "default" workspace $ws6 + bindsym 7 mode "default" workspace $ws7 + bindsym 8 mode "default" workspace $ws8 + bindsym 9 mode "default" workspace $ws9 + bindsym 0 mode "default" workspace $ws10 + + bindsym Shift+1 mode "default" move container to workspace $ws1 + bindsym Shift+2 mode "default" move container to workspace $ws2 + bindsym Shift+3 mode "default" move container to workspace $ws3 + bindsym Shift+4 mode "default" move container to workspace $ws4 + bindsym Shift+5 mode "default" move container to workspace $ws5 + bindsym Shift+6 mode "default" move container to workspace $ws6 + bindsym Shift+7 mode "default" move container to workspace $ws7 + bindsym Shift+8 mode "default" move container to workspace $ws8 + bindsym Shift+9 mode "default" move container to workspace $ws9 + bindsym Shift+0 mode "default" move container to workspace $ws10 + +# Moving focus +# bindsym Tab focus right mode "default" +# bindsym Shift+Tab focus left mode "default" + + bindsym h focus left mode "default" + bindsym j focus down mode "default" + bindsym k focus up mode "default" + bindsym l focus right mode "default" + + +# Moving windows + bindsym Shift+h mode "default" move left + bindsym Shift+j mode "default" move down + bindsym Shift+k mode "default" move up + bindsym Shift+l mode "default" move right + +# Changing split modes + bindsym v split v mode "default" + bindsym o split h mode "default" + + + bindsym c mode "default" exec i3-sensible-terminal + bindsym q mode "default" kill + + bindsym Shift+e mode "default" exec dmenu_run + + bindsym Escape mode "default" + + bindsym $mod+l mode "default" exec "xscreensaver-command -lock&" + +} + + + +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# enter fullscreen mode for the focused container +bindsym $mod+t fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+r layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+f 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 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { +# These bindings trigger as soon as you enter the resize mode + +# Pressing left will shrink the window’s width. +# Pressing right will grow the window’s width. +# Pressing up will shrink the window’s height. +# Pressing down will grow the window’s height. + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + +# same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + +# back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+p mode "default" +} + +bindsym $mod+p mode "resize" + + + +hide_edge_borders both +workspace 1 output HDMI2 +workspace 2 output VGA1 + +focus_follows_mouse no + +focus_on_window_activation urgent + + + + + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + id bar_left + status_command conky-i3bar + position top + output HDMI2 + font pango:Liberation Mono 10 + colors { + background $black_super + focused_background $black + focused_workspace $black_super $yellow_super $black + active_workspace $black_super $blue_super $black + inactive_workspace $black_super $black_super $white_super + urgent_workspace $black $red_super $white + } +} + +bar { + id bar_right + position top + output VGA1 + font pango:Liberation Mono 10 + colors { + background $black_super + focused_background $black + focused_workspace $black_super $yellow_super $black + active_workspace $black_super $blue_super $black + inactive_workspace $black_super $black_super $white_super + urgent_workspace $black $red_super $white + } +} diff --git a/i3/.conkyrc b/i3/.conkyrc new file mode 100644 index 0000000..cc7d85e --- /dev/null +++ b/i3/.conkyrc @@ -0,0 +1,52 @@ +-- vim: ts=4 sw=4 noet ai cindent syntax=lua + +conky.config = { + out_to_x = false, + own_window = false, + out_to_console = true, + short_units = true, + update_interval = 0.5, + background = false, + max_text_width = 0, + total_run_times = 0, + short_units = true, + if_up_strictness = 'address', + use_spacer = 'left', + + cpu_avg_samples = 2, +}; + +conky.text = [[ +[ + ${if_running mutt} + {"full_text": "${new_mails mail_aber/Inbox} new mails", "color": "\#ffa500"}, + ${endif} + {"full_text": "Home ${fs_free /home} Free", "color": "\#ffffff"}, + {"full_text": "Root ${fs_free /root} Free", "color": "\#ffffff"}, + {"full_text": "Disk r:${diskio_read} w:${diskio_write}", "color": "\#ffffff"}, + {"full_text": "CPU ${cpu cpu0}%", "color": "\#ffffff"}, + { + "full_text": "d:${downspeed eno1} u:${upspeed eno1} ${addr eno1}", + "color": + ${if_match "${addr eno1}"=="No Address"} + "\#ff0000" + ${else} + "\#00ff00" + ${endif} + }, + ${if_match "${addr tun0}"!="No Address"} + {"full_text": "VPN", "color": "\#00ff00"}, + ${endif} + { + "full_text": "RAM ${memperc}%", + "color": + ${if_match ${memperc}<90} + "\#ffffff" + ${else} + "\#ff0000" + ${endif} + }, + {"full_text": "${time}", "color": "\#ffffff"} +], +]]; + diff --git a/i3/.local/bin/conky-i3bar b/i3/.local/bin/conky-i3bar new file mode 100755 index 0000000..ad8d8fd --- /dev/null +++ b/i3/.local/bin/conky-i3bar @@ -0,0 +1,9 @@ +#!/bin/sh + +echo '{"version":1}' + +echo '[' + +echo '[],' + +exec conky -c ~/.conkyrc