Sway
Установка
pikaur -S sway swaylock swayidle swaybg wmenu dmenu foot waybar xdg-desktop-portal-wlr mako
Настройка
Общая настройка sway
Рекомендуется предварительно выполнить настройку шрифтов.
Создать каталоги для конфигурационных файлов и скопировать системный конфигурационный файл:
mkdir -p ~/.config/sway/config.d && cp /etc/sway/config ~/.config/sway
Закомментировать запуск swaybar и подключить каталог с пользовательскими конфигурационными файлами в скопированном конфигурационном файле (в конце файла):
nano ~/.config/sway/config
Пример:
#
# Read `man 5 sway-bar` for more information about this section.
#bar {
# position top
#
# # When the status_command prints a new line to stdout, swaybar updates.
# # The default just shows the current date and time.
# status_command while date +'%Y-%m-%d %X'; do sleep 1; done
#
# colors {
# statusline #ffffff
# background #323232
# inactive_workspace #32323200 #32323200 #5c5c5c
# }
#}
include /etc/sway/config.d/*
include ~/.config/sway/config.d/*
Настроить работу горячих клавиш в русской раскладке (добавить параметр --to-code к опции bindsym):
sed -i -e 's/\(bindsym\)/\1 --to-code/' ~/.config/sway/config
Клавиатура
Создать файл ~/.config/sway/config.d/10-keyboard:
# Apple alluminium keyboard
input "1452:592:Apple_Inc._Apple_Keyboard" {
xkb_layout "us,ru(mac)"
xkb_options "grp:win_space_toggle,lv3:ralt_switch"
xkb_model "apple_iso"
}
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 XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym XF86MonBrightnessUp exec brightnessctl set 5%+
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86Search exec bemenu-run
Закомментировать в конфигурационном файле ~/.config/sway/config комбинации с $mod+space:
# # Toggle the current focus between tiling and floating mode
# bindsym $mod+Shift+space floating toggle
# # Swap focus between the tiling area and the floating area
# bindsym $mod+space focus mode_toggle
Экран
Создать файл ~/.config/sway/config.d/05-output для изменения разрешения и частоты обновления кадров:
output DP-1 mode 1920x1080@75Hz
Доступные экраны и их параметры можно посмотреть при помощи команды:
swaymsg -t get_outputs
Статусбар waybar
Создать файл ~/.config/sway/config.d/20-waybar:
bar {
swaybar_command waybar
}
Создать каталог для конфигурации waybar:
mkdir -p ~/.config/waybar
Создать пользовательский конфигурационный файл ~/.config/waybar/config.jsonc, (опционально запретить вывод на встроенный экран и) подключить системный конфигурационный файл:
{
//"output" : "!eDP-1",
"include" : "/etc/xdg/waybar/config.jsonc"
}
Уведомления mako
Создать каталог конфигурации make:
mkdir -p ~/.config/mako
Создать файл ~/.config/mako/config следующего содержания:
ignore-timeout=1
default-timeout=5000
Завершение работы
Подсмотрено на Reddit.
Закомментировать в конфигурационном файле ~/.config/sway/config комбинацию с $mod+e:
# # Exit sway (logs you out of your Wayland session)
# bindsym --to-code $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
Создать файл ~/.config/sway/config.d/60-shutdown:
set $wmexit swaymsg exit
set $lock swaylock -e -f -c 000000 -i /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png -t
set $Shutdown System (l)lock, (e) exit, (r) reboot, (h) halt
mode "$Shutdown" {
bindsym --to-code e exec --no-startup-id $wmexit, mode "default"
bindsym --to-code r exec --no-startup-id systemctl reboot, mode "default"
bindsym --to-code h exec --no-startup-id systemctl poweroff -i, mode "default"
bindsym --to-code l exec --no-startup-id $lock, mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym --to-code $mod+Shift+e mode "$Shutdown"
Терминал foot
Создать каталог с конфигурационным файлом:
mkdir -p ~/.config/foot && cp /etc/xdg/foot/foot.ini ~/.config/foot/
Добавить в ~/.config/foot/foot.ini следующие настройки (можно в соответствующих местах):
term=xterm-256color
font=MesloLGS NF:size=9
Создать файл ~/.config/foot/gogh-colors.ini с цветовой схемой (чтобы не выжигало глаза):
# -*- conf -*-
# Some color palette from gogh.
[colors]
foreground=A4A4A4
background=1E2127
regular0=000000 # black # HOST
regular1=E06C75 # red # SYNTAX_STRING
regular2=98C379 # green # COMMAND
regular3=117A65 # yellow # (MC: txt, css, html, pdf, xlsx, doc, docx, rtf files) COMMAND_COLOR2
regular4=0F0F18 # blue # (MC: background)
regular5=C678DD # magenta # SYNTAX_VAR
regular6=5C6370 # cyan # (MC: menu beckground) PROMP
regular7=848484 # white # (MC: panel lines)
bright0=5C6370 # bright black #
bright1=ff5555 # bright red # COMMAND_ERROR
bright2=98C379 # bright green # (MC: exec files) EXEC FILES #55FF55
bright3=008080 # bright yellow # (MC: panel headers)
bright4=61AFEF # bright blue # FOLDERS
bright5=F4A460 # bright magenta # (MC: zip, rar, tar.xz, tar.gz files)
bright6=87CEEB # bright cyan # (MC: png, jpg files)
bright7=A4A4A4 # bright white #
Добавить в ~/.config/foot/foot.ini подключение цветовой схемы (можно в конец):
[main]
include=~/.config/foot/gogh-colors.ini
Запуск приложений
Создать файл ~/.config/sway/config.d/50-apps:
# Shortcut to launch Brave browser
for_window [class="Brave"] {
move scratchpad
resize set 1920 1056
move position 0 0
scratchpad show
}
bindsym --to-code $mod+i exec swaymsg [class="Brave"] scratchpad show || exec brave
# Shortcut to launch Telegram app
for_window [app_id="org.telegram.desktop"] {
move scratchpad
resize set 800 1056
move position 0 0
scratchpad show
}
bindsym --to-code $mod+t exec swaymsg [app_id="org.telegram.desktop"] scratchpad show || exec telegram-desktop