# Generic Sway stuff

# Logo key. Use Mod1 for Alt.
set $mod Mod4

# Your preferred terminal emulator
set $term foot

# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu dmenu_path | dmenu | xargs swaymsg exec --

### Key bindings
#
# Basics:
#
    # 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'
#
# Moving around:
#
    # 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

    # 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 number 1
    bindsym $mod+2 workspace number 2
    bindsym $mod+3 workspace number 3
    bindsym $mod+4 workspace number 4
    # 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
    # Note: workspaces can have any name you want, not just numbers.
#
# Layout stuff:
#
    # You can "split" the current object of your focus with
    # $mod+b or $mod+v, for horizontal and vertical splits
    # respectively.
    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

#
# Resizing containers:
#
mode "resize" {
    # left will shrink the containers width
    # right will grow the containers width
    # up will shrink the containers height
    # down will grow the containers height
    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"

# openSUSE theme
default_border pixel 4
gaps inner 0
workspace 2 gaps inner 50
client.focused #6da741 #173f4f #73ba25 #6da741 #00a489
client.unfocused #00a489 #173f4f #35b9ab
client.focused_inactive #6da741 #00a489 #173f4f
#set $wob wob --config /etc/sway/wob/wob.ini

 # Uniguest stuff
for_window [instance="ffplay"] floating enable
for_window [app_id="ffplay"] floating enable
for_window [app_id="thecloudportal-signage-client"] move to workspace 1, border none, focus
for_window [title="Signage Display"] move to workspace 1, border none, focus

# Change background image
output * bg /opt/ds/bg-sway-uniguest.png fill #555555
# Set display settings
output * pos 0 0 res 1024x768
include /home/ds/resolution.conf
output * scale 1
# Export supported resolutions to file
exec swaymsg -t get_outputs > /home/ds/supported_resolutions.txt
# Hide mouse cursor
seat seat0 hide_cursor 250

# Bar
bar {
    position top
    height 30
    mode hide
    #status_command /home/ds/.config/sway/swaybar.sh
    status_command while date +' Uniguest Signage Player - %Y-%m-%d %H:%M:%S %p'; do sleep 1; done
    colors {
        background #323232
        statusline #ffffff
        inactive_workspace #32323200 #32323200 #5c5c5c
    }
}