# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod1
set $terminal alacritty

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Hack 13

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font abr
# ove is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec $terminal

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

# start dmenu (a program launcher)
#bindsym $mod+d exec --no-startup-id sleep 0.2 && rofi -show run

# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
bindsym $mod+d exec --no-startup-id rofi -rnow -run-command "fish -i -c '{cmd}'" -show drun -icon-theme "Papirus" -show-icons

# screen orientation
bindsym $mod+Control+Right output HDMI-A-2 transform 270
bindsym $mod+Control+Left output HDMI-A-2 transform 0

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+odiaeresis move right

# alternatively, you can use the cursor 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

# focus
#bindsym 66+q exec i3-easyfocus

# split in horizontal orientation
bindsym $mod+g split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+Shift+s layout stacking
bindsym $mod+Shift+w layout tabbed
bindsym $mod+y layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
#bindsym $mod+space focus mode_toggle

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

# focus the child container
#bindsym $mod+d focus child

set $workspace1 "1"
set $workspace2 "2"
set $workspace3 "3"
set $workspace4 "4"
set $workspace5 "5"
set $workspace6 "6"
set $workspace7 "7"
set $workspace8 "8"
set $workspace9 "9"
set $workspace10 "10"
set $workspace11 "11"
set $workspace12 "12"
set $workspaceE "13"
set $workspaceVM "14"
set $workspaceP "i"

# switch to workspace
bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+q workspace $workspace6
bindsym $mod+w workspace $workspace7
bindsym $mod+e workspace $workspace8
bindsym $mod+r workspace $workspace9
bindsym $mod+t workspace $workspace10
bindsym $mod+0x2b   workspace $workspace11
bindsym $mod+0xfe51 workspace $workspace12
#bindsym $mod+0x1000304 workspace $workspaceP
#bindsym 0xffec      workspace $workspaceVM

# move focused container to workspace
bindsym $mod+Ctrl+1 move container to workspace $workspace1
bindsym $mod+Ctrl+2 move container to workspace $workspace2
bindsym $mod+Ctrl+3 move container to workspace $workspace3
bindsym $mod+Ctrl+4 move container to workspace $workspace4
bindsym $mod+Ctrl+5 move container to workspace $workspace5
bindsym $mod+Ctrl+q move container to workspace $workspace6
bindsym $mod+Ctrl+w move container to workspace $workspace7
bindsym $mod+Ctrl+e move container to workspace $workspace8
bindsym $mod+Ctrl+r move container to workspace $workspace9
bindsym $mod+Ctrl+t move container to workspace $workspace10
bindsym $mod+Ctrl+0x2b   move container to workspace $workspace11
bindsym $mod+Ctrl+0xfe51 move container to workspace $workspace12
bindsym $mod+Ctrl+0xff14 move container to workspace $workspaceE
bindsym $mod+Ctrl+0x1000304 move container to workspace $workspaceP
#bindsym $mod+Ctrl+0xffec move container to workspace $workspaceVM

bindsym $mod+Shift+g gaps outer current plus 5
bindsym $mod+Shift+h gaps outer current minus 5

bindsym $mod+Shift+x move workspace to output right
bindsym $mod+Shift+z move workspace to output left

bindsym 0xff14 exec i3lock -c 000000
bindsym Shift+0xff14 exec rofi -show power-menu -modi power-menu:rofi-power-menu

set $leftMonitor DP-4
set $rightMonitor DVI-D-0
workspace $workspace1 output $leftMonitor
workspace $workspace2 output $leftMonitor
workspace $workspace3 output $leftMonitor
workspace $workspace4 output $rightMonitor
workspace $workspace5 output $leftMonitor
workspace $workspace6 output $leftMonitor
workspace $workspace7 output $leftMonitor
workspace $workspace8 output $leftMonitor
workspace $workspace9 output $leftMonitor
workspace $workspace10 output $leftMonitor
workspace $workspace11 output $leftMonitor
workspace $workspace12 output $leftMonitor
workspace $workspaceP output $leftMonitor

#focus output DP-4

#for_window [class="discord"] move to workspace $workspace4
assign [class="Nemo"] $workspace7
assign [class="Spotify"] $workspace6
assign [class="qemu"] $workspaceVM

# virtkvm
bindsym $mod+s exec curl -X POST -H 'Content-Type: application/json' -d '{"to": "guest"}' http://192.168.1.224:5051/switch

# toggle bar
bindsym $mod+Tab bar mode toggle

# reload the configuration file
bindsym $mod+Shift+r reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+c reload
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"

