# 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 Mod4
set $Locker ~/.config/i3/i3lock-multimonitor/lock -i ~/.config/i3/lockscreen.png

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Iosevka,Font Awesome 7 Free,Font Awesome 7 Brands 9

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

# prevent blank screen & auto lock
exec --no-startup-id xset s off -dpms

# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3

# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.

# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- $Locker

# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
# exec --no-startup-id nm-applet

# Use pactl to adjust volume in PulseAudio.
bindsym XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK\@ toggle
bindsym XF86AudioMute --release exec pkill -RTMIN+1 i3blocks
bindsym XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK\@ -1%
bindsym XF86AudioLowerVolume --release exec pkill -RTMIN+1 i3blocks
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0\@DEFAULT_SINK\@ +1%
bindsym XF86AudioRaiseVolume --release exec pkill -RTMIN+1 i3blocks
bindsym XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
bindsym XF86AudioMicMute --release exec pkill -RTMIN+1 i3blocks

# Media player controls
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioPause exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous

# don't follow focus with mouse
focus_follows_mouse no

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

# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar

# start a terminal
bindsym $mod+Return exec alacritty

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

# start dmenu (a program launcher)
#bindsym $mod+d exec --no-startup-id dmenu_run
# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop

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

# alternatively, you can use the cursor keys:
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+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l 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

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

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

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e 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

# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1: "
set $ws2 "2: "
set $ws3 "3: "
set $ws4 "4: Torrenty"
set $ws5 "5: Soulseek"
set $ws6 "6: Libreoffice"
set $ws7 "7: Wirtualki"
set $ws8 "8: "
set $ws9 "9: "
set $ws10 "10"
set $wsF1 "11"
set $wsF2 "12"
set $wsF3 "13"
set $wsF4 "14"
set $wsF5 "15"
set $wsF6 "16"
set $wsF7 "17"
set $wsF8 "18"
set $wsF9 "19: Tor Browser"
set $wsF10 "20: "
set $wsF11 "21: KeePass"
set $wsF12 "22: Inne"

# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
bindsym $mod+F1 workspace number $wsF1
bindsym $mod+F2 workspace number $wsF2
bindsym $mod+F3 workspace number $wsF3
bindsym $mod+F4 workspace number $wsF4
bindsym $mod+F5 workspace number $wsF5
bindsym $mod+F6 workspace number $wsF6
bindsym $mod+F7 workspace number $wsF7
bindsym $mod+F8 workspace number $wsF8
bindsym $mod+F9 workspace number $wsF9
bindsym $mod+F10 workspace number $wsF10
bindsym $mod+F11 workspace number $wsF11
bindsym $mod+F12 workspace number $wsF12

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
bindsym $mod+Shift+F1 move container to workspace number $wsF1
bindsym $mod+Shift+F2 move container to workspace number $wsF2
bindsym $mod+Shift+F3 move container to workspace number $wsF3
bindsym $mod+Shift+F4 move container to workspace number $wsF4
bindsym $mod+Shift+F5 move container to workspace number $wsF5
bindsym $mod+Shift+F6 move container to workspace number $wsF6
bindsym $mod+Shift+F7 move container to workspace number $wsF7
bindsym $mod+Shift+F8 move container to workspace number $wsF8
bindsym $mod+Shift+F9 move container to workspace number $wsF9
bindsym $mod+Shift+F10 move container to workspace number $wsF10
bindsym $mod+Shift+F11 move container to workspace number $wsF11
bindsym $mod+Shift+F12 move container to workspace number $wsF12

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# 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'"
set $mode_system (l)ock, l(o)gout, (s)uspend, (h)ibernate, (r)eboot, shu(t)down
mode "$mode_system" {
    bindsym l exec --no-startup-id $Locker, mode "default"
    bindsym o exec --no-startup-id i3-msg exit, mode "default"
    bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
    bindsym r exec --no-startup-id systemctl reboot, mode "default"
    bindsym h exec --no-startup-id systemctl hibernate, mode "default"
    bindsym t exec --no-startup-id systemctl poweroff -i, mode "default"

    # back to normal: Enter or Escape
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

bindsym $mod+Shift+e mode "$mode_system"

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        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

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}

