summaryrefslogtreecommitdiff
path: root/i3.conf
blob: 290cdf83c95cb27096d596037f3a8b0ae1c80163 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Use xev to see keycodes for special keys.

# Appearance and Styling {{{
set_from_resource $font       i3wm.font     pango:Fira Sans 10
set_from_resource $c_fg       i3wm.fg       #cdd6f4
set_from_resource $c_bg       i3wm.bg       #181825
set_from_resource $c_active   i3wm.active   #585b70
set_from_resource $c_inactive i3wm.inactive #b4befe
set_from_resource $c_urgent   i3wm.urgent   #f9e2af

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font $font

title_align center
default_border pixel 3
default_floating_border pixel 3
hide_edge_borders smart
gaps inner 15
gaps outer 0
smart_gaps on

# class                 border     background text         indicator  child_border
client.focused          $c_active  $c_active  $c_fg        $c_active  $c_active
client.focused_inactive $c_bg      $c_bg      $c_fg        $c_bg      $c_bg
client.unfocused        $c_bg      $c_bg      $c_inactive  $c_bg      $c_bg
client.urgent           $c_urgent  $c_urgent  $c_fg        $c_urgent  $c_urgent
client.placeholder      $c_bg      $c_bg      $c_inactive  $c_bg      $c_bg
client.background       $c_bg
# }}}

# Basic Configuration {{{
# use the Super key as $mod
set $mod Mod4

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# using plasma's logout screen instead of i3's
#bindsym $mod+shift+e exec --no-startup-id qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1

# essential applications
bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+i exec icecat --new-window
bindsym $mod+shift+i exec icecat --new-tab "$(xclip -out)"
bindsym $mod+e exec $EDITOR
# Use ASYNC_EDITOR so I can continue using ranger while the editor
# remains open in a separate window.
bindsym $mod+slash exec kitty -o term=xterm-kitty -T ranger env "EDITOR=$ASYNC_EDITOR" ranger
bindsym $mod+semicolon exec --no-startup-id nheko
# bindsym $mod+z exec konsole --fullscreen --profile rga-fzf
bindsym $mod+y exec --no-startup-id connect-headphones.sh connect
bindsym $mod+shift+y exec --no-startup-id connect-headphones.sh disconnect

# notifications
bindsym $mod+n exec dunstctl close
bindsym $mod+shift+n exec dunstctl history-pop
bindsym $mod+period exec dunstctl context

# screen locking
bindsym $mod+shift+slash exec dunstctl set-paused true && xset dpms 5 5 5 && i3lock -n && xset dpms 0 0 0 && dunstctl set-paused false

# kill focused window
bindsym $mod+shift+q kill

# rofi menus
bindsym $mod+q exec rofi -show combi
bindsym $mod+d exec --no-startup-id krunner
bindsym $mod+p exec passmenu --type-all
bindsym $mod+shift+p exec passmenu --type-pass
bindsym $mod+o exec passmenu --type-otp
bindsym $mod+comma exec rofi-colors.sh
bindsym $mod+shift+Return exec rofi -show ssh
# }}}

# Basic Movement {{{
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
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+h move left
bindsym $mod+shift+j move down
bindsym $mod+shift+k move up
bindsym $mod+shift+l move right
bindsym $mod+shift+Left move left
bindsym $mod+shift+Down move down
bindsym $mod+shift+Up move up
bindsym $mod+shift+Right move right

bindsym $mod+a focus parent
bindsym $mod+shift+a focus child
# }}}

# Layout {{{
bindsym $mod+b split h
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
bindsym $mod+shift+f floating enable, resize set 1920 1080, move position 0 0

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+x layout toggle split

bindsym $mod+shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# scratchpad
bindsym $mod+numbersign scratchpad show
bindsym $mod+shift+numbersign move to scratchpad
bindsym $mod+apostrophe sticky disable, floating disable
bindsym $mod+shift+apostrophe sticky enable, floating enable

# move workspaces
bindsym $mod+shift+comma  move workspace to output left
bindsym $mod+shift+period move workspace to output right
# }}}

# Default Workspaces {{{
# switch to workspace
bindsym $mod+Escape workspace back_and_forth
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
bindsym $mod+parenleft  workspace prev
bindsym $mod+parenright workspace next

