### Variables
# Logo key
set $mod Mod4
# Direction keys
set $left h
set $down j
set $up k
set $right l
# Alacritty
set $term alacritty

# Menu (rofi)
set $rofi_cmd rofi -terminal '$term'
set $menu $rofi_cmd -show combi -combi-modes drun#run -modes combi

### Output configuration
output DP-3 pos 3840 0 res 1920x1080@59Hz
output HDMI-A-1 pos 0 0 res 1920x1080@59Hz
output DP-2 pos 1920 0 res 1920x1080@60Hz

### Wallpaper
output HDMI-A-1 bg ~/.wallpaper/.wallpaper.png fill
output DP-2  bg ~/.wallpaper/.wallpaper.png fill
output DP-3 bg ~/.wallpaper/.wallpaper.png fill

### Workspace binding

## DP-3 bindings
workspace 1 output DP-2
workspace 2 output DP-2

## HDMI-A-1 bindings
workspace 3 output HDMI-A-1 

## DP-2 bindings
workspace 6 output DP-3
workspace 7 output DP-3

### Colour options
set $bg 	#24283b
set $bg-inactive   #323232
set $bg-urgent     #000000
set $text          #eeeeec
set $text-inactive #babdb6
set $bar           #323232
set $statusline    #e0e0e0

client.focused          $bg           $bg          $text          $bg $bg
client.unfocused        $bg-inactive  $bg-inactive $text-inactive $bar $bar
client.focused_inactive $bg-inactive  $bg-inactive $text-inactive $bar $bar
client.urgent           $bg-urgent    $bg-urgent   $text          $bar $bar


### Idle configuration
# exec swayidle -w \
#           timeout 600 'swaylock -f -i /home/wyatt/.wallpaper_lock.jpeg' \
#           timeout 1200 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
#           before-sleep 'swaylock -f -c 000000'

# Workspaces
set $workspace_www 1
set $workspace_editor 2
set $workspace_terminals 3
set $workspace_documents 4
set $workspace_multimedia 5

# Gaps
floating_modifier $mod normal

### Key bindings
    # Start a terminal
    bindsym $mod+Return exec $term

    # Kill focused window
    bindsym $mod+Shift+q kill

    # Start your launcher
    bindsym $mod+d exec $menu

    # Drag floating windows by holding down $mod and left mouse button.
    # Resize them with right mouse button + $mod.
    # Despite the name, also works for non-floating windows.
    # Change normal to inverse to use left mouse button for resizing and right
    # mouse button for dragging.
    floating_modifier $mod normal

    # Reload the configuration file
    bindsym $mod+Shift+c reload

    # 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'

### Navigation
    # Move your focus around
    bindsym $mod+$left focus left
    bindsym $mod+$down focus down
    bindsym $mod+$up focus up
    bindsym $mod+$right focus right
    # Or use $mod+[up|down|left|right]
    bindsym $mod+Left focus left
    bindsym $mod+Down focus down
    bindsym $mod+Up focus up
    bindsym $mod+Right focus right

    # Move the focused window with the same, but add Shift
    bindsym $mod+Shift+$left move left
    bindsym $mod+Shift+$down move down
    bindsym $mod+Shift+$up move up
    bindsym $mod+Shift+$right move right
    # Ditto, with arrow keys
    bindsym $mod+Shift+Left move left
    bindsym $mod+Shift+Down move down
    bindsym $mod+Shift+Up move up
    bindsym $mod+Shift+Right move right

### Workspaces
    # Switch to workspace
    bindsym $mod+1 workspace $workspace_www
    bindsym $mod+2 workspace $workspace_editor
    bindsym $mod+3 workspace $workspace_terminals
    bindsym $mod+4 workspace $workspace_documents
    bindsym $mod+5 workspace $workspace_multimedia
    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
    # Move focused container to workspace
    bindsym $mod+Shift+1 move container to workspace $workspace_www
    bindsym $mod+Shift+2 move container to workspace $workspace_editor
    bindsym $mod+Shift+3 move container to workspace $workspace_terminals
    bindsym $mod+Shift+4 move container to workspace $workspace_documents
    bindsym $mod+Shift+5 move container to workspace $workspace_multimedia
    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
    # Note: workspaces can have any name you want, not just numbers.
    # We just use 1-10 as the default.

### Layout
    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+e layout toggle split

    # Make the current focus fullscreen
    bindsym $mod+f fullscreen

    # 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

    # Move focus to the parent container
    bindsym $mod+a focus parent

### Taking screenshots
    # Take a screenshot of all monitors
    bindsym Print exec grim -t jpeg ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg

    # Take a screenshot of a given selection
    bindsym $mod+Print exec grim -t jpeg -g "$(slurp)" ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpeg

### Resizing containers
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 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 $mod+r mode "resize"


### Audio and brightness keybinds
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 XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86MonBrightnessUp exec light -A 5
bindsym XF86MonBrightnessDown exec light -U 5

### Lock the screen so my brother 
### won't dick with my computer
bindsym $mod+Ctrl+l 'swaylock -f -i /home/wyatt/.wallpaper_lock.jpeg'

### Status Bar:
bar {
    swaybar_command waybar
}


### Font settings:
font pango:FiraCode: 14px

### Window formatting
default_border none
default_border pixel 2
gaps inner 10px

# Applications
exec_always /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec mako
#exec swww init
#exec bash /home/wyatt/.wallpaper/wallpaper.sh /home/wyatt/.wallpaper

set $opacity 1.00
for_window [class=".*"] opacity $opacity
for_window [app_id=".*"] opacity $opacity

# Disable locking when conditions are met
for_window [class="streaming_client"] inhibit_idle fullscreen
for_window [app_id="firefox"] inhibit_idle fullscreen
for_window [app_id="neovide"] inhibit_idle fullscreen

for_window [title="Beyond All Reason"] inhibit_idle fullscreen
include /etc/sway/config.d/*