# resize window (you can also use the mouse for that)
bindsym $mod+Ctrl+a mode "resize"
mode "resize" {
        bindsym h resize shrink width 10 px or 10 ppt
        bindsym j resize grow height 10 px or 10 ppt
        bindsym k resize shrink height 10 px or 10 ppt
        bindsym l resize grow width 10 px or 10 ppt

        bindsym Return mode "default"
        bindsym Escape mode "default"
}

#bindsym $mod+Shift+r mode "resize"

set $bg-color 	         #2f343f
set $inactive-bg-color   #2f343f
set $text-color          #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color     #2f343f

# window colors
#                       border              background         text                 indicator
#client.focused          $bg-color           $bg-color          $text-color           00ff00
#client.unfocused        $inactive-bg-color  $inactive-bg-color $inactive-text-color  00ff00
#client.focused_inactive $inactive-bg-color  $inactive-bg-color $inactive-text-color  00ff00
#client.urgent		$urgent-bg-color    $urgent-bg-color   $text-color 	     00ff00

# Polybar
#exec_always --no-startup-id ~/.config/polybar/launch.sh

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
#    position top
#	mode hide
#    modifier Mod4
#	strip_workspace_numbers yes
#	#status_command i3status-rs ~/.config/i3/config.toml
#	height 35
#	colors {
#		background $bg-color
#	    	separator #757575
#		
#		#                  border             background         text
#		focused_workspace  $bg-color          $bg-color          $text-color
#        inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
#    	urgent_workspace   $urgent-bg-color   $urgent-bg-color   $text-color
#	}
#}

focus_follows_mouse no

#shortcuts
bindsym $mod+Shift+a exec nemo
bindsym $mod+Shift+f exec firefox
bindsym $mod+z exec /home/paddi/.scripts/skrenshot.sh
bindsym $mod+Ctrl+z exec swappy -g "$(slurp)"

# keypad 6; remove discord message
bindcode --release 85 exec xdotool key 111 && sleep 0.05 && xdotool keydown 37 key a keyup 37 key 22 key 36 key 36 && sleep 0.275 && xdotool key 23

bindcode --release 80 exec ~/deletery.sh

# volume knob
bindcode --release 123 exec ~/.scripts/knob-up.sh
bindcode --release 122 exec ~/.scripts/knob-down.sh

# toggle scroll mode with caps lock
#exec setxkbmap -option ctrl:nocaps
bindsym Pause exec ~/.scripts/toggle-scroll.sh

# media controls
bindcode --release 173 exec playerctl previous
bindcode --release 172 exec playerctl play-pause
bindcode --release 171 exec playerctl next

# keboard layouts
bindsym $mod+F1 exec setxkbmap se -option esperanto:qwerty && setxkbmap se -option ctrl:nocaps
bindsym $mod+F2 exec setxkbmap epo -option ctrl:nocaps

# screenshot
bindsym Ctrl+Shift+F12 exec ~/.scripts/mekgif.sh
bindsym 0xff61 exec scrot /home/paddi/Pictures/skrenshots/full.png

# win10 VM
#bindsym 0xffec exec workspace $workspaceVM #gksudo /home/paddi/VM-tings/attach.sh

# yakuake
bindsym $mod+c exec yakuake
for_window [class="yakuake"] floating enable

# scratchpad
bindsym $mod+Shift+plus move scratchpad
bindsym 0x10004304 scratchpad show

# change wallpaper
bindsym $mod+Shift+b exec ~/.scripts/WallpaperRandomiserX11.sh

# mute audio
bindcode --release 121 exec amixer sset Master toggle

#gaps
for_window [class="^.*"] border pixel 0
default_border none
gaps inner 5
gaps outer 15

#auto start
exec_always picom --experimental-backends --config .config/picom/picom.conf --backend xrender
exec syncthing
exec dunst
exec --no-startup-id /usr/lib/geoclue-2.0/demos/agent
exec udiskie
exec_always gsettings set org.gnome.desktop.interface font-name 'Hack 10'
exec ~/.config/screenlayout/layout.sh
exec redshift -b 1:0.5
exec_always setxkbmap se_bakk
exec $terminal
exec i3-msg move scratchpad

#exec --no-startup-id i3-msg "workspace 1; exec alacritty; exec alacritty"
#exec --no-startup-id i3-msg "workspace 2; exec firefox"
#exec --no-startup-id i3-msg "workspace 8; exec VBoxManage startvm Windows10 --type gui"
#exec --no-startup-id i3-msg "workspace 4; append_layout ~/.config/i3/workspace_4.json; exec firefox; exec discord"

exec ~/.scripts/startup.sh

#output "*" background /home/paddi/Pictures/Wallpapers/f2.jpg fill
exec_always ~/.scripts/WallpaperRandomiser.sh
exec keynav
exec nextcloud --background