# move focused container to workspace
bindsym $mod+shift+Escape move container to workspace back_and_forth
bindsym $mod+shift+1 move container to workspace 1
bindsym $mod+shift+2 move container to workspace 2
bindsym $mod+shift+3 move container to workspace 3
bindsym $mod+shift+4 move container to workspace 4
bindsym $mod+shift+5 move container to workspace 5
bindsym $mod+shift+6 move container to workspace 6
bindsym $mod+shift+7 move container to workspace 7
bindsym $mod+shift+8 move container to workspace 8
bindsym $mod+shift+9 move container to workspace 9
bindsym $mod+shift+0 move container to workspace 10
bindsym $mod+shift+parenleft  move container to workspace prev
bindsym $mod+shift+parenright move container to workspace next
# }}}

# Custom Workspaces {{{
set $ws_terminal 0:>_
bindsym $mod+grave workspace "$ws_terminal"
bindsym $mod+shift+grave move container to workspace "$ws_terminal"

set $ws_coding 50:🖊️
bindsym $mod+c workspace "$ws_coding"
bindsym $mod+shift+c move container to workspace "$ws_coding"

set $ws_games 60:🎮
bindsym $mod+g workspace "$ws_games"
bindsym $mod+shift+g move container to workspace "$ws_games"

set $ws_music 80:🎵
bindsym $mod+u workspace "$ws_music"
bindsym $mod+shift+u move container to workspace "$ws_music"

set $ws_messaging 90:💬
bindsym $mod+m workspace "$ws_messaging"
bindsym $mod+shift+m move container to workspace "$ws_messaging"

assign [class="^Franz$"]             "$ws_messaging"
assign [window_role="^weechat$"]     "$ws_messaging"
assign [window_role="^mutt$"]        "$ws_messaging"
assign [class="^evolution-initial$"] "$ws_messaging"
assign [class="^kontact$"]           "$ws_messaging"

# NOTE: no_focus will also be ignored for the first window on a workspace as
# there shouldnt be a reason to not focus the window in this case. This allows
# for better usability in combination with workspace_layout. (From i3 docs)
#no_focus [class="^Franz$"]
#no_focus [window_role="^weechat$"]
#no_focus [window_role="^mutt$"]
#no_focus [class="^evolution-initial$"]

## PlayOnLinux
for_window [title="PlayOnLinux"] floating enable

## Plasma/KDE: https://ryanlue.com/posts/2019-06-13-kde-i3
# Dont treat Plasma pop-ups as full-sized windows
for_window [class="plasmashell"] floating enable
# Dont spawn an empty window for the Plasma Desktop
for_window [title="Desktop — Plasma"] move scratchpad
# Dont let notifications and non-interactive pop-up windows steal focus
#no_focus [class="plasmashell" window_type="on_screen_display"]
# https://github.com/heckelson/i3-and-kde-plasma
# Move notifications to top-right corner.
#for_window [class="plasmashell" window_type="notification"] move up 400, move right 750, no_focus
# Notifications appear in the centre of the screen. According to
# https://old.reddit.com/r/i3wm/comments/bw1yfs/kde_notifications_appearing_in_the_centre_of/,
# setting notifications to appear in the top-left corner gets placement right.
no_focus [class="plasmashell" window_type="notification"]

for_window [class="^Pyneedle$"]         floating enable
for_window [instance="^emacs-initial$"] floating enable
for_window [class="^Spotify$"]          move container to workspace "$ws_music"
for_window [class="^Pidgin$"]           move container to workspace "$ws_messaging"
# }}}

# Modes {{{
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

    bindsym shift+h resize shrink width  5 px or 5 ppt
    bindsym shift+j resize grow   height 5 px or 5 ppt
    bindsym shift+k resize shrink height 5 px or 5 ppt
    bindsym shift+l resize grow   width  5 px or 5 ppt

    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

    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+r     mode "resize"
# }}}

# Autostart Applications {{{
#exec --no-startup-id /usr/bin/systemctl --no-block --user start display-manager-i3.service #xsession.target
exec --no-startup-id ~/.config/X11/xinitrc
# }}}

bar {
  status_command i3status
  #mode hide  # only show up when pressing $mod
  modifier $mod
  position bottom
  tray_output primary
  # Fitts's law
  tray_padding 0
  workspace_min_width 20 px
  strip_workspace_numbers yes
  binding_mode_indicator yes
}