# set modifier
set $super Mod4
set $alt Mod1

# set font
font pango: Noto Sans 8

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

# autostart
exec --no-startup-id fcitx5
exec --no-startup-id hsetroot -center ~/.local/share/wallpapers/89596288_p0.png
exec --no-startup-id xsettingsd &
#exec --no-startup-id compton -b -i 1 --shadow-red 1.0 --shadow-blue 1.0 --inactive-dim 0.5 --shadow-offset-x 1 --shadow-offset-y 1
exec --no-startup-id picom -b -i 1 --inactive-dim 0.5

# screenlock
exec --no-startup-id xset s off
exec --no-startup-id xset -dpms
exec --no-startup-id xset s noblank

# start a terminal
bindsym $super+Return exec alacritty

# start dmenu (a program launcher)
bindsym $super+Shift+d exec i3-dmenu-desktop --dmenu="dmenu -i -fn 'Noto Sans:size=8'"
bindsym $super+d exec rofi -lines 12 -padding 18 -width 60 -location 0 -show drun -sidebar-mode -columns 3 -font 'Noto Sans 8'

# common apps keybinds
bindsym Print exec scrot 'Cheese_%a-%d%b%y_%H.%M.png' -e 'sxiv ~/$f'
bindsym $super+l exec i3lock -i ~/.local/share/wallpapers/d-abstract-k--wallpaper-1920x1080-wallpaper.jpg
bindsym $super+Shift+w exec firefox
bindsym $super+Shift+f exec thunar;workspace 3;focus
bindsym $super+Shift+g exec geany

#change volume
bindsym XF86AudioRaiseVolume exec amixer -q set Master 5%+
bindsym XF86AudioLowerVolume exec amixer -q set Master 5%-
bindsym XF86AudioMute exec amixer set Master toggle

# music control
bindsym XF86AudioNext exec mpc next
bindsym XF86AudioPrev exec mpc prev
bindsym XF86AudioPlay exec mpc toggle
bindsym XF86AudioStop exec mpc stop

# kill focused window
bindsym $super+c kill
bindsym $alt+F4 kill

# change focus
bindsym $super+Left focus left
bindsym $super+Down focus down
bindsym $super+Up focus up
bindsym $super+Right focus right

# move focused window
bindsym $super+Shift+Left move left
bindsym $super+Shift+Down move down
bindsym $super+Shift+Up move up
bindsym $super+Shift+Right move right

# split in horizontal orientation
bindsym $super+h split h

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

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

# change container layout split
bindsym $super+s layout toggle split

# toggle tiling / floating
bindsym $super+space floating toggle

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

# switch to workspace
bindsym $alt+Control+Right workspace next
bindsym $alt+Control+Left workspace prev
bindsym $super+1 workspace 1
bindsym $super+2 workspace 2
bindsym $super+3 workspace 3
bindsym $super+4 workspace 4
bindsym $super+5 workspace 5
bindsym $super+6 workspace 6
bindsym $super+7 workspace 7
bindsym $super+8 workspace 8
bindsym $super+9 workspace 9

# move focused container to workspace
bindsym $super+Shift+1 move container to workspace 1
bindsym $super+Shift+2 move container to workspace 2
bindsym $super+Shift+3 move container to workspace 3
bindsym $super+Shift+4 move container to workspace 4
bindsym $super+Shift+5 move container to workspace 5
bindsym $super+Shift+6 move container to workspace 6
bindsym $super+Shift+7 move container to workspace 7
bindsym $super+Shift+8 move container to workspace 8
bindsym $super+Shift+9 move container to workspace 9

# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $super+Shift+r restart

# exit i3
bindsym $super+q exec "i3-nagbar -t warning -m 'ログアウトするの？' -b 'Yes' 'i3-msg exit'"
bindsym $super+Shift+q exec "i3-nagbar -t warning -m 'シャットダウンするの？' -b 'Yes' 'shutdown -h now'"

# resize window (you can also use the mouse for that)
mode "resize" {
  bindsym Left resize shrink width 5 px or 5 ppt
  bindsym Down resize grow height 5 px or 5 ppt
  bindsym Up resize shrink height 5 px or 5 ppt
  bindsym Right resize grow width 5 px or 5 ppt
  bindsym Return mode "default"
  bindsym Escape mode "default"
}
bindsym $super+r mode "resize"

# panel
#bar {
#  workspace_buttons yes
#  position top
#  colors {
#    background #232629
#    statusline #232629
#    separator #4f4f4f
#
#    # colour of border, background, and text
#    focused_workspace       #ed1515 #da4453 #fcfcfc
#    active_workspace        #95a5a6 #31363b #fcfcfc
#    inactive_workspace      #95a5a6 #31363b #fcfcfc
#    urgent_workspace        #2f343f #ebcb8b #2f343f
#  }
#  status_command i3status
#}

# Start polybar instead of i3bar
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
exec_always --no-startup-id conky

# window rules, you can find the window class using xprop
for_window [class=".*"] border pixel 4
assign [class=qutebrowser] 1
assign [class=Gajim|nheko|Geary] 2
assign [class=Thunar|File-roller] 3
assign [class=Geany|Evince|Gucharmap|Soffice|libreoffice*] 4
assign [class=Audacity|Vlc|mpv|Ghb|Xfburn|Gimp*|Inkscape] 5
assign [class=Lxappearance|System-config-printer.py|Lxtask|GParted|Pavucontrol|Exo-helper*|Lxrandr|Arandr] 6
for_window [class=sxiv|feh|Audacious|File-roller|Lxappearance|Lxtask|Pavucontrol] floating enable
for_window [class=URxvt|Firefox|Geany|Evince|Soffice|libreoffice*|mpv|Ghb|Xfburn|Gimp*|Inkscape|Vlc|Lxappearance|Audacity] focus
for_window [class=Xfburn|GParted|System-config-printer.py|Lxtask|Pavucontrol|Exo-helper*|Lxrandr|Arandr] focus

# colour of border, background, text, indicator, and child_border
client.focused              #bf616a #232629 #fcfcfc #e93de9 #e93de9
client.focused_inactive     #232629 #232629 #fcfcfc #232629 #232629
client.unfocused            #232629 #232629 #fcfcfc #232629 #232629
client.urgent               #232629 #232629 #fcfcfc #232629 #232629
client.placeholder          #232629 #232629 #fcfcfc #232629 #232629
client.background           #232629

for_window [class=".*"] border pixel 4
for_window [class=".*"] border_radius 50
#gaps inner all set 20
gaps inner 14
gaps outer 10
#smart_gaps on
smart_gaps inverse_outer

smart_borders on
#smart_borders no_gaps
