summaryrefslogtreecommitdiffstats
path: root/.config/sway/config
blob: c251a252aea4df4bb2a8b6e6c4af698902d4dfa6 (plain) (blame)
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
set $font Source Code Pro Medium 10.5
font pango:$font

# super
set $mod Mod4
# alt
set $mod2 Mod1
# hyper
# set $mod3 Mod3

set $left h
set $down j
set $up k
set $right l

set $term foot
set $menu dmenu_path | wmenu -f '$font' | xargs swaymsg exec --

exec swayidle -w \
    timeout 600 'swaylock -f -c 000000' \
    timeout 610 'swaymsg "output * power off"' \
    resume 'swaymsg "output * power on"' \
    before-sleep 'swaylock -f -c 000000'

input * {
    repeat_delay 200
    repeat_rate 45
    xkb_layout us,ir
}

floating_modifier $mod normal

bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec $term -a 'footfl'
for_window [app_id="footfl"] floating enable
bindsym $mod+space exec $menu
bindsym $mod+backslash exec passmenu --type -f '$font'

bindsym $mod+Shift+w kill

bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart

set $mode_system System (l)ock | (e)xit sway | (s)uspend | (h)ibernate | (r)eboot | (S)hutdown
mode "$mode_system" {
    bindsym l       exec swaylock -f -c 000000, mode "default"
    bindsym e       exec swaymsg exit,          mode "default"
    bindsym s       exec sudo pm-suspend,       mode "default"
    # bindsym h       exec systemctl hibernate,   mode "default"
    bindsym r       exec sudo reboot,           mode "default"
    bindsym Shift+s exec sudo poweroff,         mode "default"

    bindsym Return  mode "default"
    bindsym Escape  mode "default"
    bindsym q       mode "default"
}
bindsym $mod+Shift+e mode "$mode_system"

bindsym $mod+apostrophe exec dmenu-light
bindsym XF86MonBrightnessUp exec light -A 5
bindsym XF86MonBrightnessDown exec light -U 5

bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym $mod+XF86AudioRaiseVolume exec pactl set-source-volume @DEFAULT_SOURCE@ +5%
bindsym $mod+XF86AudioLowerVolume exec pactl set-source-volume @DEFAULT_SOURCE@ -5%
bindsym $mod+XF86AudioMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle

bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus 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+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
bindsym $mod+bracketleft workspace prev
bindsym $mod+bracketright workspace next

bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
bindsym $mod+Shift+bracketleft move container to workspace prev
bindsym $mod+Shift+bracketright move container to workspace next

# bspwm-esque workspace switch and container move
bindsym $mod2+bracketleft        exec b-ws-util sway switch prev
bindsym $mod2+bracketright       exec b-ws-util sway switch next
bindsym $mod2+Shift+bracketleft  exec b-ws-util sway move prev follow
bindsym $mod2+Shift+bracketright exec b-ws-util sway move next follow

bindsym $mod+Shift+backslash splith
bindsym $mod+minus splitv

bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

bindsym $mod+f fullscreen

bindsym $mod+period floating toggle
bindsym $mod+comma focus mode_toggle

bindsym $mod+a focus parent
bindsym $mod+Shift+a focus child

bindsym $mod+Shift+s sticky toggle

bindsym $mod+Shift+o move scratchpad
bindsym $mod+o scratchpad show

mode "resize" {
    bindsym $left resize shrink width 10px
    bindsym $down resize grow height 10px
    bindsym $up resize shrink height 10px
    bindsym $right resize grow width 10px

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

mode notifications {
    bindsym Return exec makoctl invoke; exec makoctl dismiss; mode default
    bindsym d exec makoctl dismiss
    bindsym Shift+d exec makoctl dismiss -a; mode default
    bindsym r exec makoctl restore
    bindsym Escape mode default
    bindsym q mode default
}
bindsym $mod+n mode notifications

bar {
    position bottom

    # status_command while date +'%a, %d %b %Y %T %z'; do sleep 1; done
    status_command b-bar

    colors {
        statusline #ffffff
        background #000000
        inactive_workspace #32323200 #32323200 #5c5c5c
    }
}

seat seat0 hide_cursor 5000
seat seat0 xcursor_theme DMZ-White

default_border pixel 4
hide_edge_borders smart

for_window [window_role="pop-up"] floating enable

for_window [app_id="mpv"] floating enable
for_window [app_id="mumble"] floating enable, inhibit_idle
for_window [app_id="nm-connection-editor"] floating enable
for_window [app_id="virt-manager"] floating enable
for_window [class="Vncviewer"] floating enable
for_window [class="TigerVNC Viewer"] floating enable
for_window [app_id="thunar"] floating enable
for_window [app_id="pavucontrol"] floating enable

for_window [app_id="firefox" title="^Picture-in-Picture$"] \
      floating enable, move position 68 ppt 67 ppt, sticky enable
for_window [app_id="firefox" title="Choose User Profile"] \
      floating enable
for_window [app_id="firefox" title="Sharing Indicator"] \
      floating enable, kill

exec mako >/tmp/mako.log 2>&1
exec dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec gsettings set 'org.gnome.desktop.interface' cursor-theme 'DMZ-White'
exec b-pacify
exec [ -x "$(command -v nm-applet)" ] && nm-applet

include ~/.config/sway/"$(hostname)"