set $mod Mod1
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l

# Запуск программ
bindsym $mod+Return exec alacritty
bindsym $mod+p exec ~/bin/screen.sh
bindsym $mod+space exec ~/bin/change_layout.sh
# bindsym Control+space exec sh /home/fs/bin/change_layout.sh
set $menu ~/bin/rofi
input type:keyboard {
    xkb_layout us,ru
    xkb_options grp:ctrl_alt_toggle,caps:ctrl_modifier,grp:alt_space_toggle,grp:ctrl_space_toggle
}

# close
bindsym $mod+q kill

# Регулировка яркости
bindsym XF86MonBrightnessUp exec brightnessctl set +5%
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-

# Громкость
bindsym XF86AudioRaiseVolume exec "pactl set-sink-volume 0 +5%"
bindsym XF86AudioLowerVolume exec "pactl set-sink-volume 0 -5%"
bindsym XF86AudioMute exec "pactl set-sink-mute 0 toggle"

# Mocp
bindsym Mod4+u exec "mocp --seek -5"
bindsym Mod4+i exec "mocp --seek +5"
bindsym Mod4+j exec "mocp --previous"
bindsym Mod4+k exec "mocp --next"
bindsym Mod4+space exec "mocp --toggle-pause"
bindsym Mod4+r exec "swaymsg reload"


# Emacs
bindsym $mod+e mode $emacs_map
    mode "$emacs_map" {
        bindsym e exec "emacsclient -n -q -c --socket-name=main"                                 ; mode "default"
        bindsym o exec "emacsclient -n -q -c --socket-name=other"                                ; mode "default"
        bindsym h exec "emacsclient -n -q -c --socket-name=http      /home/fs/Desktop/work/http/"; mode "default"
        bindsym d exec "emacsclient -n -q -c --socket-name=documents /home/fs/Documents/"        ; mode "default"
        bindsym f exec "emacsclient -n -q -c --socket-name=fm        /home/fs/"                  ; mode "default"
        bindsym p exec "emacsclient -n -q -c --socket-name=fm        /home/fs/Pictures/"         ; mode "default"
        bindsym v exec "emacsclient -n -q -c --socket-name=fm        /home/fs/Videos/"           ; mode "default"
        bindsym m exec "emacsclient -n -q -c --socket-name=music     /home/fs/Music/8/"          ; mode "default"
        bindsym t exec "emacsclient -n -q -c --socket-name=terminal"                             ; mode "default"
}


# Программы
bindsym $mod+r mode $wofi_map
    mode "$wofi_map" {
        bindsym i exec $menu; mode "default"
        bindsym u exec ~/bin/firefox_profiles.sh; mode "default"
    }



    # Exit sway (logs you out of your Wayland session)
    bindsym $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'


# Переключение окон
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+$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+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

# modes
bindsym $mod+b splith
bindsym $mod+v splitv

# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+t layout toggle split
bindsym $mod+f fullscreen
bindsym $mod+Shift+f floating toggle
# bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent

#
# Resizing containers:
#
floating_modifier $mod normal

include /etc/sway/config.d/*
}

bar {
    swaybar_command waybar
}

input "type:touchpad" {
    dwt enabled
    dwtp enabled
    tap enabled
    tap_button_map lrm
}

# --- theme ---
default_border pixel 2
default_floating_border none
titlebar_padding 1
titlebar_border_thickness 0
gaps inner 10

set {
  $accent #ebdbb2
  $red #cc241d
  $darkgray #3c3836
}

client.focused          $accent $accent $darkgray $accent $accent
client.focused_inactive $darkgray $darkgray $accent $darkgray $darkgray
client.unfocused        $darkgray $darkgray $accent $darkgray $darkgray
client.urgent           $red $red $accent $red $red
