dotfiles/sway/config

305 lines
11 KiB
Plaintext

# Variabili di base
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term foot
# Launcher: wofi (sostituisce wmenu-run)
set $menu wofi -S drun -p Search -I -b -i
# Wallpaper e output
set $wallpaper ~/Nextcloud/wallpapers/laptop/hiroishi_nagasai.png
set $benq_wallpaper ~/Nextcloud/wallpapers/laptop/hiroishi_nagasai.png
set $laptop eDP-1
set $benq DP-9
# Color Scheme (Gruvbox)
set $gruvbox_bg_dark #282828
set $gruvbox_bg_light #504945
set $gruvbox_fg_dark #ebdbb2
set $gruvbox_fg_light #d5c4a1
set $gruvbox_red #cc241d
set $gruvbox_green #98971a
set $gruvbox_yellow #d79921
set $gruvbox_blue #458588
set $gruvbox_purple #b16286
set $gruvbox_aqua #689d6a
set $gruvbox_orange #d65d0e
# Impostazione del wallpaper e configurazione output
output * bg $wallpaper fill
# Imposta il profilo ICC, risoluzione, posizione e scala per il display laptop
output $laptop color_profile icc ~/Documents/dotfiles/sway/FRAMEWORK_13_BOE_ICC/BOE_CQ_______NE135FBM_N41_03.icm
output $laptop resolution 2256x1504 position 0,0
output $laptop scale 1.3
# Configure BenQ display
output $benq bg $benq_wallpaper fill
output $laptop color_profile icc ~/Documents/dotfiles/sway/BENQ_PD2706QN_ICC/'Display P3.icc'
output $benq resolution 2560x1440@99.990Hz position 0,0
output $laptop scale 1.3
# Gestione degli eventi del coperchio
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
# Configurazione dell'inattività: lock e DPMS
exec swayidle -w
input type:touchpad {
dwt enabled # Disable while typing - RIATTIVA QUESTA OPZIONE
tap enabled # Enable tap-to-click
natural_scroll enabled # Natural scrolling
middle_emulation enabled # Emulate middle mouse button - RIATTIVA QUESTA OPZIONE
accel_profile "flat" # Acceleration profile
pointer_accel 0.3
drag enabled # AGGIUNGI: Abilita il drag
drag_lock disabled # AGGIUNGI: Disabilita il drag lock
tap_button_map lrm # AGGIUNGI: Mappa dei pulsanti per il tap
}
input type:pointer {
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
pointer_accel 0.3
}
# Gestione dei gesti: swipe per cambiare workspace
bindgesture swipe:right workspace prev
bindgesture swipe:left workspace next
### Key Bindings di base
# Avvio terminale
bindsym $mod+Return exec $term
# Chiudi finestra focalizzata
bindsym $mod+Shift+q kill
# Avvia il launcher
bindsym $mod+d exec $menu
# Modalità floating: trascina finestre con $mod + mouse
floating_modifier $mod normal
# Ricarica la configurazione
bindsym $mod+Shift+c reload
# Esci da Sway (con conferma tramite swaynag)
# bindsym $mod+Shift+e exec swaynag -t warning -m 'Hai premuto la scorciatoia per uscire. Vuoi davvero uscire da Sway?' -B 'Sì, esci' 'swaymsg exit'
### Navigazione e spostamento tra finestre
# Sposta il focus
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Sposta la finestra focalizzata
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
### Gestione dei Workspaces
# Cambio workspace (1-10)
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Sposta la finestra corrente nel workspace desiderato
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
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
### Gestione del Layout
# Split orizzontale e verticale
bindsym $mod+b splith
bindsym $mod+v splitv
# Cambio layout: stacking, tabbed e toggle split
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Modalità fullscreen
bindsym $mod+f fullscreen
# Toggle tra modalità tiling e floating
bindsym $mod+Shift+space floating toggle
# Passa dal tiling alla sezione floating
bindsym $mod+space focus mode_toggle
# Sposta il focus al contenitore padre
bindsym $mod+a focus parent
### Scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
### Modalità "resize" per ridimensionare le finestre
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
### Notifiche e Controlli Audio/Luminosità
set $notification_time 1000
# Audio controls
bindsym XF86AudioMute exec ~/.config/sway/scripts/notification-control.sh mute-toggle
bindsym XF86AudioLowerVolume exec ~/.config/sway/scripts/notification-control.sh volume-down
bindsym XF86AudioRaiseVolume exec ~/.config/sway/scripts/notification-control.sh volume-up
bindsym XF86AudioMicMute exec ~/.config/sway/scripts/notification-control.sh mic-mute-toggle
# Brightness controls
bindsym XF86MonBrightnessDown exec ~/.config/sway/scripts/notification-control.sh brightness-down
bindsym XF86MonBrightnessUp exec ~/.config/sway/scripts/notification-control.sh brightness-up
# Controlli multimediali
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
### Screenshot e Registrazione Schermo
bindsym Print exec grimshot --notify copy output && \
notify-send -u normal "📸 Screenshot" "Full screen copied to clipboard"
# Screenshot selected area
bindsym $mod+Print exec grimshot --notify copy area && \
notify-send -u normal "📸 Screenshot" "Selected area copied to clipboard"
# Alternative bindings
bindsym $mod+P exec grimshot --notify copy output && \
notify-send -u normal "📸 Screenshot" "Full screen copied to clipboard"
bindsym $mod+Shift+P exec grimshot --notify copy area && \
notify-send -u normal "📸 Screenshot" "Selected area copied to clipboard"
# this one includes audio track in the recording
bindsym $mod+XF86AudioMedia exec ~/.config/sway/scripts/screen-recording.sh audio
# this one not
bindsym XF86AudioMedia exec ~/.config/sway/scripts/screen-recording.sh
### Modalità per azioni di sistema (lock, logout, reboot, suspend, shutdown)
set $mode_system "What to do? (l) lock, (e) logout, (r) reboot, (Shift+s) shutdown"
mode $mode_system {
bindsym l exec swaylock -f -i $wallpaper; mode "default"
bindsym e exec swaymsg exit; mode "default"
bindsym r exec systemctl reboot; mode "default"
bindsym s exec systemctl suspend; mode "default"
bindsym Shift+s exec systemctl poweroff; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Escape mode $mode_system
### Barra di stato (Waybar)
bar {
swaybar_command waybar
}
### Borders e Gaps
default_border pixel
smart_gaps on
gaps outer 2
gaps inner 3
# Impostazioni dei colori per il focus delle finestre
client.focused $gruvbox_orange $gruvbox_orange $gruvbox_bg_dark $gruvbox_orange
hide_edge_borders smart
### Impostazioni GTK per tema scuro
exec_always {
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
gsettings set org.gnome.desktop.interface cursor-theme 'Adwaita'
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
}
### Applicazioni in autostart
exec keepassxc
# exec flatpak run org.keepassxc.KeePassXC
exec nextcloud
# exec flatpak run com.nextcloud.desktopclient.nextcloud
exec wlsunset -S 08:00 -s 18:00
exec blueman-applet
exec xss-lock -- swaylock -f -i $wallpaper
exec --no-startup-id easyeffects --gapplication-service
# exec flatpak run com.github.wwmm.easyeffects --gapplication-service
exec --no-startup-id wluma
# Avvio del polkit agent GNOME
# exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# (Se preferisci il KDE agent, commenta la riga sopra e decommenta quella sottostante)
exec "/usr/lib/polkit-kde-authentication-agent-1"
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
# Importa variabili ambiente per DBus e il desktop corrente
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME
### Notifiche Desktop e Clip History
exec swaync
# exec mako
exec wl-paste --type text --watch cliphist store
exec wl-paste --type image --watch cliphist store
### Applet di rete
exec nm-applet --indicator
# comando per capire come si chiama l'id della app per le regole delle finestre
# swaymsg -t get_tree
### Regole personalizzate per le finestre
for_window [app_id="blueman-manager"] floating enable, resize set width 70 ppt height 60 ppt
for_window [app_id="org.keepassxc.KeePassXC"] floating enable, resize set width 70 ppt height 60 ppt
for_window [instance="keepassxc"] floating enable, resize set width 70 ppt height 60 ppt
for_window [app_id="pavucontrol"] floating enable, resize set width 70 ppt height 60 ppt
for_window [app_id="org.gnome.Nautilus"] floating enable, resize set width 60 ppt height 50 ppt
for_window [app_id="thunar"] floating enable, resize set width 60 ppt height 50 ppt
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [window_role="About"] floating enable
for_window [title="File Operation Progress"] floating enable, border pixel 1, sticky enable, resize set width 40 ppt height 30 ppt
for_window [app_id="floating_shell_portrait"] floating enable, border pixel 1, sticky enable, resize set width 30 ppt height 40 ppt
for_window [title="Picture in picture"] floating enable, sticky enable
for_window [title="Save File"] floating enable
for_window [app_id="firefox" title="Firefox — Sharing Indicator"] kill