~pvsr/dotfiles

ref: 8741d17b83c8ae9fa18dd7e2b0d4d34ca422f8ec dotfiles/sway/.config/sway/config -rw-r--r-- 5.6 KiB
8741d17bPeter Rice commit local changes 2 years ago
                                                                                
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
# Logo key. Use Mod1 for Alt.
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term /usr/bin/alacritty
set $font Sarasa Term J
set $menu j4-dmenu-desktop --dmenu="dmenu -i -fn '$font-12'"
# TODO reenable this when https://github.com/swaywm/sway/issues/1524 and
# https://github.com/DaveDavenport/rofi/issues/446 are resolved
# set $menu rofi -combi-modi 'window,drun' -show combi -modi combi
font $font 13

default_border pixel 2
hide_edge_borders smart

input * xkb_layout us
input * xkb_variant altgr-intl
input * xkb_options ctrl:nocaps

# output * bg ~/wallpaper.jpg fit

bindsym $mod+Return exec $term
bindsym $mod+Shift+q kill
bindsym $mod+d exec $menu
bindsym $mod+p exec passmenu -i -fn "$font-12"
floating_modifier $mod normal
bindsym $mod+Shift+c reload
bindsym $mod+Shift+e exit

bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right

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+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
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+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+b splith
bindsym $mod+v splitv

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

bindsym $mod+f fullscreen
bindsym $mod+Shift+space floating toggle

bindsym $mod+space focus mode_toggle

bindsym $mod+a focus parent

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

mode "resize" {
    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 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 Control+bracketleft mode "default"
}
bindsym $mod+r mode "resize"

bindsym --locked XF86AudioPlay exec ~/bin/toggle
bindsym --locked XF86AudioPrev exec mpc prev
bindsym --locked XF86AudioNext exec mpc next
bindsym --locked XF86AudioStop exec mpc stop
bindsym --locked XF86AudioMute exec pamixer --toggle-mute && pkill -RTMIN+10 i3blocks && (pamixer --get-mute && echo 0 > $SWAYSOCK.wob) || pamixer --get-volume > $SWAYSOCK.wob
bindsym --locked XF86AudioRaiseVolume exec pamixer -ui 5 && pkill -RTMIN+10 i3blocks && pamixer --get-volume > $SWAYSOCK.wob
bindsym --locked XF86AudioLowerVolume exec pamixer -ud 5 && pkill -RTMIN+10 i3blocks && pamixer --get-volume > $SWAYSOCK.wob

bindsym Print exec grim $(xdg-user-dir PICTURES)/screenshots/$(date +"%Y-%m-%d-%H:%M:%S.png")
bindsym Shift+Print exec slurp | grim -g - $(xdg-user-dir PICTURES)/screenshots/$(date +"%Y-%m-%d-%H:%M:%S.png")

workspace_auto_back_and_forth yes
bindsym $mod+z workspace back_and_forth
bindsym $mod+Shift+z move container to workspace back_and_forth

include ~/.config/sway/conf.d/*

bar {
    position top
    status_command SCRIPT_DIR=~/.config/i3blocks/i3blocks-contrib i3blocks
    colors {
        separator $red
        background $black
        statusline $white
        # class             border      background    text
        focused_workspace   $dark2      $dark2        $white
        active_workspace    $dark1      $dark1        $white
        inactive_workspace  $black      $black        $lightgray
        urgent_workspace    $black      $black        $darkyellow
        binding_mode        $dark2      $dark2        $white
  }
}

# class                 border      backgr.     text    indicator child_border
client.focused          $dark2      $dark2      $white  $black    $dark2
client.focused_inactive $dark1      $dark1      $white  $black    $dark1
client.unfocused        $black      $black      $white  $black    $black
client.urgent           $black      $black      $white  $black    $black

set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
    bindsym l exec swaylock -c "$black", mode "default"
    bindsym e exit
    bindsym s exec swaylock -c "$black" -f && systemctl suspend, mode "default"
    bindsym h exec swaylock -c "$black" -f && systemctl hibernate, mode "default"
    bindsym r exec systemctl reboot -i, mode "default"
    bindsym Shift+s exec systemctl poweroff -i, mode "default"

    bindsym Return mode "default"
    bindsym Escape mode "default"
    bindsym Control+bracketleft mode "default"
}
bindsym $mod+q mode "$mode_system"

exec mako
exec mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob
# TODO idle