templier-ansible/roles/i3/templates/i3.j2

242 lines
6.5 KiB
Django/Jinja

{{ ansible_header | comment }}
# 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!
exec /home/ynerant/.fehbg
exec dunst
exec nm-applet
exec battery
exec mpd
exec mpd_reader
{% if laptop.numpad %}
exec numlockx
{% endif %}
set $mod Mod4
set $refresh killall -SIGUSR1 i3status
floating_modifier $mod
# 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
# Center window title and remove edges from windows
title_align center
hide_edge_borders both
# Bindings for volume and light
bindsym XF86MonBrightnessDown exec light -U 1
bindsym XF86MonBrightnessUp exec light -A 1
bindsym XF86AudioRaiseVolume exec volume -A 5 && $refresh
bindsym XF86AudioLowerVolume exec volume -U 5 && $refresh
bindsym Shift+XF86MonBrightnessDown exec light -U 1
bindsym Shift+XF86MonBrightnessUp exec light -A 1
bindsym Shift+XF86AudioRaiseVolume exec volume -A 1 && $refresh
bindsym Shift+XF86AudioLowerVolume exec volume -U 1 && $refresh
bindsym XF86AudioMute exec volume -T && $refresh
bindsym XF86AudioMicMute exec volume -M && $refresh
{% if not laptop.numpad %}
# Binding for mpd
bindsym KP_Add exec mpc next && $refresh
bindsym KP_Subtract exec mpc prev && $refresh
bindsym KP_Multiply exec mpc toggle && $refresh
bindsym $mod+F3 exec mpc volume +5
bindsym $mod+F2 exec mpc volume -5
{% endif %}
# Binding to toggle mouse tapping
bindsym XF86TouchpadToggle exec mouse_tap toggle
# start a terminal
bindsym $mod+Return exec xfce4-terminal -x tmux
bindsym $mod+Shift+Return exec xfce4-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run -l 1 -p '[ ynerant@morgoth ~ ]'
bindsym XF86Search exec dmenu_run -l 1
# Launch passmenu
bindsym $mod+t exec passmenu
# Screenshots
bindsym --release Print exec screenshot
bindsym --release Control+Print exec screenshot -c
bindsym --release Shift+Print exec screenshot -s
bindsym --release Control+Shift+Print exec screenshot -s -c
# Binding to lock screen
bindsym $mod+Escape exec physlock
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+h focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+l focus right
# Move through output
bindsym $mod+j focus output down
bindsym $mod+k focus output up
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+h move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+Shift+l move right
# Move workspace between output
bindsym $mod+Shift+j move workspace to output down
bindsym $mod+Shift+k move workspace to output up
# split in horizontal orientation
bindsym $mod+s 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+w layout tabbed
bindsym $mod+e layout toggle split
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+y focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws0 "0"
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"
# Screen workspace
workspace $ws0 output eDP-1
workspace $ws1 output eDP-1
workspace $ws2 output eDP-1
workspace $ws3 output eDP-1
workspace $ws4 output eDP-1
workspace $ws5 output eDP-1
workspace $ws6 output eDP-1
workspace $ws7 output eDP-1
workspace $ws8 output eDP-1
workspace $ws9 output eDP-1
workspace $ws10 output eDP-1
# switch to workspace
bindsym $mod+0xb2 workspace $ws0
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+0xb2 move container to workspace $ws0
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
# Leave fullscreen on new window
popup_during_fullscreen leave_fullscreen
# Cycle through workspace
bindsym $mod+Tab workspace next_on_output
bindsym $mod+Shift+Tab workspace prev_on_output
# Dont focus discord (for thunderbird passwd)
no_focus [class="(?i)discord"]
# 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-msg exit"
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym Left resize shrink width 1 px or 1 ppt
bindsym Down resize grow height 1 px or 1 ppt
bindsym Up resize shrink height 1 px or 1 ppt
bindsym Right resize grow width 1 px or 1 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Window thickness
new_window 1pixel
# Toogle bar-1 visibility
bindsym $mod+x bar mode invisible bar-1
bindsym $mod+Shift+x bar mode toggle bar-1
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
output eDP-1
tray_output eDP-1
mode hide
status_command i3status
strip_workspace_numbers yes
}
bar {
output HDMI-2
mode hide
status_command i3status
strip_workspace_numbers yes
}
{% if laptop.touchscreen %}
exec xinput --set-prop 14 "libinput Natural Scrolling Enabled" 1
{% endif %}