bindsym $mod+r mode "resize"

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf
        position top	
	i3bar_command i3bar --transparency
	tray_output none
	colors {
		background #00000099
        	statusline #ffffff
        	separator #000000

        	focused_workspace  #34003f #6e0284 #ffffff
        	inactive_workspace #220028 #35013f #888888
        	urgent_workspace   #470801 #630000 #ffffff
	}
}

# gnome-keyring 
exec --no-startup-id dbus-update-activation-environment --systemd --all
exec --no-startup-id gnome-keyring-daemon --start --components=secrets

# picom
exec --no-startup-id picom

# dunst
exec --no-startup-id dunst

# display wallpaper
exec --no-startup-id feh --bg-fill ~/.config/i3/wallpaper.png

# shortcut for lockscreen
bindsym $mod+x exec $Locker

# set default workspace layout
workspace_layout tabbed

# window assignments
assign [class="[Cc]hromium"] $ws2
assign [class="[Tt]hunderbird"] $ws3
assign [class="q[Bb]ittorrent"] $ws4
assign [class="[Nn]icotine"] $ws5
assign [class="[Ll]ibreoffice.*"] $ws6
assign [class="[Vv]irt.*[Mm]anager"] $ws7
assign [class="[Vv]irt.*[Vv]iewer"] $ws7
assign [class="[Qq]emu"] $ws7
assign [class="[Ff]irefox"] $ws8
assign [class="[Ii]ce[Ww]easel"] $ws8
assign [class="[Aa]browser"] $ws8
assign [class="[Ll]ibre[Ww]olf"] $ws8
assign [class="[Ee]macs"] $ws9
assign [class="[Tt]or.*[Bb]rowser"] $wsF9
assign [class="[Kk]iwix"] $wsF10
assign [class="[Kk]ee[Pp]ass"] $wsF11
assign [class="[Mm]ullvad.*"] $wsF12
assign [class="[Gg]alaxy.*[Bb]uds.*[Cc]lient"] $wsF12
assign [class="qutebrowser"] $wsF12
assign [class="[Tt]hunar"] $wsF12
assign [class="[Ll]uakit"] $wsF12
assign [class="[Ss]ea[Mm]onkey"] $wsF12
for_window [class="[Tt]or\s*[Bb]rowser"] floating enable, border normal
for_window [class="[Ff]lame[Ss]hot"] floating enable, border normal
for_window [class="[Pp]inentry"] floating enable, border normal

# color scheme for windows
#                       border          background      text            indicator (a line which shows where the next window will be placed)     
client.focused          #0b4701         #044f00         #ffffff         #0b4701
client.unfocused        #072d00         #023000         #969696         #072d00
client.focused_inactive #072d00         #023000         #969696         #072d00
client.urgent           #630000         #630000         #ffffff         #630000

# hide title bar
default_border pixel 1
default_floating_border pixel 1

# start rofi
bindsym $mod+d exec --no-startup-id rofi -show combi
bindsym $mod+p exec --no-startup-id ~/.local/bin/rofi-pass

# i3-quickterm
bindsym $mod+b exec i3-quickterm shell

# flameshot (for screenshots)
bindsym $mod+Print exec flameshot full -u -p ~/Pictures/Screenshots
bindsym $mod+Shift+Print exec flameshot gui -u -p ~/Pictures/Screenshots
bindsym Print exec flameshot full -p ~/Pictures/Screenshots
bindsym Shift+Print exec flameshot gui -p ~/Pictures/Screenshots

# autostart
exec --no-startup-id chromium
exec --no-startup-id thunderbird
workspace $ws1 output primary
exec --no-startup-id alacritty
