-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig
197 lines (162 loc) · 6.89 KB
/
config
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
##################
# MY SWAY CONFIG #
##################
###### DEPENDENCIES ##################################################
### GENERAL SCRIPTING: ### #
# sh #
# sleep #
# nushell (for the `update-prev-focus.nu` script only) #
### GETTING SYSTEM STATUS: ### #
# cat #
# free #
# date #
### TEXT MANIPULATION: ### #
# echo #
# test #
# grep #
# awk #
### OTHER: ### #
# pactl for volume (called 'pulseaudio-utils') on fedora #
# brightnessctl for brightness #
# wtype to input keypresses into apps #
# jetbrains mono font (`jetbrains-mono-fonts-all` package on fedora) #
######################################################################
# =====================
# ===== VARIABLES =====
# =====================
# === MODKEY ===
set $mod Alt
# === WORKSPACES ===
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
# === COLORS ===
set $text-color #ffffff
set $faded-text-color #abb2bf
set $bg-color #282c34
set $alt-bg-color #1e222b
set $urgent-color #e06c75
# ====================
# ===== SETTINGS =====
# ====================
# === STARTUP CODE ===
exec ~/.config/sway/update-prev-focus.nu
# Fixes gnome terminal
# (See: https://github.com/swaywm/sway/wiki#systemd-and-dbus-activation-environments)
# (See: https://gitlab.archlinux.org/archlinux/packaging/packages/sway/-/blob/main/50-systemd-user.conf?ref_type=heads)
exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway
exec systemctl --user import-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME
exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway WAYLAND_DISPLAY
# === GENERAL ===
workspace_layout tabbed
title_align center
output "*" bg ./wallpaper.jpg fit $bg-color
default_border none
# Hides the titlebars if there is only one window in a container
hide_edge_borders --i3 smart
# I use this font for consistancy with the default font in ghostty
font JetBrains Mono 12
# === INPUTS ===
input "type:keyboard" xkb_options "ctrl:nocaps"
input "type:touchpad" {
dwt enabled
tap enabled
natural_scroll enabled
middle_emulation enabled
}
# ===================
# ===== TOP BAR =====
# ===================
# === COLORS === | border | background | text | indicator
client.focused $bg-color $bg-color $text-color #eeeeee
client.unfocused $alt-bg-color $alt-bg-color $faded-text-color #eeeeee
client.focused_inactive $alt-bg-color $alt-bg-color $faded-text-color #eeeeee
client.urgent $urgent-color $urgent-color $text-color #eeeeee
# === SETTINGS ===
bar {
position top
# When the status_command prints to stdout, swaybar updates.
status_command while echo $(~/.config/sway/status.sh); do sleep 30; done
colors {
statusline $text-color
background $alt-bg-color
# border background text
inactive_workspace $alt-bg-color $alt-bg-color $faded-text-color
urgent_workspace $urgent-color $urgent-color $text-color
focused_workspace $alt-bg-color $alt-bg-color $text-color
}
}
# =======================
# ===== KEYBINDINGS =====
# =======================
# === Rebind keys to be closer ===
bindsym --no-repeat --release Alt_L exec wtype -P escape -p escape # Press alt -> escape
bindsym --no-repeat --release Control_L exec wtype -P backspace -p backspace # Press control (caps lock) -> backspace
#bindsym --no-repeat --release Shift_L exec wtype -P return -p return # Press shift -> enter
# === SLEEP/SUSPEND ===
bindsym $mod+x exec systemctl suspend
# === ADJUST VOLUME ===
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
# === ADJUST BRIGHTNESS ===
bindsym XF86MonBrightnessDown exec brightnessctl s 5%-
bindsym XF86MonBrightnessUp exec brightnessctl s 5%+
# === OPEN APPS ===
# TERMINALS
bindsym $mod+t [con_mark=_prev_terminal] focus
bindsym $mod+g exec ghostty
bindsym $mod+Shift+g exec gnome-terminal
bindsym $mod+a exec alacritty
bindsym $mod+f exec foot
# DE[B]UGGER
bindsym $mod+b [con_mark=_prev_debugger] focus
# BROWSERS
bindsym $mod+w [con_mark=_prev_web_browser] focus
bindsym $mod+z exec zen-browser
bindsym $mod+Shift+f exec firefox
bindsym $mod+q exec qutebrowser
bindsym $mod+c exec chromium-browser
# Fixes dark mode (See: https://github.com/NixOS/nixpkgs/issues/274554#issuecomment-2637079431)
bindsym $mod+e exec ADW_DISABLE_PORTAL=1 epiphany
# FILE MANAGERS
bindsym $mod+n exec ADW_DISABLE_PORTAL=1 nautilus
# OTHER
bindsym $mod+o [con_mark=_prev_other] focus
# === KILL FOCUSED ===
bindsym $mod+d kill # d stands for delete
# === CHANGE FOCUSED ===
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# === MOVE FOCUSED ===
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# === RESIZE FOCUSED ===
bindsym $mod+Ctrl+h resize shrink width 20 px
bindsym $mod+Ctrl+k resize shrink height 20 px
bindsym $mod+Ctrl+l resize grow width 20 px
bindsym $mod+Ctrl+j resize grow height 20 px
# === MAXIMIZE FOCUSED ===
bindsym $mod+m fullscreen
# === FLOAT FOCUSED ===
bindsym $mod+space floating toggle
# === CHANGE CONTAINER LAYOUT ===
bindsym $mod+Shift+t layout tabbed
bindsym $mod+s layout toggle split
# === SWITCH WORKSPACE ===
bindsym $mod+y workspace number $ws1
bindsym $mod+u workspace number $ws2
bindsym $mod+i workspace number $ws3
# === MOVE FOCUSED CONTAINER TO WORKSPACE ===
bindsym $mod+Shift+y move container to workspace number $ws1
bindsym $mod+Shift+u move container to workspace number $ws2
bindsym $mod+Shift+i move container to workspace number $ws3
# === RELOAD SWAY ===
bindsym $mod+r reload
# === EXIT SWAY ===
bindsym $mod+Tab exit