dotfiles/i3/config

301 lines
9.5 KiB
Plaintext
Raw Normal View History

2019-08-09 14:56:06 +00:00
# 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).
#
set_from_resource $bg background #0c080b
set_from_resource $fg foreground #e5e3e3
2019-08-21 12:34:56 +00:00
set_from_resource $color_1 color1 #a83d63
2019-08-09 14:56:06 +00:00
set_from_resource $color_2 color2 #d09177
set_from_resource $color_4 color4 #b5659a
set_from_resource $color_6 color6 #aea0c7
set_from_resource $color_16 color16 #ffffff
2019-08-11 09:07:25 +00:00
set $screenshot_filename '%F-%H-%M-%S-$wx$h.png'
2019-08-18 00:30:14 +00:00
set $scrot_move_directory_command 'mv $f ~/screenshots'
2019-08-09 14:56:06 +00:00
2019-08-11 09:07:25 +00:00
exec_always feh --bg-scale ~/wallpapers/sand.jpg
2019-08-09 14:56:06 +00:00
# Startup applications
exec firefox
exec thunderbird
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# 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 10
# 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
font pango:Fira Code 10
2019-08-18 00:30:14 +00:00
font pango:Iosevka 11
2019-08-09 14:56:06 +00:00
# Setting up borders for windows of different states
2019-08-11 09:07:25 +00:00
default_border pixel 6
2019-08-21 12:34:56 +00:00
client.focused $color_2 $color_2 #ffffff
client.focused_inactive $color_2 $color_2 #ffffff
client.urgent $color_1 $color_1 #ffffff
2019-08-09 14:56:06 +00:00
# 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 doesnt 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 i3-sensible-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec rofi -show drun -sidebar-mode -theme fds-sidebar-dark
bindsym $mod+Shift+d exec ~/.scripts/rofi-user-action-menu.sh
2019-08-09 14:56:06 +00:00
# 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
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l 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+semicolon 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+b split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# jump to latest urgent window
bindsym $mod+x [urgent=latest] focus
# 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
# Volume keyboard control
2019-08-11 09:07:25 +00:00
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +1% ; exec pactl set-sink-mute @DEFAULT_SINK@ 0
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -1% ; exec pactl set-sink-mute @DEFAULT_SINK@ 0
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
2019-08-09 14:56:06 +00:00
# Moving between workspaces
bindsym XF86Back workspace prev
bindsym XF86Forward workspace next
bindsym $mod+Tab workspace next
bindsym Shift+$mod+Tab workspace prev
bindsym $mod+z move window to workspace next
bindsym Shift+$mod+z move window to workspace prev
2019-08-11 09:07:25 +00:00
# $mod + ` (backtick)
2019-08-09 14:56:06 +00:00
bindsym $mod+grave workspace back_and_forth
2019-08-11 09:07:25 +00:00
bindsym $mod+slash workspace back_and_forth
# Moving windows between workspaces
# $mod + Shift + ` (backtick)
2019-08-09 14:56:06 +00:00
bindsym Shift+$mod+grave move window to workspace back_and_forth
2019-08-11 09:07:25 +00:00
bindsym Shift+$mod+slash move window to workspace back_and_forth
2019-08-09 14:56:06 +00:00
# Application bound shortcuts
2019-08-11 09:07:25 +00:00
bindsym XF86HomePage exec alacritty --class "ranger" --command ranger
2019-08-09 14:56:06 +00:00
bindsym XF86Mail exec thunderbird
2019-08-19 01:04:33 +00:00
# Screenshot capture
2019-08-18 00:30:14 +00:00
bindsym Print exec ~/.scripts/maim-screenshot.sh
2019-08-21 12:34:56 +00:00
bindsym Control+Print exec ~/.scripts/maim-screenshot.sh --select
2019-08-09 14:56:06 +00:00
2019-08-19 01:04:33 +00:00
# Delayed screenshot capture
2019-08-21 12:34:56 +00:00
bindsym Shift+Print exec ~/.scripts/maim-screenshot.sh --delay 3
bindsym Control+Shift+Print exec ~/.scripts/maim-screenshot.sh --select --delay 3
2019-08-19 01:04:33 +00:00
2019-08-24 16:25:57 +00:00
# Screen record (Alt + Print)
bindsym $mod+Print exec ~/.scripts/screen-record.sh --scene barless-screen
bindsym $mod+Shift+Print exec ~/.scripts/screen-record.sh --scene fullscreen
2019-08-09 14:56:06 +00:00
# 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 $web_ws "1"
set $mail_ws "2"
set $code_ws "3"
set $vim_ws "4"
set $graphics_ws "5"
set $file_ws "6"
2019-08-21 12:34:56 +00:00
set $music_ws "7"
2019-08-09 14:56:06 +00:00
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# automatic back-and-forth switching with $mod+<num>
workspace_auto_back_and_forth yes
2019-08-11 09:07:25 +00:00
assign [instance="^(?i)vim$"] $vim_ws
2019-08-09 14:56:06 +00:00
assign [class="^(?i)vim$"] $vim_ws
2019-08-11 09:07:25 +00:00
assign [instance="^(?i)ranger$"] $file_ws
assign [class="^(?i)ranger$"] $file_ws
assign [class="^(?i)code-oss$"] $code_ws
2019-08-09 14:56:06 +00:00
assign [class="^(?i)inkscape$"] $graphics_ws
assign [class="^(?i)thunderbird$"] $mail_ws
# switch to workspace
bindsym $mod+1 workspace $web_ws
bindsym $mod+2 workspace $mail_ws
bindsym $mod+3 workspace $code_ws
bindsym $mod+4 workspace $vim_ws
bindsym $mod+5 workspace $graphics_ws
bindsym $mod+6 workspace $file_ws
2019-08-21 12:34:56 +00:00
bindsym $mod+7 workspace $music_ws
2019-08-09 14:56:06 +00:00
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 $web_ws
bindsym $mod+Shift+2 move container to workspace $mail_ws
bindsym $mod+Shift+3 move container to workspace $code_ws
bindsym $mod+Shift+4 move container to workspace $vim_ws
bindsym $mod+Shift+5 move container to workspace $graphics_ws
bindsym $mod+Shift+6 move container to workspace $file_ws
2019-08-21 12:34:56 +00:00
bindsym $mod+Shift+7 move container to workspace $music_ws
2019-08-09 14:56:06 +00:00
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
# reload the configuration file
bindsym $mod+r reload
2019-08-09 14:56:06 +00:00
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# resize window (you can also use the mouse for that)
mode "resize" {
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
2019-08-11 09:07:25 +00:00
2019-08-09 14:56:06 +00:00
# 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
2019-08-11 09:07:25 +00:00
2019-08-09 14:56:06 +00:00
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+q mode "default"
2019-08-09 14:56:06 +00:00
}
bindsym $mod+q mode "resize"
2019-08-09 14:56:06 +00:00
# Make dialogs to float by default
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
# This is mostly for limiting pop-up dialogs
floating_maximum_size 750 x 650
mode "applications" {
# Here you can add/remove/modify applications of your own, if you want
bindsym c exec code
bindsym f exec firefox
bindsym v exec inkscape
2019-08-11 09:07:25 +00:00
bindsym r exec alacritty --class "ranger" --command ranger
2019-08-15 17:10:42 +00:00
bindsym Shift+r exec alacritty --command ranger
2019-08-09 14:56:06 +00:00
bindsym t exec thunderbird
bindsym a exec thunar
2019-08-11 09:07:25 +00:00
bindsym x exec alacritty --class "vim" --command vim
2019-08-15 17:10:42 +00:00
bindsym Shift+x exec alacritty --command vim
2019-08-21 12:34:56 +00:00
bindsym o exec obs
2019-08-09 14:56:06 +00:00
bindsym z exec zathura
2019-08-21 12:34:56 +00:00
2019-08-09 14:56:06 +00:00
# Ways to exit the mode
bindsym Escape mode "default"
bindsym Return mode "default"
bindsym $mod+a mode "default"
}
bindsym $mod+a mode "applications"; exec sleep 1 && i3-msg mode "default"
bindsym $mod+c [class="code"] focus
bindsym $mod+Shift+c [instance="vim"] focus
# Creating a lecture (it needs the custom lecture manager I created at
# https://github.com/foo-dogsquared/a-remote-repo-full-of-notes-of-things-i-do-not-know-about/)
2019-09-30 01:26:19 +00:00
bindsym $mod+Shift+s exec ~/.scripts/lecture-manager-shortcut.sh --config ~/texture-notes-profile/config.py --target ~
2019-08-09 14:56:06 +00:00
# i3 bar
bar {
height 35
2019-08-18 00:30:14 +00:00
font pango:Fira Code 10
font pango:Iosevka 11
2019-08-09 14:56:06 +00:00
position top
separator_symbol " "
status_command i3status
tray_padding 10
colors {
separator $color_16
background $bg
statusline $fg
# border #background #foreground
focused_workspace $color_2 $color_2 #ffffff
active_workspace $color_4 $color_4 #ffffff
inactive_workspace $bg $bg #888888
2019-08-21 12:34:56 +00:00
urgent_workspace $color_1 $color_1 #ffffff
2019-08-09 14:56:06 +00:00
}
}
# Setting the gaps
2019-08-11 09:07:25 +00:00
gaps inner 6
2019-08-09 14:56:06 +00:00
smart_gaps on
2019-08-11 09:07:25 +00:00
smart_borders on