# imposta il tasto Mod
set $mod Mod4
# font
font pango: FontAwesome 8
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# avvia il terminale
bindsym $mod+Return exec urxvt
# chiude la finestra in focus
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# avvio automatico
exec --no-startup-id i3-msg 'workspace 1; exec /usr/bin/xcompmgr-fF -t-5 -l-5 -r4.2 -o.55 -D2 -m.75'
exec --no-startup-id i3-msg 'workspace 1; exec sh ~/.fehbg &'
exec --no-startup-id i3-msg 'workspace 1; exec wicd-gtk --tray'
exec --no-startup-id i3-msg 'workspace 1; exec tomboy --panel-applet'
exec --no-startup-id i3-msg 'workspace 1; exec sh /usr/bin/wallpaper.sh'
#exec --no-startup-id i3-msg 'workspace 1; exec telegram & '
exec --no-startup-id i3-msg 'workspace 1; exec dropbox &'
# cambia il fuoco alle finestre
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+ograve focus right
# oppure usando i tasti "freccia":
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# muove la finestra in focus
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+ograve move right
# oppure usando i tasti freccia:
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 orrizzonale
bindsym $mod+h split h
# split in verticale
bindsym $mod+v split v
# va in modalità fullscreen sulla finestra in focus
bindsym $mod+f fullscreen
# cambia il layout container (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# passa da modalità tiling a floating
bindsym $mod+Shift+space floating toggle
# cambia modalità finestre tra tiling e floating 
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
#finestre senza bordi
for_window [class="Firefox"] border none
for_window [class="urxvt"] border none
for_window [class="Midori"] border none
for_window [class="xfce4-terminal"] border none
for_window [class="Xfce4-notifyd"] floating enable; border none; focus mode_toggle
#hide_edge_borders both 
# gestione volume
bindsym $mod+Page_Up exec --no-startup-id amixer -q set Master 3%+ -q
bindsym $mod+Page_Down exec --no-startup-id amixer -q set Master 3%- -q
bindsym $mod+End exec --no-startup-id amixer -q set Master toggle
# variabili personalizzate per gli spazi di lavoro
set $tag1 cmus
set $tag2 IRC
set $tag3 WWW
set $tag4 Spotify
set $tag5 FM
set $tag6 qemu
set $tag7 telegram
set $tag8 HTOP
set $tag9 free
set $tag0 RSS 
# switch tra spazi di lavoro
bindsym $mod+1 workspace 1 $tag1
bindsym $mod+2 workspace 2 $tag2
bindsym $mod+3 workspace 3 $tag3
bindsym $mod+4 workspace 4 $tag4
bindsym $mod+5 workspace 5 $tag5
bindsym $mod+6 workspace 6 $tag6
bindsym $mod+7 workspace 7 $tag7
bindsym $mod+8 workspace 8 $tag8
bindsym $mod+9 workspace 9 $tag9
bindsym $mod+0 workspace 10 $tag0
# sposta la finestra in focus su altro spazio di lavoro
bindsym $mod+Shift+1 move container to workspace 1 $tag1
bindsym $mod+Shift+2 move container to workspace 2 $tag2
bindsym $mod+Shift+3 move container to workspace 3 $tag3
bindsym $mod+Shift+4 move container to workspace 4 $tag4
bindsym $mod+Shift+5 move container to workspace 5 $tag5
bindsym $mod+Shift+6 move container to workspace 6 $tag6
bindsym $mod+Shift+7 move container to workspace 7 $tag7
bindsym $mod+Shift+8 move container to workspace 8 $tag8
bindsym $mod+Shift+9 move container to workspace 9 $tag9
bindsym $mod+Shift+0 move container to workspace 10 $tag0
# ricarica la configurazione
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 'hai premuto la scorciatoia x uscire! davvero vuoi uscire da i3? questo chiuderà la sessione X.' -b 'Si Muoviti' 'i3-msg exit'"
# ridimensiona finestra (oppure con il mouse usando tasto sinistro o destro)
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 j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym ograve 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
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"
# lancia la barra di i3 (plus the system information i3status
# finds out, if available)
bar {
  status_command i3status
  position top
mode dock
workspace_buttons yes
binding_mode_indicator yes
font pango: FontAwesome 8
  colors {
    separator  #4F27EC
    background #2300B5
    statusline #FF006E
    focused_workspace #ffffff #7F009
    active_workspace #FF6600 #6c71c4 #FF6600
    inactive_workspace #586e75 #6EEE00 #002b36
    urgent_workspace #d33682 #d33682 #fdf6e3
  }
}

client.focused #859900 #910099 #fdf6e3 #859900
client.focused_inactive #EB0603 #073642 #eee8d5 #6c71c4
client.unfocused #340051 #340051 #93a1a1 #586e75
client.urgent #d33682 #d33682 #fdf6e3 #dc322f