# Sway config for hunterstasonis

set $mod Mod4

set $left h
set $down j
set $up k
set $right l

set $term kitty
set $menu rofi

# Startup commands
exec dunst

# Looks, super small gap/pixel border
default_border pixel 5
gaps inner 5

client.focused #0d0e1c #0d0e1c #ffffff #0d0e1c
client.focused_inactive #2b3045 #2b3045 #ffffff #2b3045
client.unfocused #2b3045 #2b3045 #ffffff #2b3045

# Wallpaper & Display/DPI
output * bg /home/hunterstasonis/.config/sway/bg1.jpg fill
output DP-3 scale 1.75


input * repeat_delay 200
input * repeat_rate 50
input * xkb_options caps:escape

# Start a terminal
bindsym $mod+Return exec $term
bindsym $mod+Shift+s exec sway-screenshot -m region

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

# Application launcher
bindsym $mod+d exec $menu -show drun

# Executable launcher
bindsym $mod+Shift+r exec $menu -show run

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'
bindsym $mod+Shift+grave exec bash ~/git/config/scripts/lock.sh

# Move your focus around
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

# Switch to workspace
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

# Move focused container to workspace
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

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

bindsym $mod+w layout tabbed

# 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 the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show


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

    # Return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

# Adjust volume
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle

bar {
    position bottom
    font JetBrains Mono 12

    colors {
        background #0d0e1c 
        statusline #ffffff

        focused_workspace #4a4f69 #4a4f69 #f4f4f4
        inactive_workspace #2b3045 #2b3045 #bfc0c4
    }

    status_command while ~/.config/sway/bar.sh; do sleep 1; done
}

include /etc/sway/config.d/*
