2019-01-31 09:41:03 +01:00
#+TITLE : I3 Configuration
2019-05-16 21:13:08 +02:00
:DRAWER:
2020-01-11 22:04:28 +01:00
#+STARTUP : overview
#+LANGUAGE : en
#+EMAIL : dehaeze.thomas@gmail.com
#+AUTHOR : Dehaeze Thomas
#+HTML_LINK_HOME : ./index.html
#+HTML_LINK_UP : ./index.html
2020-01-11 22:24:51 +01:00
#+HTML_HEAD : <link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
#+HTML_HEAD : <link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
#+HTML_HEAD : <script type="text/javascript" src="./js/jquery.min.js"></script>
#+HTML_HEAD : <script type="text/javascript" src="./js/bootstrap.min.js"></script>
#+HTML_HEAD : <script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
#+HTML_HEAD : <script type="text/javascript" src="./js/readtheorg.js"></script>
2020-01-11 22:04:28 +01:00
2019-12-29 15:13:00 +01:00
#+PROPERTY : header-args:conf :comments none
2019-01-31 09:41:03 +01:00
#+PROPERTY : header-args:conf+ :mkdirp yes
2019-03-05 22:08:13 +01:00
#+PROPERTY : header-args:conf+ :tangle ~/.config/i3/config
2019-05-16 21:13:08 +02:00
:END:
2019-12-29 15:13:00 +01:00
* Basic configuration
** Colors
2019-05-16 21:13:08 +02:00
#+begin_src conf
set $bg #32302f
set $bg1 #3c3836
set $bg2 #504945
set $bg3 #665c54
set $bg4 #7c6f64
set $fg #ebdbb2
set $fg1 #ebdbb2
set $fg2 #d5c4a1
set $fg3 #bdae93
set $fg4 #a89984
set $gray #a89984
set $red #cc241d
set $green #98971a
set $yellow #d79921
set $blue #458588
set $purple #b16286
set $aqua #689d6a
set $orange #d65d0e
#+end_src
2019-01-31 09:41:03 +01:00
2019-12-29 15:13:00 +01:00
** Mod Key
2019-04-05 09:28:34 +02:00
Set mod key (Mod1=<Alt>, Mod4= <Super >)
2019-01-31 09:41:03 +01:00
#+BEGIN_SRC conf
2019-04-05 09:28:34 +02:00
set $mod Mod4
2019-01-31 09:41:03 +01:00
#+end_src
2019-12-29 15:13:00 +01:00
** Border Style
2019-01-31 09:41:03 +01:00
#+begin_src conf
2019-04-05 09:28:34 +02:00
# Configure border style <normal|1pixel|pixel xx|none|pixel >
2019-05-16 21:13:08 +02:00
new_window pixel 1
2019-04-05 09:28:34 +02:00
new_float normal
2019-05-16 21:13:08 +02:00
2019-04-05 09:28:34 +02:00
# Hide borders
2019-05-16 21:13:08 +02:00
hide_edge_borders smart
2019-01-31 09:41:03 +01:00
#+end_src
2019-12-29 15:13:00 +01:00
** Font for window titles
2019-01-31 09:41:03 +01:00
#+begin_src conf
2019-04-10 16:42:28 +02:00
font Hack Nerd Font 11
2019-01-31 09:41:03 +01:00
#+end_src
2019-12-29 15:13:00 +01:00
** Color palette used for the terminal ( ~/.Xresources file )
Colors are gathered based on the documentation https://i3wm.org/docs/userguide.html#xresources.
2019-12-15 10:53:57 +01:00
2019-04-04 12:33:09 +02:00
#+begin_src conf
2019-12-29 15:13:00 +01:00
set_from_resource $darkred color1 #000000
set_from_resource $red color9 #000000
set_from_resource $darkgreen color2 #000000
set_from_resource $green color10 #000000
set_from_resource $darkyellow color3 #000000
set_from_resource $yellow color11 #000000
set_from_resource $darkblue color4 #000000
set_from_resource $blue color12 #000000
set_from_resource $darkmagenta color5 #000000
set_from_resource $magenta color13 #000000
set_from_resource $darkcyan color6 #000000
set_from_resource $cyan color14 #000000
set_from_resource $darkwhite color7 #000000
set_from_resource $white color15 #000000
2019-01-31 09:41:03 +01:00
2019-12-29 15:13:00 +01:00
# Use custom colors for black
set $black #282828
set $darkblack #1d2021
set $transparent #00000000
2019-08-23 10:01:56 +02:00
#+end_src
2020-01-11 22:24:51 +01:00
** Theme colors
2019-05-16 21:13:08 +02:00
#+begin_src conf
2019-12-29 15:13:00 +01:00
# class border backgr. text indic. child_border
client.focused $blue $blue $fg $blue
client.focused_inactive $bg $bg $fg $bg
client.urgent $bg $bg $fg $bg
client.unfocused $bg $bg $fg $bg
client.placeholder $bg $bg $fg $bg
2019-01-31 09:41:03 +01:00
2019-12-29 15:13:00 +01:00
client.background #32302F
2019-05-16 21:13:08 +02:00
#+end_src
2019-01-31 09:41:03 +01:00
2019-12-29 15:13:00 +01:00
** Settings for i3-gaps
2019-05-16 21:13:08 +02:00
#+begin_src conf
2019-12-29 15:13:00 +01:00
# Set inner/outer gaps
gaps inner 10
gaps outer -2
2019-12-15 10:53:57 +01:00
2019-12-29 15:13:00 +01:00
# Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size.
# gaps inner|outer current|all set|plus|minus <px >
# gaps inner all set 10
# gaps outer all plus 5
2019-05-16 21:13:08 +02:00
2019-12-29 15:13:00 +01:00
# Smart gaps (gaps used if only more than one container on the workspace)
# smart_gaps on
2019-12-15 10:53:57 +01:00
2019-12-29 15:13:00 +01:00
# Smart borders (draw borders around container only if it is not the only container on this workspace)
# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0)
# smart_borders on
2019-05-16 21:13:08 +02:00
2019-12-29 15:13:00 +01:00
# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces.
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
2019-12-15 10:53:57 +01:00
2019-12-29 15:13:00 +01:00
mode "$mode_gaps" {
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
2019-05-16 21:13:08 +02:00
bindsym Escape mode "default"
}
2019-12-29 15:13:00 +01:00
mode "$mode_gaps_inner" {
bindsym plus gaps inner current plus 5
bindsym minus gaps inner current minus 5
2019-05-16 21:13:08 +02:00
2019-12-29 15:13:00 +01:00
bindsym 0 gaps inner current set 0
2019-05-16 21:13:08 +02:00
2019-12-29 15:13:00 +01:00
bindsym Shift+plus gaps inner all plus 5
bindsym Shift+minus gaps inner all minus 5
bindsym Shift+0 gaps inner all set 0
2019-12-15 10:53:57 +01:00
2019-12-29 15:13:00 +01:00
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
bindsym plus gaps outer current plus 5
bindsym minus gaps outer current minus 5
bindsym 0 gaps outer current set 0
2019-06-22 17:26:56 +02:00
2019-12-29 15:13:00 +01:00
bindsym Shift+plus gaps outer all plus 5
bindsym Shift+minus gaps outer all minus 5
bindsym Shift+0 gaps outer all set 0
2019-12-15 10:53:57 +01:00
2019-12-29 15:13:00 +01:00
bindsym Return mode "default"
bindsym Escape mode "default"
}
2019-05-16 21:13:08 +02:00
#+end_src
2020-01-11 22:24:51 +01:00
** Workspace names
2019-12-29 15:13:00 +01:00
To display names or symbols instead of plain workspace numbers you can use something like: =set $ws1 1:mail= and =set $ws2 2:= .
2019-12-15 10:53:57 +01:00
2019-05-16 21:13:08 +02:00
#+begin_src conf
2019-12-29 15:13:00 +01:00
set $ws1 1
set $ws2 2
set $ws3 3
set $ws4 4
set $ws5 5
set $ws6 6
set $ws7 7
set $ws8 8
2019-05-16 21:13:08 +02:00
#+end_src
2019-03-05 22:08:13 +01:00
2020-01-11 22:24:51 +01:00
** Use Mouse+$mod to drag floating windows
2019-12-29 15:13:00 +01:00
#+begin_src conf
floating_modifier $mod
#+end_src
2019-12-15 10:53:57 +01:00
2019-12-30 17:21:56 +01:00
** Back and Forth
#+begin_src conf
workspace_auto_back_and_forth yes
#+end_src
2019-12-29 15:13:00 +01:00
** Application Specific
*** Open applications on specific workspaces
2019-05-16 21:13:08 +02:00
#+begin_src conf
2019-12-29 15:13:00 +01:00
# Matlab Figures
assign[title="^Fig"] $ws6
for_window [title="^Fig"] layout tabbed
assign[title="^HG_Peer"] $ws6 # Name of window when export figure with matlab
2019-01-31 09:41:03 +01:00
#+end_src
2019-12-29 15:13:00 +01:00
*** Open specific applications in floating mode
2019-01-31 09:41:03 +01:00
#+begin_src conf
2019-12-29 15:13:00 +01:00
for_window [title="File Transfer*"] floating enable
for_window [class="GParted"] floating enable border normal
for_window [title="i3_help"] floating enable sticky enable border normal
for_window [class="Lightdm-settings"] floating enable
for_window [class="Lxappearance"] floating enable sticky enable border normal
for_window [class="Manjaro Settings Manager"] floating enable border normal
for_window [class="Pamac-manager"] floating enable
for_window [class="Pavucontrol"] floating enable
for_window [class="qt5ct"] floating enable sticky enable border normal
for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal
for_window [class="Simple-scan"] floating enable border normal
for_window [class="(?i)System-config-printer.py"] floating enable border normal
for_window [class="Timeset-gui"] floating enable border normal
for_window [class="(?i)virtualbox"] floating enable border normal
for_window [class="Xfburn"] floating enable
for_window [title="^Documentation -"] floating enable border normal
for_window [class="Yad"] floating enable
for_window [title="Bluetooth Devices"] floating enable
for_window [title="Simulink Library Browser"] floating enable
2019-01-31 09:41:03 +01:00
#+end_src
2020-01-11 22:24:51 +01:00
** Scratchpad
2019-01-31 09:41:03 +01:00
#+begin_src conf
2019-04-04 10:27:43 +02:00
# move the currently focused window to the scratchpad
bindsym $mod+Shift+BackSpace move scratchpad
2019-01-31 09:41:03 +01:00
2019-04-04 10:27:43 +02:00
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+BackSpace scratchpad show
2019-01-31 09:41:03 +01:00
#+end_src
2019-12-30 17:21:56 +01:00
* Run Polybar and SXHKD
2019-01-31 09:41:03 +01:00
#+begin_src conf
2019-12-29 15:13:00 +01:00
exec_always --no-startup-id $HOME/.config/polybar/scripts/launch.sh
exec_always --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3
2019-01-31 09:41:03 +01:00
#+end_src