aboutsummaryrefslogtreecommitdiff
path: root/i3/.i3/config
blob: c008179746d76aa4cf29101bda9f5dfe04a7228c (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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
set $mod2 Mod4
set $mod Mod1

# hide title bar
new_window none

#font pango:monospace 10
font pango:Inconsolata\\-g for Powerline 8
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec --no-startup-id gnome-terminal

# start a file manager
bindsym $mod+Shift+Return exec --no-startup-id nautilus

# kill focused window
bindsym $mod+F4 kill
bindsym $mod+Shift+q kill

# start dmenu (a program launcher)
#bindsym $mod+d exec dmenu_run -nb '#002b36' -nf '#839496' -sb '#073642' -sf '#cb4b16'
bindsym $mod+d exec rofi -show combi
#bindsym $mod+d exec rofi combi -combi-modes "window,run,ssh" -modes combi


# lock the screen
bindsym Mod4+l exec i3lock -c 111111

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# mimic alt-tab functionality
bindsym $mod+Tab focus right

# focus does not follow mouse
focus_follows_mouse no

# switch between 2 recent workspaces quickly on pressing $mod+{workspaceselect}
workspace_auto_back_and_forth yes

# convenient binding for doing this
bindsym $mod+z workspace back_and_forth

# move windows back and forth and follow them
# comment out after ; to not follow window
bindsym $mod+Shift+z move container to workspace back_and_forth; workspace back_and_forth

# focus a window wherever it is
bindsym $mod+Shift+b [class="Firefox"] focus
bindsym $mod+Shift+i [class="Terminal" title="weechat"] focus
# alternatively, you can use the cursor keys:
# could even use marks but thats for another day

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

# 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+semicolon split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen

# 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

bindsym $mod+x [urgent=latest] focus

# monitor names - laptop dock
# set $ext1 DP2
# set $ext1 DP-2
# set $int1 LVDS1
# set $int1 LVDS1

# general
set $ext1 DP-4
set $ext2 HDMI-0

# browser workspace preferes external monitor
#workspace $ws1 output $ext1
#workspace $ws2 output $ext1
#workspace $ws3 output $ext1
#workspace $ws4 output $ext1
#workspace $ws5 output $ext1
#workspace $ws6 output $ext1
#workspace $ws7 output $ext1
#workspace $ws8 output $ext1
#workspace $ws9 output $ext2
#workspace $ws10 output $ext2


# workspace names
set $ws1 1: www
set $ws2 2: mail
set $ws3 3: irc
set $ws4 4: term
set $ws5 5: server
set $ws6 6: steam
set $ws7 7: music
set $ws8 8: file

# set a specific configuration on startup
# exec --no-startup-id  ~/bin/home_single.sh

# switch to workspace
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 9
bindsym $mod+0 workspace 10


# move focused container to workspace
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 9
bindsym $mod+Shift+0 move container to workspace 10

# Move the current workspace to the next output
# (effectively toggles when you only have two outputs)
bindsym $mod+o move workspace to output right

# Put this window on the presentation output.
bindsym $mod+p move container to output $ext1

# 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
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        #font pango:monospace 8
        font pango:pango:Inconsolata\\-g for Powerline 9
        separator_symbol " || "
        status_command i3status --config ~/.i3/status.conf
        position top
        workspace_buttons yes
        # tray_output none
        colors {
             separator #66322f
             background #002b36
             statusline #268bd2
             focused_workspace #fdf6e399 #002b3699 #fdf6e3
             active_workspace #fdf6e3 #6c71c499 #fdf6e3
             inactive_workspace #586e75 #93a1a199 #002b36
             urgent_workspace #d33682 #d3368299 #fdf6e3
        }
}

# start setting before any other settings
# disable screen saver and power savings
exec --no-startup-id xset s off -dpms
exec --no-startup-id xautolock -time 10 -locker i3lock -c 000000
exec --no-startup-id xset +fp $HOME/.fonts  
exec --no-startup-id xset fp rehash
exec --no-startup-id compton --backend glx --vsync opengl-swc
exec --no-startup-id dropbox start
exec_always --no-startup-id xrdb -merge ~/.Xresources
exec --no-startup-id nm-applet
exec --no-startup-id  /opt/piavpn/bin/pia-client

# set a particular desktop background
#exec_always --no-startup-id feh --bg-scale ~/onedrive/stuff/wallpapers/solarized-dark/solarized-wallpaper-kernel.png 

exec --no-startup-id udiskie --tray
#exec --no-startup-id redshift-gtk -l xxxxxxxxxxxxxx  #where xxxxxxxx=lat:long
#of your location
#exec --no-startup-id unclutter
exec --no-startup-id blueman-tray

# Pulse Audio controls second pair works on arch
#bindsym XF86AudioMute exec amixer set Master 1+ toggle # mute sound
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle

bindsym XF86AudioMicMute exec amixer set Capture toggle # mute mic
# increase volume
#bindsym XF86AudioRaiseVolume exec amixer -q set Master 5%+ unmute
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%

# # decrease volume
#bindsym XF86AudioLowerVolume exec amixer -q set Master 5%- unmute
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%


# Screen brightness controls
bindsym XF86MonBrightnessUp exec brightnessctl set +25% # increase screen brightness
bindsym XF86MonBrightnessDown exec brightnessctl set 25%- # decrease screen brightness

exec --no-startup-id dbus-update-activation-environment --all
exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=ssh,secrets,gpg

# Keybindings to start applications
bindsym $mod+b exec --no-startup-id firefox

# Screenshots !use scrot for lightweight alternative
bindsym Print exec gnome-screenshot

# Make the currently focused window a scratchpad
bindsym $mod+Shift+minus move scratchpad

# Show the first scratchpad window ! comment out if on older i3
bindsym $mod+minus scratchpad show
smart_borders on
gaps inner 4 px
gaps outer 2 px

# choose xrandr displaymode
set $username mango
set $mode_display Display mode (t) triple, (d) dual, (m) monitor, (l) laptop
mode "$mode_display" {
    bindsym t exec --no-startup-id  /home/$username/bin/.display triple, mode "default"
    bindsym d exec --no-startup-id  /home/$username/bin/.display dual, mode "default"
    bindsym m exec --no-startup-id  /home/$username/bin/.display monitor, mode "default"
    bindsym l exec --no-startup-id  /home/$username/bin/.display side-monitor, mode "default"

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

bindsym $mod+I mode "$mode_display"